Backend Walk Through
Overview
MSafe uses move modules to store essential data of transaction on chain. Basically, the transaction payload and signatures are stored in the multi-sig wallet's resource data in deployed MOVE module, and the executor will collect the signatures from chain, assemble signatures to form multi-ed25519 signatures, and submit the transaction through MSafe wallet.
MSafe registration
For example, for a 3/5 multi-sig wallet created by 5 public keys A, B, C, D, and E. The process of the MSafe multi-sig wallet will follow the following process:
Alice initiate a wallet creation by constructing the transaction
momentum_safe.register,
and submit their signature by sending a transaction callingcreator.initTransaction
to submit the wallet creation request.Bob submit their signature to approve the creation of MSafe through
creator.submit_signature
.Charlie collects the signature from Alice and Bob, combine their signatures, form a transaction, and submit it on blockchain.
The function
MomentumSafe.register
is called, and data is publish under the multi-sig wallet’s resource. Thus MSafe wallet is initialized and registered on blockchain.
Sending a transaction
The process of sending a transaction will follow the following process:
Alice initiates a new transaction through
momentum_safe.initTransaction
and submits the transaction payload and their signature.Bob submit their signature on-chain through
momentum_safe.submit_signature
.Charlie collects the two signatures from Alice and Bob, combines their signature, forms a transaction, and submits it to the blockchain.
The transaction passes multi-ed25519 signature verification and is finalized in the blockchain.
Revoke a transaction
Sometimes, the user may want to revoke a transaction to unblock the following transactions.
Alice initiates a transaction Tx1.
Bob initiates a transaction Tx2. Tx2 will be blocked by Tx1.
Bob, Charlie, and Danny want to revoke Tx1, they sign a dummy transaction Tx1’ with the same sequence number as Tx1, and submit it to the blockchain.
Tx1’ is finalized by blockchain, and Tx1 is pruned.
Tx2 will be submitted again and further finalized after Tx1’ is finalized.
Last updated