Intent Transaction Flow
Last updated
Last updated
In the context of the Urani protocol, the intent transaction flow refers to the structured process by which user-initiated transactions are prepared, submitted, and eventually fulfilled.
A durable nonce is a mechanism in Solana that ensures a transaction remains valid even if it is processed later.
Transactions typically rely on a recent block hash to prevent double spending and ensure timely processing. However, a durable nonce replaces the blockhash for transactions that must remain valid for an extended period.
This nonce is a value stored in a dedicated account, and it gets updated each time the nonce is used in a transaction.
Program-derived Addresses (PDAs) are a fundamental component of Solana's architecture. They allow programs to generate addresses deterministically based on specific inputs, ensuring consistent and predictable account addresses without managing private keys. PDAs are particularly useful for creating accounts tied to a program's logic.
Urani leverages PDAs to store intent data in a Solana-native data structure. Additionally, the Urani Protocol needs to call other programs to find the best match and fulfill the transaction. PDAs are essential to such CPIs (Cross-Program Invocations).
Using PDAs, the Urani protocol can effectively manage the data and the flow to accommodate the protocol's needs.
After the transaction is crafted with the necessary data and with both the nonce and PDA added, we need to add the signatures so the funds can be moved appropriately.
In Urani's context, the Nonce Authority signs for the transaction behind the scenes, but we also need to ask for the user's signature with their wallet to allow for the transaction to be completed.
The user gets a popup being asked to sign for the signature. Once the signature is approved, we can submit this transaction to the protocol.
To summarize, here is what happens when the user submits an intent, selecting the tokens and the respective amounts:
Crafting the transaction: Combining all necessary components, including durable nonces and PDAs, to form a valid transaction.
Signing the transaction: Ensuring the transaction is properly signed by the necessary parties (especially the user).
Submitting the transaction: Sending the signed transaction to the Urani for batching, matching, and fulfillment.