Contract
Vessel’s contract acts as a secure vault to store all user assets, allowing them to be moved only under the constraints of valid SNARK proofs. Unlike traditional DeFi contracts that encode all business logic in Solidity code, Vessel uses an on-chain state root to track changes in off-chain states such as user balances.
SNARK Verifier
SNARK proofs are verified by a public, upgradeable SNARK verifier. Since Vessel open-sources its circuit repository, anyone can generate the SNARK verifier and compare its bytecode with the on-chain verifier, ensuring that the on-chain state is updated according to the rules specified in the circuit.
Inbound and Outbound Messages
In some scenarios, the Merkle tree root alone does not capture all state changes. To address this, we introduce Inbound and Outbound Messages. Inbound Messages carry information from the smart contract to the off-chain system, while Outbound Messages carry information in the opposite direction. Inbound Messages are typically used in scenarios such as "Register" and "Deposit," whereas Outbound Messages are used for "Withdraw."
Messages in both channels are processed sequentially, allowing us to use an accumulated hash to track progress. This hash is encoded in the SNARK proof as a public instance, alongside the Merkle tree root.
Last updated