State Registries
Last updated
Last updated
State Registries are contracts which facilitate the transfer of data in various ways from Chain A to Chain B in Superform. They must implement BaseStateRegistry
and are used by core contracts to fulfill crosschain deposits and withdrawals.
Dispatching and receiving payloads is executed via multiple Arbitrary Message Bridges (AMBs) to establish secure communication channels between core contracts deployed on multiple chains. Superform utilizes a multi-bridge system where one bridge sends the full payload and at least one other bridge sends a keccak-encoded proof. Each individual arbitrary message bridge has its own adapter contract discussed in AMB Implementations.
This multi-bridge system provides much greater security over a single AMB system. This is because it would require two of Superform's supported AMBs to be simultaneously compromised in order for a malicious actor to successfully fabricate a valid message and proof. An additional safety check is performed by validating the message and proof against Superform off-chain infrastructure before executing the state registry data.
There are three functions every State Registry must implement:
Dispatch payloads
Receive payloads
Process payloads
These are discussed in the context of individual State Registry contracts in the following sections. Currently, the only State Registry contract which Superform supports is CoreStateRegistry
, used for standard vault deposit and withdrawals.
Proofs must be sent though at least an amount of bridges matching the quorum. Quorums for the required number of AMB implementations which must be used by State Registries are set in QuorumManager
, an abstract contract implemented in SuperRegistry, detailed more here .