4 min read
Overview
Solana Actions and Blockchain Links (Blinks) are innovations on Solana that have the potential to revolutionize how users interact with the blockchain. They promise to enhance the overall user experience across various web platforms by enabling seamless, integrated, and user-friendly transactions. Whether donating to a favorite influencer, subscribing to premium content, or voting in a DAO, Actions and Blinks empower creators to connect with their audience in new and effortless ways from anywhere on the web. Imagine, for example, a user being able to post a link on Twitter (e.g., donate.com/to/USER_ADDRESS
), and the site renders a donation widget directly in the tweet like this:
The use cases and possibilities are endless. In this guide, we will explore what Solana Actions and Blinks are, how they work, and how they can be used to enhance user interactions with the Solana blockchain.
No coding experience is required to understand this guide, but a basic understanding of Solana Pay would be helpful as Actions are an extension of Solana Pay. Check out our Solana Pay guide to get started.
Note that Solana Actions and Blinks are new technologies, and the information provided in this guide is based on the current state of the specification. As the technology evolves, new features and capabilities may be introduced. Check back here or the official specification for the most up-to-date information.
Solana Actions
Solana Actions provide a standardized way to deliver signable transactions or messages from an application directly to a user. These transactions can then be executed on-chain. Here's how they work:
GET Request: The client makes a GET request to an Action URL to fetch metadata about the available actions. This metadata response includes information like the application's title, icon, and available actions. This is useful in rendering a user interface for the actions.
POST Request: After a user selects an action, the client makes a POST request to the Action URL to get the signable transaction or message. The user's wallet then facilitates signing and sending this transaction to the blockchain.
How Actions Work
- Initial GET Request: The client fetches metadata about the actions available at the URL (sites may choose to do this or Chrome extensions/wallets may do this when a known action URL is detected).
- Display UI: The client application displays a user interface for performing the actions based on the metadata fetched in the GET request.
- User Interaction: The user selects an action, triggering a POST request to fetch the transaction.
- Transaction Generation: The Action URL generates and returns an encoded transaction based on the user's selection.
- Transaction Signing: The wallet prompts the user to sign and send the transaction to the network.
Source: solana.com
Great! We now know how Solana Actions work, but how do clients go about supporting them? This is where Blockchain Links (Blinks) come into play. Let's explore Blinks next.
Blockchain Links (Blinks)
Blinks are client apps that convert Solana Actions into shareable, metadata-rich UIs for interacting with and executing Actions. Blinks do this by:
- Detect an Action URL: A blink URL contains an action query parameter that points to the Solana Action URL. Blinks detect this parameter.
- Parse the Action URL: The blink client introspects the Action API link provided in the action query parameter.
- User Interface: The client renders a rich user interface that enables the user to complete the action's entire lifecycle (e.g., a button to donate or vote).
- Execute Actions: Users can complete an action's entire lifecycle, including signing transactions with their wallets.
URL Scheme
The Solana Action URL scheme that Blinks uses is as follows:
solana-action:<link>
Where <link>
is the URL of the Action API. Links that use query parameters must be URL-encoded to avoid conflicts with other protocol parameters.
Detecting Actions in Blinks
Blinks can detect actions in one of three ways:
Method | Example | Considerations |
---|---|---|
Explicit Action URL | solana-action:https://actions.alice.com/donate | Any URL that starts with solana-action: will be treated as an action URL. |
Known Action URLs | Create a actions.json that maps a URL (e.g., https://alice.com/donate ) to https://actions.alice.com/donate | Unknown URLs will be treated as regular URLs. |
Interstitial Sites | https://example.domain/?action=<action_url> | Embedding an Action URL in an “interstitial” site URL that understands how to parse Actions. |
Action Identity and Verification
Solana Actions can include an Action Identity to attribute on-chain activities to specific providers verifiably. This identity is included in transactions as a specially formatted message using a Memo instruction, allowing indexers and analytics platforms to track and verify the source of the actions.
Wrap Up
Blink💨 Time to Take Action! Solana Actions and Blinks have the potential to simplify and enhance users' interactions with blockchain transactions. They enable seamless integration of blockchain capabilities into various applications and web surfaces, making blockchain interactions more accessible and user-friendly.
Developers can refer to the Solana Actions and Blinks API documentation for more detailed technical specifications.
Start Building!
We have created a starter template for you to start building your own Action links and Blinks. Check out the Solana Actions and Blinks Starter Template on GitHub.
Here are some ideas to get you thinking about how you might use Solana Actions and Blinks in your projects:
Example Use Cases
- Donate/Pay a User: A "Donate to me" Blink is shared on Twitter, allowing fans to donate SOL instantly.
- Subscribe to Premium Content: Users subscribe to premium content (e.g., buy an NFT) through a Blink on a Discord channel. On-chain metadata is updated to reflect the new subscription and can trigger a bot to grant access to the exclusive channel.
- Jupiter Swap Tokens: A swap link is shared on YouTube or Twitch, allowing users to swap tokens directly from the video player.
- DAO Voting: A DAO proposal link is shared on Twitter, and users cast their votes after reading an update posted by the DAO.
Resources
- Solana Actions Documentation
- Solana Actions and Blinks Starter Template
- Sample Reference Implementation
- Solana Actions JavaScript SDK (NPM | GitHub)
- Dialect Blinks Chrome Extension Beta
- Dialect GitHub Examples (Actions | Blinks)
We ❤️ Feedback!
Let us know if you have any feedback or requests for new topics. We'd love to hear from you.