Expand description
Shared encoding utilities used across all chain modules.
Centralizes Bitcoin compact-size (varint), Bech32/Bech32m, and Base58Check encoding so chain modules don’t duplicate these building blocks.
Functions§
- base58check_
decode - Decode a Base58Check string. Returns
(version, payload). - base58check_
encode - Encode data with Base58Check:
Base58(version ‖ payload ‖ checksum[0..4]). - bech32_
encode - Encode a SegWit/Taproot address using Bech32 (v0) or Bech32m (v1+).
- encode_
compact_ size - Encode a Bitcoin compact-size integer into a buffer.
- read_
compact_ size - Read a Bitcoin compact-size integer from a byte slice at the given offset.