Hemi
DiscordGithub
  • 🏠Main
    • Welcome to the Hemi Docs
    • Getting Started
      • Developer Quickstart
      • Enthusiast Quickstart
      • Miner Quickstart
    • Network Details
  • â›°ī¸Foundational Topics
    • The Architecture
      • Consensus and Security Protocols
      • Ethereum Rollups
        • Pros & Cons
        • Decentralized Rollups
      • Sequencer Consensus
        • Proof-of-Stake (PoS)
        • PoS-Only Pitfalls
        • PoS Solutions
      • Proof-of-Proof (PoP)
        • Proof-of-Proof Consensus & Bitcoin Finality
        • Proof-of-Proof vs. Merged Mining
        • Running a PoP Mining
      • Tunnels
        • Ethereum Tunnel
        • Bitcoin Tunnel
      • Ethereum Virtual Machine (EVM)
      • Blocks
      • Transactions
      • Gas
    • Nodes & Clients
      • Node Guides
    • Wallet Support
  • 📖How-To Tutorials
    • Using Hemi
      • Wallet Setup
        • EVM Wallet Setup
        • BTC Wallet Setup
          • Switch Bitcoin Networks
      • Tunnel from Ethereum
        • Tunnel ERC20s via Native Tunnel
        • Tunnel ERC20s via 3rd Party
          • Tunnel via Stargate
      • Tunnel from Bitcoin
        • Tunnel BTC via Native Tunnel
        • Tunnel BTC via 3rd Party
      • Stake
      • Developer Tooling
        • Set Up a Safe Wallet
        • Create a Capsule
      • PoP Mining
        • CLI PoP Miner
          • (Testnet) Add tHEMI to MetaMask
          • (Mainnet) Add PoPPoints to Metamask
        • Web PoP Miner (deprecated)
    • Developing on Hemi
      • General
        • HelloWorld.sol
        • Deploy an ERC-20 Token
      • hVM & hBK
        • Using the hBK Demo App
        • Get Bitcoin Balance with Remix
  • âš™ī¸Building Bitcoin Apps
    • Introduction
    • Hemi Virtual Machine (hVM)
      • Motivation
      • Feature Summary
      • Deploy on hVM
    • Hemi Bitcoin Kit (hBK)
      • Overview
      • hBK Smart Contract
  • âš™ī¸Tooling
    • viem
    • Contract Addresses
    • Contract Verification
    • Data Indexing
    • Oracles
  • 📝Incentives
    • Points
    • Grants
    • Retroactive Funding
    • One-Off Spends
  • ⚡Additional Resources
    • Partners
    • FAQ
    • Official Links
    • Brand Kit
  • 📨Send Feedback
    • Bug Report
    • Contact Us
Powered by GitBook
On this page
  • 🌐 Overview
  • â„šī¸ "Phase 0" Precompile Summary

Was this helpful?

Edit on GitHub
Export as PDF
  1. Building Bitcoin Apps
  2. Hemi Virtual Machine (hVM)

Feature Summary

📜 TL;DR:

  • Smart contracts on Hemi can access Bitcoin data by calling the hVM precompile contract.

  • Future protocol upgrades will add additional precompile calls to provide additional information.


🌐 Overview

  • Smart contracts on Hemi can access Bitcoin data by calling the hVM precompile contract addresses, which query the deterministic TBC node running inside the EVM.

  • Future protocol upgrades will add additional precompile calls to provide additional information like Bitcoin fee levels, Bitcoin block construction information, and popular metaprotocols like Ordinals, BRC-20s, and Runes.


â„šī¸ "Phase 0" Precompile Summary

Name
Address
Description

BtcBalAddr

0x40

Gets the balance of an address in satoshis. Supports all address formats: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.

BtcUtxosAddrList

0x41

Gets the list of Unspent Transaction Outputs (UTXOs) for an address. Supports pagination.

BtcTxByTxid

0x42

Gets parts of a Bitcoin transaction by its TxID. The caller can specify which part(s) of the transaction to return using packed bitflags to increase gas efficiency by dropping unnecessary data.

BtxTxConfirmations

0x43

Gets the number of confirmations a specified transaction by TxID has.

BtcLastHeader

0x44

Gets the most recent Bitcoin header known by hVM.

BtcHeaderN

0x45

Gets the canonical Bitcoin header at height N.

BtcAddrToScript

0x46

Converts a Bitcoin address to its corresponding script representation. Supports all address formats: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.

PreviousMotivationNextDeploy on hVM

Last updated 4 months ago

Was this helpful?

âš™ī¸