Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
oip title author discussions-to status type category (*only required for Standard Track) created requires (*optional) replaces (*optional)
Anchor - Immutably Archived State Roots
Martin Schenck (@schemar) <>
Standards Track

Anchor - Immutably Archived State Roots

Simple Summary

By copying state roots in between blockchains, we can assert state of each blockchain on the respective other chain.


Anchoring a state root means storing the state root of a blockchain on another blockchain. The blockchain where the state root is from is therefore an anchored blockchain.

Storing the state root on a blockchain archives it immutably. Anyone can use the anchored state root to prove the state of the anchored blockchain on the blockchain where the state root is anchored.

As an example, we can use an anchor to prove, on-chain, that a certain state was included in the other, anchored chain. This way, we can for example prove, that a staker has staked a specific amount on origin and can mint the corresponding tokens on auxiliary.


The anchor is an alternative to a mosaic core. It radically simplifies the process of how state roots are shared across chains. Instead of mosaic's set of staked PoS validators, the anchor relies solely on an organization to provide state roots across chains.

Depending on the use-case, an anchor or a mosaic core may be preferred. An anchor makes it much, much easier to deploy a side chain as compared to a mosaic core.


An Anchor provides a method to anchor a state root. It also implements the StateRootInterface to make the state root later available on-chain.

 *  @notice Anchor new state root for a block height.
 *  @param _blockHeight Block height at which the state root was valid.
 *  @param _stateRoot State root at given block height.
 *  @return succes_ Whether anchoring was successful.
function anchorStateRoot(
    uint256 _blockHeight,
    bytes32 _stateRoot
    returns (bool success_);
interface StateRootInterface {

     * @notice Gets the block number of latest committed state root.
     * @return height_ Block height of the latest committed state root.
    function getLatestStateRootBlockHeight()
        returns (uint256 height_);

     * @notice Get the state root for the given block height.
     * @param _blockHeight The block height for which the state root is fetched.
     * @return bytes32 State root at the given height.
    function getStateRoot(uint256 _blockHeight)
        returns (bytes32 stateRoot_);



The method anchorStateRoot is kept simple on purpose. The state root and the height of the block that contains that state root are sufficient to prove a certain state at a certain height. A relevant state to prove could be the fact that value was locked into a gateway or co-gateway.

We decided to implement the StateRootInterface with the Anchor as this enables interchangeability between implementations that provide the state root to other contracts, for example the gateway or co-gateway.

An alternative to the anchor is a mosaic core. The main difference is that the mosaic core requires a set of staked validators. The anchor on the other hand requires only an "organization" to anchor a state root.