Skip to main content

subfrost-runtime: The SUBFROST Runtime

subfrost-runtime is the core of the SUBFROST node. It is a WASM program that contains the consensus logic for the SUBFROST protocol. It is responsible for:

  • Processing blocks: The subfrost-runtime processes blocks from the Bitcoin blockchain and updates the state of the SUBFROST protocol accordingly.
  • Validating transactions: The subfrost-runtime validates transactions that are submitted to the SUBFROST network.
  • Executing smart contracts: The subfrost-runtime executes smart contracts that are written in the SUBFROST smart contract language.

The subfrost-runtime API

The subfrost-runtime exposes a simple API that allows the SUBFROST node to interact with it. The API consists of two functions:

  • subfrost_sync: This function is called by the SUBFROST node to sync the subfrost-runtime with the latest state of the Bitcoin blockchain.
  • subfrost_get_bundle: This function is called by the SUBFROST node to get a bundle of transactions that can be submitted to the Bitcoin blockchain.

The subfrost-runtime in SUBFROST

The subfrost-runtime is a key component of the SUBFROST protocol. It is responsible for maintaining the integrity of the SUBFROST network and for ensuring that all transactions are processed correctly.

Building the subfrost-runtime

You can build the subfrost-runtime using the following command:

cargo build --release -p subfrost-runtime

This will create a WASM file at target/wasm32-unknown-unknown/release/subfrost_runtime.wasm. This file can then be used to run a SUBFROST node.