Introduction
Solana Actions and Blockchain Links (Blinks) are two major innovations of Solana, with the potential to completely change the way users interact with the blockchain. They promise to enhance the overall user experience of various network platforms by enabling seamless integration of user-friendly transactions. Whether it’s sponsoring your favorite influencer, subscribing to premium content, or voting in a DAO, Actions and Blinks allow creators to connect with their audience in new effortless ways anywhere on the web. Imagine a user being able to post a link on Twitter (e.g. donate.com/to/USER_ADDRESS), and the website directly presents a sponsorship widget in the tweet as shown below:
The use cases and possibilities they bring are endless. In this article, we will explore what Solana Actions and Blinks are, how they work, and how to use them to enhance user interaction with the Solana blockchain.
Understanding this article does not require coding experience, but it would be helpful if you have a basic understanding of Solana Pay, as Actions are essentially an extension of Solana Pay. Let’s get started.
Please note that Solana Actions and Blinks are new technologies, and the information provided in this article is based on their current technical specifications. New features and functionalities may be introduced as the technology develops.
Solana Actions
Solana Actions provide a standardized way to pass signable transactions or messages from applications directly to users. These transactions can be executed on the chain. Here’s how they work:
GET request: The client makes a GET request to the Action URL to retrieve metadata for available actions. The metadata response includes the application’s program name, icon, and available actions, which is useful for rendering the user interface for actions.
POST request: After the user selects an action, the client makes a POST request to the Action URL to obtain signable transactions or messages. The user’s wallet then signs and sends the transaction to the blockchain.
Actions Workflow
Initial GET request: The client retrieves metadata about available actions on the URL (the website can choose to do this, or Chrome extensions/wallets can do so when a known action URL is detected).
Display UI: The client application displays a user interface for executing actions based on the metadata obtained from the GET request.
User interaction: The user selects an action, triggering a POST request to obtain a 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 sends the transaction to the network.
Great! Now that we know how Solana Actions work, how do clients support them? This is where Blockchain Links (Blinks) come in. Let’s explore Blinks next.
Blockchain Links (Blinks)
Blinks are client applications that convert Solana Actions into shareable, metadata-rich UIs for interacting with and executing actions. Here’s how they do it:
Detecting Action URL: The Blink URL contains operation request parameters pointing to the Solana Action URL. Blinks detect this parameter.
Parsing Action: The Blink client introspects the operation query parameters provided in the Action API link.
User interface: The client presents a rich user interface that allows users to complete the entire lifecycle of an action (e.g. a sponsorship or voting button).
Executing Actions: Users can complete the entire lifecycle of an action, including signing transactions with their wallets.
URL Scheme Mechanism
The Solana Action URL scheme used by Blinks is as follows:
solana-action:
where is the URL of the Action API. Links with query parameters must be URL-encoded to avoid conflicts with other protocol parameters.
Blinks’ Actions Detection
Blinks can detect operations through any of the following three methods:
Action Identity and Verification
Solana Actions can include an Action Identity that categorizes on-chain activity under specific verifiable providers. This identity is included in transactions as a special format of a message using the Memo instruction, allowing indexers and analytics platforms to track and verify the origin of the action.
Summary
Solana Actions and Blinks are poised to simplify and enhance user interaction with blockchain transactions. They can seamlessly integrate blockchain functionality into various applications and web interfaces, making blockchain interactions more accessible and user-friendly.
Here are some ideas to consider for using Solana Actions and Blinks in your project:
Use cases:
Sponsoring/paying users: Share a “Donate to me” Blink on Twitter, allowing fans to donate SOL immediately.
Subscribing to premium content: Users can subscribe to premium content (e.g. purchasing NFTs) through a Blink on a Discord channel. Updates to on-chain metadata can reflect new subscriptions and trigger bot authorization to access exclusive channels.
Jupiter token exchange: Share exchange links on YouTube or Twitch, allowing users to exchange tokens directly through the video player.
DAO voting: Share DAO proposal links on Twitter, allowing users to vote after reading updates from the DAO.