Mechanism of Minting stBTC

The minting of stBTC from native BTC is entirely decentralized. Lorenzo ensures the security of received native BTC by introducing well-known custodial institutions like Cobo, Ceffu and Chainup. Lorenzo Chain provides a comprehensive mechanism to verify users' staking operations and mints corresponding stBTC onto the Lorenzo Chain. Users can then leverage protocols like Wormhole and LayerZero to enable omnichain interoperability for stBTC.

Asset Custody

Lorenzo Chain includes an agent module that stores custody information for Lorenzo BTC assets. Currently, it primarily supports Cobo, Ceffu and Chainup for receiving users' staked native BTC assets. The list of agents can be retrieved by invoking the Agents RPC method from the agent module. The btcstaking staking module references this agent module to validate the legality of transactions.

User Staking

Users need to initiate a valid staking transaction on the Bitcoin chain, meeting the following conditions:

  1. Vout Requirements:

  • At least one vout must have an address that is listed in the agent module's Bitcoin address list.

  • Transactions with multiple vouts containing different agent addresses are NOT supported.

  1. OP_RETURN Field:

  • One vout must include an OP_RETURN field, formatted as described below.

  1. Change Address:

  • A vout can include a change address.

  1. Minimum BTC Amount:

  • The transferred BTC amount must exceed a specified threshold (0.00003 BTC).

Definition of OP_RETURN Data Format

  • EVM Address (20 bytes): The address on the target chain where the equivalent stBTC will be received. The user should hold the private key for this address.

  • Chain ID (4 bytes): The target chain’s ID, defaulting to Lorenzo Chain.

  • Plan ID (8 bytes): The ID of the Lorenzo Staking Plan being participated in. Users can view the current active plan and its ID on the Lorenzo official website.

Lorenzo Relayer

The Relayer program is responsible for submitting Bitcoin block headers. It connects to a Bitcoin node and submits the headers to the btclightclient module on Lorenzo. The btclightclient performs the following validations:

  • Verifies the block header's difficulty value.

  • Checks if the parent block header exists.

  • For forks, determines the optimal chain and rolls back if necessary.

If the validation succeeds, the block header data is stored as key-value pairs, where the key is the block hash, and the value is the complete block header data.

Due to the simplicity of the Proof-of-Work (PoW) algorithm, the process of submitting Bitcoin block headers to btclightclient is decentralized. As long as one honest and online relayer exists, the entire verification process remains reliable. Currently, Lorenzo maintains an official relayer.

Submitter

The Submitter program is responsible for submitting valid BTC staking transactions. It monitors Bitcoin chain transactions and preliminarily determines whether they qualify as staking transactions based on whether the primary vout address matches the custodial addresses specified by Lorenzo.

If valid, the Submitter packages the BTC transaction, its proof, and the block hash into a MsgCreateBTCStaking transaction and sends it to Lorenzo’s btcstaking module. Lorenzo performs the following verifications:

  1. Ensures the transaction has not been used to mint stBTC before.

  2. Validates the staked BTC amount and applies different block confirmation requirements:

  • Amount < 0.0004 BTC: Requires 3 confirmations.

  • Amount > 0.02 BTC: Requires 4 confirmations.

  • Amount > 0.1 BTC: Requires 5 confirmations.

  • Amount > 0.5 BTC: Requires 6 confirmations.

  1. Retrieves block header information using the provided block hash and verifies the staking transaction’s inclusion on-chain using the proof.

  2. Confirms the correctness of the vout address.

Only after passing all validations does Lorenzo’s MsgCreateBTCStaking module invoke the bank module to mint stBTC.

Detailed Minting Process

The btcstaking module provides mint and burn functionalities for stBTC. Below is a detailed description of the minting process:

  1. CreateBTCStaking RPC Method:

  • The btcstaking module offers the CreateBTCStaking RPC method for minting stBTC. Key input parameters include the complete Bitcoin transaction, the block’s hash, the transaction’s position in the block, and the transaction’s proof.

  1. Dependency on btclightclient Data:

  • The btclightclient module stores Bitcoin block header data. The Submitter ensures that the block header data exists in btclightclient before invoking the CreateBTCStaking method.

  1. Validation:

  • Retrieves the block header data from btclightclient using the block hash.

  • Validates the transaction using the block header data, transaction data, and proof through PoW and Merkle tree proof.

  1. Minting stBTC:

  • Parses the OP_RETURN field to extract the EVM address, Chain ID, and Plan ID.

  • Sequentially calls the MintCoins and SendCoinsFromModuleToAccount methods of the bank module to mint the equivalent stBTC to the EVM address.

  • Emits an EventBTCStakingCreated event.

Last updated