Skip to content

Solidity: v1.2.0

Compare
Choose a tag to compare
@pdyraga pdyraga released this 03 Apr 10:44
· 1089 commits to main since this release
8b59d5e

solidity/v1.2.0 is the release of two Solidity smart contracts supporting L2 bridging. Those two contracts will be deployed on EVM-compatible sidechains and L2s to enable efficient cross-chain tBTC liquidity. This release did not lead to the deployment of any contracts on the Ethereum Mainnet. The code released in this version is imported by respective cross-chain modules for EVM-compatible chains.

  • L2TBTC: Canonical L2/sidechain token implementation. tBTC token is minted on L1 and locked there to be moved to L2/sidechain. By deploying a canonical token on each L2/sidechain, we can ensure the supply of tBTC remains sacrosanct, while enabling quick, interoperable cross-chain bridges and localizing ecosystem risk.

    This contract is flexible enough to:

    • Delegate minting authority to a native bridge on the chain, if present.
    • Delegate minting authority to a short list of ecosystem bridges.
    • Have mints and burns paused by any one of n guardians, allowing avoidance of contagion in case of a chain- or bridge-specific incident.
    • Be governed and upgradeable.

    The token is burnable by the token holder and supports EIP2612 permits. A token holder can authorize a transfer of their token with a signature conforming EIP712 standard instead of an on-chain transaction from their address. Anyone can submit this signature on the user's behalf by calling the permit function, paying gas fees, and possibly performing other actions in the same transaction. The governance can recover ERC20 and ERC721 tokens sent mistakenly to the L2TBTC token contract.

  • L2WormholeGateway: Selected cross-ecosystem bridges are given the minting authority for tBTC token on L2 and sidechains. This contract gives a minting authority to the Wormhole Bridge.

    The process of bridging from L1 to L2 (or sidechain) looks as follows:

    1. There is a tBTC holder on L1. The holder goes to the Wormhole Portal and selects the chain they want to bridge to.
    2. The holder submits one transaction to L1 locking their tBTC tokens in the bridge’s smart contract. After the transaction is mined, they wait about 15 minutes for the Ethereum block finality.
    3. The holder submits one transaction to L2 which is minting tokens. After that transaction is mined, they have their tBTC on L2.

    The process of bridging from L2 (or sidechain) to L1 looks as follows:

    1. There is a tBTC holder on L2. That holder goes to the Wormhole Portal and selects one of the L2 chains they want to bridge from.
    2. The holder submits one transaction to L2 that is burning the token. After the transaction is mined, they wait about 15 minutes for the L2 block finality.
    3. The holder submits one transaction to L1 unlocking their tBTC tokens from the bridge’s smart contract. After that transaction is mined, they have their tBTC on L1.

    This smart contract is integrated with step iii. of L1->L2 bridging and step i. of L2->L1 or L2->L2 bridging. When the user redeems the token on L2, this contract receives the Wormhole tBTC representation and mints the canonical tBTC in an equal amount. When the user sends their token from L1, this contract burns the canonical tBTC and sends Wormhole tBTC representation through the bridge in an equal amount.

The NPM package is available in the NPM registry as @keep-network/tbtc-v2@1.2.0


The commit hash for clean builds is 8b59d5e15e0b368b5bfba269312f1481f88ad224.

Signatures of commit hash from the development team (verify these in the Keybase app):

  • @pdyraga
    BEGIN KEYBASE SALTPACK SIGNED MESSAGE. kXR7VktZdyH7rvq v5weRa0zk8SRO9e gN94erb57G43YvY asc2ypx7KtJhJpq tOozFkj38nmzbv9 WNLNJ9RYX81bFSB hASCbZPMtNhUVLc ImMVa5cZML9E0hz hLcqLvTCWmUbsAi RKPQdUv3IzIj2G7 YXJ0dOxG610QzYy DadJ1WSn7NFmjMl R9vflX9KeHJvHC0 GSHFirzwy50tsqN 7NK8Q0S8Pb8lHUG EJKea55SY9fhaCa . END KEYBASE SALTPACK SIGNED MESSAGE.

  • @nkuba
    BEGIN KEYBASE SALTPACK SIGNED MESSAGE. kXR7VktZdyH7rvq v5weRa0zkUgHswq LONGnytauGuQ68W zKcm0YTewHXEGd3 2M8FiSegATqrOrI BGDV4jqEJ1ocetF JASSPZUspXS871n APaOBjsarEvgF3K 5tIQ5prH0GrLkzM QeGwd0SrErWAQiY 8s8IgGvoT9nE8bu GuWZKIKYG9pVRn3 qkRHamPGEYW3fQb cKJqjUna82G9RWn DHpys0S8Pb8lHUG EJKea55SY9fhaCa . END KEYBASE SALTPACK SIGNED MESSAGE.


Finally, note that the full set of work that went into the solidity/v1.2.0 version can be found in the corresponding solidity/v1.2.0 milestone.