- Bitcoin
- Ethereum
- Hemi
- Learn Center
- November 18, 2024
Inside the Hemi Tech Stack
Here’s how we built Hemi.
The Hemi project bridges the worlds of Bitcoin and Ethereum, creating a unified, secure, and interoperable blockchain ecosystem. The software stack in this diagram showcases the essential components that enable this ambitious cross-chain functionality. Here’s a closer look at each element and how they work together within Hemi’s infrastructure.
Key Components and Their Roles
- Bitcoind
At the foundation of the Bitcoin network connection is Bitcoind, the reference implementation of Bitcoin. Bitcoind functions as the primary node for all Bitcoin-related data and transactions, ensuring that Hemi has direct, reliable access to the Bitcoin network. This component fetches and verifies Bitcoin transactions, ensuring that all data is accurately mirrored within Hemi’s ecosystem. - Electrs
Electrs is a lightweight implementation of the Electrum wallet server written in Rust. It was originally meant to fill in the needs of RPCs that bitcoind did not offer, it will soon be deprecated. - BFG
BFG stands for “Bitcoin Finality Governor. Its job is to query and keep track of bitcoin blocks and transactions in the canonical bitcoin chain. Whilst doing that, it will parse out PoP Transactions and determine which addresses are to be paid out in $HEMI. - Postgres
A reliable database system, Postgres is used to store, manage, and retrieve data related to the bitcoin chain. This allows us to efficiently, declaratively, and reliably query bitcoin chain data. . - op-node, op-batcher, and op-proposer
These three modules represent the operations layer in Hemi’s modular setup, likely part of the optimistic rollup architecture.- op-node serves as the node interface, enabling data flow across the different parts of the stack. It also rolls up pop payouts.
- op-batcher consolidates transactions from the Hemi network, preparing them for efficient processing and posting.
- op-proposer plays a critical role in organizing or sequencing transactions, ensuring they are finalized in the correct order. These components optimize transaction throughput and minimize latency, providing scalability.
- Geth
Geth is the Ethereum client that allows Hemi to interface directly with the Ethereum network. Through Geth, the Hemi stack can fetch Ethereum transactions, execute smart contracts, publish L2 Blocks to achieve superfinality, and update state changes within Ethereum’s ecosystem. Geth is a critical link, bringing Ethereum’s functionality into the Hemi project and enabling cross-chain interactions. - Prysm
Prysm is an Ethereum 2.0 client, primarily used for Ethereum’s proof-of-stake consensus mechanism. The Prysm project is a Go-based implementation of the Ethereum protocol, following the official specifications. It includes a complete beacon node and a validator client to enable participation in blockchain consensus. Prysm is built with production-grade tools: Google’s gRPC library for interprocess communication, BoltDB for optimized, persistent key-value storage, and libp2p by Protocol Labs to manage all peer-to-peer networking. - op-geth
The L2 Chain data node; it stores the L2 chain. - TBC
TBC stands for “Tiny BitCoin”. It is the embeddable library in which programs (such as op-geth) can join the bitcoin block chain without a separate process.
How These Components Work Together in Hemi
The software stack in Hemi’s infrastructure enables seamless interoperability between Bitcoin and Ethereum, creating a cohesive system that maximizes the strengths of both networks. Here’s how it all fits together:
- Data Flow and Cross-Chain Interoperability: Bitcoind, Electrs, and Geth ensure that Hemi has real-time access to both Bitcoin and Ethereum networks, while Postgres stores critical data that multiple components can access. The op-node, op-batcher, and op-proposer modules streamline transactions across Hemi’s layer-2 setup, maintaining high throughput and low latency.
- Optimized Rollups for Scalability: The op components work together to handle transactions efficiently within the Hemi ecosystem. By processing transactions in batches and proposing them in an organized manner, Hemi achieves scalability without sacrificing security. This architecture aligns with Ethereum’s rollup design, allowing Hemi to handle high transaction volumes and maintain stability.
- Security and Consensus Integration: Through Prysm and Geth, Hemi incorporates Ethereum’s proof-of-stake (PoS) and Ethereum 2.0 functionalities, enhancing its consensus model with Ethereum’s security. This setup ensures that Hemi benefits from both PoS and PoW security principles.
- Scalability and Modularity: The modular design of Hemi means each component works independently yet in harmony, allowing for continuous updates and upgrades. Components like op-geth are optimized for the rollup environment, allowing Hemi to maintain a high degree of scalability.
The Hemi project’s software stack is a multi-layered system combining Bitcoin’s security, Ethereum’s smart contract functionality, and layer-2 scalability. By leveraging a modular approach and various optimized components, Hemi aims to bridge these two ecosystems while providing a robust, scalable, and secure environment for cross-chain decentralized finance (DeFi) applications.