Transaction Signing

How Capsule Generates a Transaction Signature
The process of transaction signing in Capsule is a secure, methodical approach that guarantees the integrity and authenticity of the user's transactions. It relies on strong cryptographic methods and thorough checks to validate each transaction before it is propagated to the network. Here's a step-by-step rundown of the process:

Step 1: User Intent and Raw Transaction

Transaction signing begins when a user performs an action that requires a blockchain transaction. For instance, this could be a token lending operation. The application or client then generates a raw transaction object corresponding to this user intent. This raw transaction contains all the necessary data to execute the intended operation on the blockchain network.

Step 2: Transaction Signing by the User

Next, the raw transaction object is passed to the signer. Here, the transaction is signed using an in-memory key that is retrieved from the device’s keystore. The in-memory key ensures a secure signing process, as it is never exposed outside of the device's secure memory. The signing process validates the user's intent and authorizes the transaction.

Step 3: Transaction Verification by Capsule

Following the user's signature, the client sends the transaction information and the session token to the Capsule server. Capsule first validates the session token, ensuring that the user is authenticated and that the session is valid. Then, it checks the scope of the transaction, confirming that the user has the necessary permissions to execute the intended operation.

Step 4: Capsule's Signature and Transaction Submission

Once the checks pass, Capsule signs the same transaction using its secure signing methods. Capsule then combines its signature with the user's signature, creating a multi-signature transaction. This transaction is submitted to the corresponding blockchain network for execution.

Step 5: Transaction Receipt

Finally, Capsule returns the transaction receipt to the application. This receipt allows the application to track the success of the transaction on-chain, providing visibility into the transaction's status and finalization.
Through this comprehensive transaction signing process, Capsule ensures the security, authenticity, and integrity of each transaction, providing a robust framework for interacting with blockchain networks.