Architecture

The BVM is a state machine similar to the Ethereum Virtual Machine (EVM), utilizing Bitcoin as a data layer to achieve transaction-level consensus. This approach allows the BVM to function as a general-purpose state machine while leveraging Bitcoin's security and data availability without requiring an additional network or consensus protocol.

Local Mempool

Each node maintains a local mempool, a collection of transactions sent by users. The mempool helps verify the validity of transactions before they are written to the Bitcoin blockchain. This mempool is local and not shared with other nodes, ensuring that transactions are only exposed publicly when written to a Bitcoin transaction through the TxWriter process.

TxWriter

The TxWriter module enables the embedding of BVM transactions into Bitcoin transactions. This process is achieved by utilizing a technique similar to that of Ordinals, where data is inscribed into the Bitcoin network. Specifically, the BVM transaction data is embedded into a Bitcoin transaction via the witness data field in a way that does not affect the verification process or the transaction logic.

TxReader

The TxReader module is responsible for filtering BVM transactions from every new Bitcoin block and ensuring consistent state across all StratoVM nodes, even in the event of a reorg. For each Bitcoin block, the BVM filters the BVM transactions, sorts them by gas fees, and imports them into the virtual machine as a BVM block. Since Bitcoin has an immutable, deterministic order, every honest node will maintain the same state.

To handle Bitcoin reorgs, the TxReader is designed to revert the BVM state to the point of the forked branch and then re-import the valid blocks into the reverted state, ensuring consistency across the network.

Last updated