Hemi 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 13쪽 중 4쪽

ross-chain asset transfer.  *** ## 🔄 Tunneling Hemi-Native and Bitcoin-Native Assets to Ethereum Hemi’s tunneling process is not limited to Ethereum-native assets. Phase 2 of Hemi's Ethereum Tunnel will support Hemi-native and Bitcoin-native assets, extending the functionality of the tunnels to a broader range of assets. This capability is crucial for enabling the use of Bitcoin within Ethereum’s extensive decentralized finance (DeFi) ecosystem, which traditionally lacks native Bitcoin interoperability.  #### **Withdrawal to Ethereum** 1. The process for tunneling Hemi-native assets begins with the user submitting a deposit transaction on Hemi, locking their native assets within Hemi’s native asset tunnel contract.  2. Similar to Ethereum-native asset transfers, the state root containing this deposit transaction is published to Ethereum.  3. Once the rollup state root is confirmed (following Bitcoin finality and the absence of any disputes), the user submits a deposit proof on Ethereum to claim the corresponding representative tokens. These tokens represent the Hemi-native assets within the Ethereum ecosystem and can be used in Ethereum dApps or traded just like any other Ethereum-based token. **Deposit to Hemi** 1. Moving Hemi-native assets back to Hemi from Ethereum involves a similar process. The user initiates a withdrawal on Ethereum, burning the representative tokens.  2. This triggers Hemi’s block derivation protocol to include the withdrawal in the next Hemi block derived from the corresponding Ethereum block.  3. Once the withdrawal is processed, the Hemi-native assets are transferred from Hemi’s native asset tunnel contract back to the user, completing the return to Hemi’s L2 environment. One of the core advantages of this system is its flexibility. It allows Bitcoin-native assets, which are traditionally siloed on the Bitcoin network, to be tunneled through Hemi and into Ethereum. This enables Bitcoin to participate in Ethereum’s DeFi ecosystem while maintaining the security and decentralization that Bitcoin’s Proof-of-Work consensus provides. *** ## 🔍 Comparison to Standard Ethereum Bridges While Hemi’s Ethereum Tunnels share the foundational principles of traditional bridges like the Standard Bridge, there are several critical distinctions: * The primary distinction between Hemi’s Tunnels and standard bridges lies in the finality model and security architecture. Standard bridges depend on an optimistic model with a delayed dispute window. The withdrawal process on these bridges typically takes **a week or longer**, as they await the potential for fraud proofs before finalizing the transaction. * Hemi Tunnels enhance this process by incorporating Bitcoin finality. Instead of relying solely on an Ethereum-based dispute window, Hemi uses Bitcoin’s Proof-of-Work consensus as an additional layer of security. This allows Hemi to finalize transactions more quickly, as the Bitcoin network’s finality period is shorter and more secure than the traditional dispute windows of optimistic rollups. * Hemi will decentralize the dispute process by distributing the Challenger role across a wider set of participants. This decentralization mitigates the risk of collusion or centralization of power within the bridging system, offering a more secure alternative to centralized or semi-centralized dispute mechanisms found in standard bridges. # Bitcoin Tunnel {% hint style="info" %} ### 📜 **TL;DR:** * Hemi’s Bitcoin Tunnel enables the secure transfer of Bitcoin and Bitcoin-native assets (such as Ordinals and BRC-20 tokens) between Bitcoin, Hemi, and eventually, EVM-compatible networks. * The Bitcoin Tunnel contract uses hVM to track Bitcoin addresses and outputs tied to custodianship vaults, ensuring efficient and secure asset management. * Hemi will offer two custodianship models: overcollateralized multisig and BitVM. These ensure decentralized, trust-minimized asset tunneling with high security and performance. {% endhint %} *** ## 🚊 How Bitcoin Tunnels Work The Bitcoin Tunnels allow Bitcoin assets to move between Bitcoin and Hemi by locking assets in custodial vaults and minting representative tokens on Hemi. Users can freely use these tokens on Hemi, and eventually, tunnel them to Ethereum or other EVM-compatible networks. #### **Deposit to Hemi** 1. Users generate a deposit transaction by sending Bitcoin (or Bitcoin-native assets) to the selected custodianship vault’s Bitcoin address, managed by the multisig. 2. Once sent, the Bitcoin assets are locked in the custodianship vault. 3. Hemi’s Bitcoin Tunnel verifies the successful deposit on the Bitcoin network by monitoring the UTXO table for the corresponding deposit. If the deposit is successfully verified, the system moves to the next step.  4. Upon verification, Hemi mints representative tokens equivalent to the deposited Bitcoin assets. These tokens are sent to the user’s Hemi address. Hemi mints the representative tokens after 6 Bitcoin confirmations, or approximately **one hour.** #### Withdrawal to Bitcoin 1. The user on Hemi initiates a withdrawal transaction by selecting the amount of representative tokens they want to convert back to Bitcoin. 2. These representative tokens are burned on the Hemi network, signaling the system that the user intends to withdraw the corresponding amount of Bitcoin from the custodianship vault. 3. Hemi’s Bitcoin Tunnel updates the rollup state root with the details of the withdrawal transaction. This state root is submitted to Bitcoin by a Publisher to ensure that the withdrawal is accurately recorded. 4. Hemi’s Bitcoin Tunnel verifies the correct burning of tokens and prepares the custodianship system for withdrawal. 5. The custodianship vault is notified of the withdrawal request. In the case of a multisig vault, the required number of signatures is collected to authorize the withdrawal. 6. Once verified, the custodianship vault releases the corresponding Bitcoin or Bitcoin-native assets to the user’s Bitcoin address. It may take up to **12 hours** to verify and release withdrawn BTC. 7. The hVM system constantly monitors for any unauthorized withdrawals. In Phase 0, this requires an externally owned account (EOA) to flag any potential issues. In later phases, event notifications will allow automatic detection of unauthorized actions. If any misbehavior is detected during the withdrawal process, the responsible custodian is slashed on Hemi, and corrective measures are taken to prevent unauthorized fund transfers. *** ## 🔍 Comparison to Other Bitcoin Interoperability Solutions * Hemi’s Bitcoin Tunnels leverage the power of hVM (Hemi Virtual Machine) to monitor and secure Bitcoin-based asset transfers. * The Bitcoin Tunnel contract uses hVM to track Bitcoin addresses and outputs tied to custodianship vaults, ensuring efficient and secure asset management. * In hVM Phase 0, an externally owned account (EOA) is required to notify the contract of any irregular withdrawals. Once flagged, hVM can verify the offending transaction and respond by slashing misbehaving custodians. * This contrasts with BTC interoperability solutions like BTC header relay, where users must manually construct cryptographic proofs of misbehavior and relay them to the contract for validation, introducing higher costs and risks of error. # Ethereum Virtual Machine (EVM) {% hint style="info" %} ## 📜 **TL;DR:** * The Ethereum Virtual Machine (EVM) serves as a global, decentralized computer designed to execute smart contracts. * The Hemi Network offers seamless compatibility with the EVM, allowing it to not only execute Ethereum-based smart contracts directly but also facilitate interactions among various smart contracts across networks. * **The Hemi Network also extends this compatibility to Bitcoin** through a protocol-level awareness of the state of the Bitcoin network. {% endhint %} *** ## 🌐 **Overview** * **The Ethereum Virtual Machine (EVM)** represents a cornerstone of blockchain technology, functioning as a distributed computational engine that executes smart contracts. These contracts are *self-executing agreements* with the terms directly written into code, enabling a wide array of decentralized applications (DApps). The Ethereum network's primary role is to maintain the operational integrity and accessibility of the EVM, ensuring a trustless environment for executing these contracts. *** ## 💡 **An EVM-Compatible L2** * On the innovative front, the Hemi Network emerges as an EVM-compatible Layer 2 (L2) solution, architecturally designed atop Ethereum's foundation. * This compatibility empowers the Hemi Network to directly execute smart contracts developed for the Ethereum ecosystem and establish communicative bridges with other EVM-compatible smart contracts, fostering an interconnected blockchain environment. *** ## 🔗 **Integration with Bitcoin** * Through a deep, protocol-level insight into Bitcoin's state, the **Hemi Network** facilitates the creation and execution of EVM-compatible smart contracts that can interact with Bitcoin. This expands the utility and applications of smart contracts and tunnels the capabilities of Ethereum with the robust security and widespread adoption of Bitcoin, marking a significant advancement in blockchain interoperability and functionality. 🤝 # Blocks {% hint style="info" %} ## 📜 TL;DR: * **Blocks** in blockchain technology are packets of transactions and data, made secure through links to previous blocks. * Altering past blocks requires modifying all subsequent ones, a security feature. The Hemi Network enhances this by segmenting blocks into five-minute "**keystone**" intervals, with a security proof sent to the Bitcoin network every second interval. {% endhint %} *** ## 🌐 Overview * A block is a component of blockchain technology that contains transactions and their associated data.  * Its security is enhanced because all subsequent blocks in the chain cryptographically reference it, reinforcing the integrity of the entire blockchain with each new block added. Tampering with an earlier block requires altering not only that block but also every block after it. *** ## 🟦 Hemi Blocks * In the Hemi Network, blocks are organized into **five-minute intervals known as keystones**. To inherit Bitcoin’s security, \*one Hemi Network state proof must be published to the Bitcoin network every two keystone intervals. \* * The first block of each interval **cryptographically references the previous two keystone blocks**, ensuring that the network cannot be reorganized without a 51-percent attack against Bitcoin itself, a scenario considered highly unlikely even for powerful entities like nation-states. # Transactions {% hint style="info" %} ## 📜 TL;DR: * **A cryptocurrency transaction updates a network's decentralized ledger.** * *It requires the sender's cryptographic signature to ensure the transaction is authorized.* * **To increase the speed and number of transactions, transactions can be offloaded to an L2 network**, which bundles transactions before settling them on the main chain. * **Transactions on the Hemi Network inherit the programming abilities of Ethereum and the robust security of Bitcoin** while still encouraging decentralization and resistance to censorship.  {% endhint %} *** ## 🌐 **Overview** * **A cryptocurrency transaction fundamentally represents an update to the network's decentralized ledger.** * Such a transaction mandates a cryptographic signature from the sender's wallet, serving as a verification mechanism to authorize the transaction. Within the Bitcoin ecosystem, scripting capabilities enable the execution of more complex transaction types. * Conversely, **Ethereum operates as a distributed virtual machine,** allowing for the execution of sophisticated programs known as smart contracts. These contracts, embedded directly on the blockchain, can operate autonomously based on their programming. *** ## ⚖️ **The Blockchain Trilemma and L1 Challenges** * L1 chains like Bitcoin and Ethereum typically have relatively slow transaction times—a problem commonly known as the blockchain trilemma.  * The process of improving transaction throughput on a blockchain necessitates an expansion of data storage capacity, as each transaction must be individually recorded on the ledger. This requirement potentially centralizes the operation of full nodes to entities possessing considerable computational and financial resources. * In response, Layer 2 (L2) networks present a strategic solution by aggregating multiple transactions off-chain prior to their collective finalization on the primary Layer 1 (L1) blockchain. This methodology not only preserves the foundational security principles of the L1 blockchain but also contributes to a reduction in transaction fees and an acceleration of transaction processing times, thereby enhancing the efficiency and accessibility of blockchain technology. ⏩ *** ## 🌉 **Tunneling Ethereum & Bitcoin with Hemi** * The Hemi Network, as an EVM-compatible Layer 2 network built to bridge Ethereum and Bitcoin, enables rapid transaction settlement and finality. Transactions inherit the complex programming abilities of Ethereum and the robust security of Bitcoin. The Hemi Network’s design also encourages greater decentralization than typical L2 networks, preventing censorship and ensuring open access. # Gas {% hint style="info" %} ## 📜 TL;DR: * **Gas fees on Hemi** is paid using ETH, the network's native token. * This approach is similar to Ethereum Layer 2 rollups like Optimism, where gas fees are in their native bridged tokens. {% endhint %} *** ## 🌐 **Overview** * In cryptocurrency networks, **gas** refers to the tokens used to pay transaction fees. These fees are essential for processing transactions and maintaining network security, compensating network operators for the real-world costs they incur. *** ## 🔧 **Fee Mechanisms: Other Networks** * For example, in the **Bitcoin network**, transaction fees are paid in BTC. **Ethereum**, on the other hand, uses ETH as gas. These fees serve the same fundamental purpose across different blockchains but are paid in the respective network's native tokens. *** ## ⛽ **Gas Fees on Hemi** * Hemi adopts a method akin to Ethereum Layer 2 rollups by using ETH as its gas token. This strategy enhances compatibility and user-friendliness, particularly for those accustomed to Ethereum's system. * To interact with the Hemi Network, users can obtain ETH and **tunnel** to Hemi. This ensures a seamless and efficient means for users to engage with the Hemi Network's services. 🔍 [Explore Network Details](/discover/network-details) # Nodes & Clients {% hint style="info" %} ## 📜 **TL;DR:** * In cryptocurrency networks, a `node` is a computer (physical or virtual) that connects to the network, while a `client` is the software \*\*that allows the node to communicate with the network. * The Hemi Network utilizes **five specialized types of nodes** — Bitcoin finality governors (BFG), Bitcoin-secure sequencers (BSS), Proof-of-Proof miners (PoP), Challengers and modified Geth nodes — to enhance network reliability by distributing functions, thus mitigating the impact of single node failures. {% endhint %} *** ## 🖥️ **Nodes 101** * Cryptocurrency networks are powered by a distributed array of computers, each referred to as **a node**, functioning in a peer-to-peer manner where each holds equal standing. Nodes, depending on the client software they run, fulfill different roles within the network. * For instance, in the Bitcoin network, full nodes store a complete history of transactions for verification purposes, offering high security, while light nodes, focusing on transaction capability, rely on full nodes for information about the network's current state. This setup allows for a flexible network structure where nodes can freely join or leave without disrupting the network's overall functionality. *** ## 🛠️ **Hemi Node Structure** * In contrast, the Hemi Network employs a more specialized node architecture to optimize network performance and security. It includes: * **Bitcoin Finality Governors**: Ensures transactions achieve finality on the Bitcoin blockchain. * **Bitcoin-Secure Sequencers**: Orders transactions in a secure manner, leveraging Bitcoin's security. * **Proof-of-Proof Miners:** Validates transactions across blockchains without requiring the entire blockchain data. * **Modified Geth Node:** Manages Ethereum transactions and block headers in a way tailored for Hemi’s bridging protocols. * **Challengers**: Monitors and verifies the correctness of transactions and state proofs (Note: running a Challenger node will be enabled in the near future). * This segmentation of responsibilities across different node types significantly enhances the Hemi Network's fault tolerance. By isolating specific functions to particular node types, the network ensures that issues within one node type do not compromise the entire network's operations, thereby improving the system's overall reliability. * This architecture allows user clients to interact seamlessly with both the Bitcoin and Ethereum networks without the complexity of managing diverse node functions. # Node Guides ## Proof-of-Proof Miners (PoP Miners) #### 🌐 Overview * PoP Miners embed Hemi headers — L2 keystones — into Bitcoin blocks, effectively “anchoring” Hemi state to Bitcoin’s security. * PoP Miners receive Hemi headers from a BFG, create BTC transactions with those headers, and forward them to Bitcoin for inclusion in blocks. * Successful PoP Miners are earn rewards on the Hemi network, incentivizing them to maintain network operation. #### **🙋‍♂️ Who might run a PoP Miner?** * **Network Miners and Operators:** Operators or enthusiasts who want to earn rewards by using their Bitcoin node connectivity. More PoP miners = stronger finality guarantees. #### **🏁 Requirements** **➡️ View complete instructions via the** [**PoP Miner tutorial.**](/how-to-tutorials/using-hemi/pop-mining/setup-part-1) *** ## Bitcoin Finality Governor (BFG) #### **🌐 Overview** * BFG nodes look for Proof-of-Proof (PoP) transactions that embed Hemi headers into Bitcoin, determining if Hemi blocks have attained Bitcoin-level finality. * BFG nodes serve as the “checkpoint” mechanism for finality by confirming whether competing versions of Hemi blocks exist on-chain and identifying possible reorgs. The nodes then supply Hemi data to PoP Miners, parse resulting PoP transactions and communicate finality info to BSS nodes. #### **🙋‍♂️ Who might run a BFG node?** * **PoP Miners:** A custom BFG daemon can notify your local PoP miner and this will broadcast them to your Electrs+bitcoind setup so you don't rely on Hemi Labs — or any third party — which may be congested. * **Enterprise Node Operators:** Exchanges, large dApp platforms, or custodial services that need independent, verifiable finality checks on Hemi transactions. #### **🏁 Requirements** * A PostgreSQL database, bfgd expects the sql scripts in `./database/bfgd/scripts/` to be run to set up your schema. * A connection to: * An Electrs node on the proper Bitcoin network (testnet or mainnet). * bitcoind * bfgd **➡️ View complete instructions via the** [**hemilabs GitHub repo.**](https://github.com/hemilabs/heminetwork?tab=readme-ov-file#%EF%B8%8F-running-bfgd) *** ## Bitcoin-Secure Sequencers (BSS Nodes) #### 🌐 Overview * BSS nodes combine Hemi transactions with Ethereum mainnet batches, creating a hybrid solution that inherits Bitcoin security signals (via BFG) and uses Ethereum’s smart contract capabilities. * These nodes coordinate staking, unstaking, and slashing operations to secure the network, while incorporating finality checkpoints from the BFG. BSS nodes also facilitate cross-chain asset transfers by ensuring that Hemi’s o
프로젝트로 돌아가기