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

NameAddressDescription

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.

Last updated