Trust Machines Logo

An Introduction to Trustless Computer

A customized L2 to Bitcoin is contributing to the Bitcoin L2 ecosystem.
Read Time 10 min
Featured Image

The enthusiasm within the Bitcoin ecosystem is witnessing unprecedented levels of development this year as builders continue to ship new products. Sovereign Bitcoin rollups and Bitcoin layers have become the driving force behind the scaling landscape within the ecosystem. While the Bitcoin blockchain has proven its prowess in data validation and availability, limitations on block size and transaction processing speed have remained challenges.

Trustless Computer — a turnkey solution that offers a customized layer 2 to Bitcoin has been making waves. This article will explore the concepts behind Trustless Computers, an EVM-based smart contract scaling solution leveraging Bitcoin and Polygon.

What is a Trustless Computer?

The Trustless Computer is a Bitcoin sovereign rollup that uses a modified virtual machine similar to the Ethereum Virtual Machine (EVM). This base layer is known as the Bitcoin Virtual Machine (BVM). It is a Turing-complete virtual machine written in GO, enabling smart contract capability. 

Turing completeness refers to the smart contract programming language’s capability of simulating a Turing machine, which means it can handle any computational task and execute infinite algorithms. In contrast, a Turing-incomplete language lacks this capability and is limited in the range of computations it can perform, often enhancing security and predictability.

Transactions executed in the BVM are batched and then posted to the Bitcoin blockchain, inheriting Bitcoin’s validation and finality, demonstrating its properties of being a Layer 2. There are various types of Trustless Computers, which we’ll discuss in more detail below.

How Does Trustless Computer Work?

Functioning as a Bitcoin sovereign rollup, the Trustless Computer uses the blockchain for data validation and finality. Due to Bitcoin’s data availability (DA) constraints, TC leverages the Polygon network for DA and incorporates Optimistic rollups to improve scalability.

This amalgamation results in a customizable Bitcoin Layer 2 solution that users can deploy at New Bitcoin City. The TC tech stack could be broken down into layers or considered a series of “trustless computers” working in concert.

Trustless Computer #0: Bitcoin Virtual Machine

The execution of smart contracts is made possible with the BVM. This modified version of the EVM supporting larger transaction sizes and higher block gas limits is considered Trustless Computer #0. This is where TC transactions are bundled and submitted to BVM Local Mempools before the Transaction Modules organize and write the BVM transactions to the Bitcoin blockchain.

Each BVM node maintains a collection of pending transactions that users send to the node in a local mempool. These local mempools aren’t shared with other nodes and help verify the validation of BVM transactions before they are written to the Bitcoin blockchain. Transactions are only visible when written to a Bitcoin transaction and broadcast to the Bitcoin network.

Transaction Modules

Similar to Ordinals, (BVM) transaction data is embedded into a Bitcoin transaction via the witness data field. The TxWriter module embeds data in a way that doesn’t impact its transaction verification or logic. Writing data to a Bitcoin transaction requires a two-phase transaction process. 

  • Phase 1: The transaction commit involves creating an unspent transaction output (UTXO) that indicates the witness/script hash for spending. 
  • Phase 2: The UTXO from phase 1 reveals the witness data within the BVM transaction.

The state of the BVM is managed and organized with the TxReader module. It is responsible for sorting all BVM transactions by gas fees in each new Bitcoin block before transactions are submitted to the BVM. It also ensures the state of all BVM nodes are in sync. 

In a Bitcoin reorganization where the blockchain forks due to different blocks being added to the chain, the TxReader is designed to revert to the BVM’s state before the fork, then re-adding valid blocks.

A visual representation of the process can be found in Trustless Computer documentation.

Trustless Computer #1: Rollup Architecture

Trustless Computer currently uses a modified version of Optimism’s OP stack, an Optimistic Rollup supporting Bitcoin. This custom rollup implementation, called Nitrous Oxide System (NOS), is effectively the Layer 2 used to boost transaction throughput, thus improving scalability.

NOS is Trustless Computer #1 built on the BVM (Trustless Computer #0). The Sequencer collects NOS transactions, which are then compressed and written to Polygon, the data availability layer. These batched transactions are submitted to the BVM as data proofs, where the BVM executes transactions before posting its BVM block hash to the following Bitcoin block.

Builders developing NOS applications benefit from the battle-tested OP stack's scalability. Application-level transactions are settled to NOS before this data is validated in the BVM and ultimately onto the Bitcoin blockchain.

Running a Trustless Computer Node

Setting up a Trustless Computer is customizable and offers selections ranging from your choice of rollup (e.g., Optimistic or ZK), block times, withdrawal times, and more. Below, we’ll briefly describe the steps on running a Trustless Computer full node. More details can be found here.

  • Operators must install Bitcoin Core, which comes with a Bitcoin full node and a Bitcoin wallet out of the box. 
  • Install Trustless Computer #0 and run the file.
  • Add Trustless Computer #0 to a wallet (MetaMask) - This option is available due to TC #0 reusing the EVM
  • Set up a Trustless Computer Block Explorer with Blockscout 
  • Select a preferred development environment - Hardhat is used by the dev team.
  • Set up Bitcoin and Trustless Computer wallets

New Technologies on Bitcoin

The emergence of Bitcoin Sovereign Rollups (BSR) introduces an effective way to bring scalable solutions to the blockchain. Trustless Computer takes a different scaling approach than its competitors like Stacks or Rootstock.

Since BSRs solely rely on the underlying chain for data validation, it enables flexibility in sourcing data availability and smart contract execution. Although smart contracts on TC are not written in Bitcoin Core, TC offers a relatively new solution to deploying Layer 2s on Bitcoin.

Share This Article
Builder Tracking Pixel