Author: Aaron Milano, QuickNode; Translation: Golden Finance xiaozou

1 Introduction

Solana Actions and Blockchain Links (Blinks) are two major innovations from Solana that promise to revolutionize how users interact with the blockchain. They promise to enhance the overall user experience of each network platform by enabling user-friendly and seamlessly integrated transactions. Whether it’s sponsoring your favorite influencer, subscribing to premium content, or voting in a DAO, Actions and Blinks enable creators to connect with their audience in effortless new ways anywhere on the web. Imagine a user could post a link on Twitter (e.g., donate.com/to/USER_ADDRESS) and the site would render a sponsorship widget directly in the tweet, like this:

The use cases and possibilities they bring are endless. In this article, we’ll explore what Solana Actions and Blinks are, how they work, and how you can use them to enhance your user interactions with the Solana blockchain.

No coding experience is required to understand this article, but it would be helpful if you have a basic understanding of Solana Pay, because Actions is actually an extension of Solana Pay. Let’s get started now.

Please note that Solana Actions and Blinks are new technologies and the information provided in this article is based on the current state of their technical specifications. As the technology evolves, new features and functionality may be introduced.

2、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-chain. Here’s how they work:

  • GET request: The client sends a GET request to the Action URL to obtain metadata about available actions. The metadata response includes information such as the application name, icon, and available actions. This is useful when presenting a user interface for the action.

  • POST request: After the user selects an action, the client makes a POST request to the Action URL to obtain a signable transaction or message. The user wallet then completes the signature and sends this transaction to the blockchain.

3. How Actions work

  • Initial GET request: The client gets metadata about the available actions at the URL (the website may choose to do this, or the Chrome extension/wallet may do so if it detects a known action URL).

  • Display UI: The client application displays a user interface for performing operations based on the metadata obtained in the GET request.

  • User interaction: The user selects an action, triggering a POST request to retrieve the transaction.

  • Transaction generation: The Action URL generates and returns an encoded transaction based on the user's selection.

  • Transaction Signature: The wallet prompts the user to sign and send the transaction to the network.

Awesome! We now know how Solana Actions work, but how can clients support them? This is where Blockchain Links (Blinks) come in. Let’s explore Blinks next.

4、Blockchain Links(Blinks)

Blinks is a client application that converts Solana Actions into shareable, metadata-rich UIs for interacting with and executing Actions. Blinks does this by:

  • Detecting the Action URL: The Blink URL contains an action request parameter pointing to the Solana Action URL. Blinks detects this parameter.

  • Parsing Action: The Blink client will introspect the Action API link provided in the operation query parameter.

  • User Interface: The client presents a rich user interface that enables the user to complete the 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 using their wallets.

5. URL Scheme mechanism

The Solana Action URL scheme mechanism used by Blinks is as follows:

solana-action:<link>

Where <link> is the URL of the Action API. Links using query parameters must be URL-encoded to avoid conflicts with other protocol parameters.

6. Blinks Actions Detection

Blinks can detect actions in any of three ways:

7. Action Identity and Verification

Solana Actions can include an Action Identity, which is used to attribute on-chain activity to a specific verifiable provider. This identity is included in the transaction as a specially formatted message using the Memo instruction, allowing Indexers and analytics platforms to track and verify the source of the action.

8. Summary

Solana Actions and Blinks are expected to simplify and enhance user interactions 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 that might help you think about how to use Solana Actions and Blinks in your projects:

Example:

  • Sponsor/Pay Users: Share a "Donate to me" Blink on Twitter to have fans donate SOL instantly.

  • Subscribing to premium content: Users subscribe to premium content (e.g., purchase NFTs) via 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 an exclusive channel.

  • Jupiter Exchange Tokens: Sharing an exchange link on YouTube or Twitch allows users to exchange tokens directly through the video player.

  • DAO Voting: A DAO proposal link is shared on Twitter and users vote after reading updates published by the DAO.