sigil-bitcoin-keys
sigil bitcoin keys
(sigil bitcoin keys) — Bitcoin key, address, BIP32, and BIP39 helpers
bitcoin-network
procedureBitcoin network parameters used by key and address encoders.
bitcoin-network?
procedureTest if a value is a `bitcoin-network` struct.
bitcoin-network-name
procedureGet the `name` field of a `bitcoin-network` struct.
bitcoin-network-wif
procedureGet the `wif` field of a `bitcoin-network` struct.
bitcoin-network-p2pkh
procedureGet the `p2pkh` field of a `bitcoin-network` struct.
bitcoin-network-p2sh
procedureGet the `p2sh` field of a `bitcoin-network` struct.
bitcoin-network-bech32
procedureGet the `bech32` field of a `bitcoin-network` struct.
bitcoin-network-xprv
procedureGet the `xprv` field of a `bitcoin-network` struct.
bitcoin-network-xpub
procedureGet the `xpub` field of a `bitcoin-network` struct.
bitcoin-mainnet
variableMainnet address and extended-key version constants.
bitcoin-testnet
variableTestnet address and extended-key version constants.
extended-private-key
procedureBIP32 extended private key record.
extended-private-key?
procedureTest if a value is a `extended-private-key` struct.
extended-private-key-network
procedureGet the `network` field of a `extended-private-key` struct.
extended-private-key-depth
procedureGet the `depth` field of a `extended-private-key` struct.
extended-private-key-parent-fingerprint
procedureGet the `parent-fingerprint` field of a `extended-private-key` struct.
extended-private-key-child-number
procedureGet the `child-number` field of a `extended-private-key` struct.
extended-private-key-chain-code
procedureGet the `chain-code` field of a `extended-private-key` struct.
extended-private-key-private-key
procedureGet the `private-key` field of a `extended-private-key` struct.
extended-public-key
procedureBIP32 extended public key record.
extended-public-key?
procedureTest if a value is a `extended-public-key` struct.
extended-public-key-network
procedureGet the `network` field of a `extended-public-key` struct.
extended-public-key-depth
procedureGet the `depth` field of a `extended-public-key` struct.
extended-public-key-parent-fingerprint
procedureGet the `parent-fingerprint` field of a `extended-public-key` struct.
extended-public-key-child-number
procedureGet the `child-number` field of a `extended-public-key` struct.
extended-public-key-chain-code
procedureGet the `chain-code` field of a `extended-public-key` struct.
extended-public-key-public-key
procedureGet the `public-key` field of a `extended-public-key` struct.
private-key->wif
procedureEncode a 32-byte private key as Wallet Import Format. `network` selects the WIF version byte. `compressed?` controls whether the compressed-public-key marker is included in the payload.
wif->private-key
procedureDecode a Wallet Import Format string. Returns `(key network . compressed?)`.
private-key->public-key
procedureDerive a compressed public key from a 32-byte secp256k1 private key.
public-key?
procedureReturn true when `key` is a valid compressed or uncompressed public key.
compressed-public-key?
procedureReturn true when `key` is a valid 33-byte compressed public key.
x-only-public-key
procedureConvert a serialized public key into a 32-byte x-only public key.
public-key->p2pkh-address
procedureDerive a Base58Check P2PKH address from a serialized public key.
script-hash->p2sh-address
procedureEncode a 20-byte script hash as a Base58Check P2SH address.
public-key->p2wpkh-address
procedureDerive a native SegWit P2WPKH address from a serialized public key.
script->p2wsh-address
procedureDerive a native SegWit P2WSH address from a witness script.
x-only-public-key->p2tr-address
procedureEncode a 32-byte x-only public key as a native Taproot address.
fingerprint
procedureReturn the BIP32 4-byte key fingerprint for a serialized public key.
extended-private-key->public-key
procedureNeuter an extended private key into the matching extended public key.
bip32-master-key
procedureDerive a BIP32 master extended private key from seed bytes.
bip32-private-child
procedureDerive a BIP32 private child key. Hardened children use child numbers greater than or equal to `#x80000000`.
bip32-public-child
procedureDerive a non-hardened BIP32 public child key.
bip32-derive-path
procedureDerive a BIP32 path such as `m/84'/0'/0'/0/0`. The input key may be an extended private key or extended public key.
bip32-hardened-index
procedureConvert a non-hardened child index into a hardened BIP32 index.
bip32-account-path
procedureBuild a BIP43 account path `m/purpose'/coin_type'/account'`.
bip44-account-path
procedureBIP44 legacy P2PKH account path.
bip49-account-path
procedureBIP49 nested SegWit account path.
bip84-account-path
procedureBIP84 native SegWit account path.
bip86-account-path
procedureBIP86 Taproot key-path account path.
bip32-account-key
procedureDerive an account-level extended key for a BIP43 purpose.
bip44-account-key
procedureDerive a BIP44 account key from a master extended key.
bip49-account-key
procedureDerive a BIP49 account key from a master extended key.
bip84-account-key
procedureDerive a BIP84 account key from a master extended key.
bip86-account-key
procedureDerive a BIP86 account key from a master extended key.
bip32-chain-key
procedureDerive an external (`#f`) or change (`#t`) chain from an account key.
bip32-address-key
procedureDerive an address key at `/change/index` from an account key.
bip32-xprv->string
procedureSerialize a BIP32 extended private key as Base58Check text.
bip32-xpub->string
procedureSerialize a BIP32 extended public key as Base58Check text.
string->bip32-xprv
procedureParse a Base58Check BIP32 extended private key.
string->bip32-xpub
procedureParse a Base58Check BIP32 extended public key.
bip39-entropy->mnemonic
procedureConvert BIP39 entropy bytes into an English mnemonic sentence.
bip39-mnemonic->entropy
procedureConvert a BIP39 English mnemonic sentence back to entropy bytes.
bip39-mnemonic->seed
procedureDerive a 64-byte BIP39 seed from a mnemonic and optional passphrase.