# bsv_sdk v2.0.1 - Table of Contents

Feature-complete Bitcoin SV SDK for Elixir — primitives, scripts, transactions, wallet, tokens (STAS/STAS 3.0), SPV, and transport clients.

## Pages

- [BSV SDK for Elixir](readme.md)

## Modules

- [BSV](BSV.md): BSV SDK for Elixir — a feature-complete Bitcoin SV toolkit.
- [BSV.ARC.Types](BSV.ARC.Types.md): ARC data types: status codes and API response structures.
- [BSV.ARC.Types.Response](BSV.ARC.Types.Response.md): Response from the ARC API.
- [BSV.Block](BSV.Block.md): A Bitcoin block consisting of a `BSV.BlockHeader` and a list of transactions.
- [BSV.BlockHeader](BSV.BlockHeader.md): An 80-byte block header providing a summary of a Bitcoin block.
- [BSV.Contract](BSV.Contract.md): A behaviour and pipeline DSL for building Bitcoin locking and unlocking scripts.
- [BSV.Contract.Helpers](BSV.Contract.Helpers.md): Pipeline helpers for building scripts in `BSV.Contract` modules.
- [BSV.Contract.OpReturn](BSV.Contract.OpReturn.md): OP_RETURN output for placing arbitrary data on-chain.
- [BSV.Contract.P2MS](BSV.Contract.P2MS.md): Pay to Multi-Signature contract.
- [BSV.Contract.P2PK](BSV.Contract.P2PK.md): Pay to Public Key contract.
- [BSV.Contract.P2PKH](BSV.Contract.P2PKH.md): Pay to Public Key Hash contract.
- [BSV.Contract.P2RPH](BSV.Contract.P2RPH.md): Pay to R-Puzzle Hash contract.
- [BSV.Contract.PushTxHelpers](BSV.Contract.PushTxHelpers.md): Helpers for implementing `OP_PUSH_TX` in `BSV.Contract` modules.
- [BSV.Contract.Raw](BSV.Contract.Raw.md): Raw script contract — wraps a pre-built `BSV.Script` for use with the contract DSL.
- [BSV.Contract.VarIntHelpers](BSV.Contract.VarIntHelpers.md): Script-level VarInt helpers for `BSV.Contract` modules.
- [BSV.Crypto.ECDSA](BSV.Crypto.ECDSA.md): Pure-Elixir ECDSA signing on secp256k1 with RFC 6979 deterministic nonces.
- [BSV.Crypto.RFC6979](BSV.Crypto.RFC6979.md): RFC 6979 deterministic k generation using HMAC-DRBG (Section 3.2).
Specialized for secp256k1 with SHA-256 (qlen = hlen = 256).

- [BSV.ExtKey](BSV.ExtKey.md): BIP-32 hierarchical deterministic (HD) extended keys.
- [BSV.JungleBus.Types](BSV.JungleBus.Types.md): JungleBus data types.
- [BSV.JungleBus.Types.AddressInfo](BSV.JungleBus.Types.AddressInfo.md): Address information returned by the JungleBus API.
- [BSV.JungleBus.Types.BlockHeader](BSV.JungleBus.Types.BlockHeader.md): A block header returned by the JungleBus API.
- [BSV.JungleBus.Types.Transaction](BSV.JungleBus.Types.Transaction.md): A transaction returned by the JungleBus API.
- [BSV.KeyPair](BSV.KeyPair.md): Convenience struct pairing a `BSV.PrivateKey` with its corresponding `BSV.PublicKey`.
- [BSV.Mnemonic](BSV.Mnemonic.md): BIP-39 mnemonic phrase generation and seed derivation.
- [BSV.SPV.Beef.BeefTx](BSV.SPV.Beef.BeefTx.md): A transaction within a BEEF container.
- [BSV.SPV.MerklePath.PathElement](BSV.SPV.MerklePath.PathElement.md): A single element in a Merkle path level.
- [BSV.Tokens.ActionData](BSV.Tokens.ActionData.md): Additional data attached to a STAS 3.0 action.
- [BSV.Tokens.Authority](BSV.Tokens.Authority.md): Multi-signature authority configuration for token governance.
- [BSV.Tokens.Bundle.Stas3Bundle](BSV.Tokens.Bundle.Stas3Bundle.md): STAS3 Bundle Factory — automatic merge/split/transfer transaction planning.
- [BSV.Tokens.Destination](BSV.Tokens.Destination.md): A destination for token transfer.
- [BSV.Tokens.Factory.Stas3.WitnessBuilder](BSV.Tokens.Factory.Stas3.WitnessBuilder.md): Build a `BSV.Tokens.Stas3UnlockWitness` (spec §7 slots 1-20) for a single
STAS 3.0 input that the factory layer is about to sign.
- [BSV.Tokens.OwnerAddress](BSV.Tokens.OwnerAddress.md): Owner address for token destinations — either a standard address (P2PKH)
or a 20-byte MPKH (P2MPKH).
- [BSV.Tokens.Payment](BSV.Tokens.Payment.md): A UTXO payment input for token transactions.
- [BSV.Tokens.Script.ParsedScript](BSV.Tokens.Script.ParsedScript.md): Result of parsing a locking script.
- [BSV.Tokens.Script.Stas3Fields](BSV.Tokens.Script.Stas3Fields.md): Fields extracted from a STAS 3.0 locking script.
- [BSV.Tokens.Script.Stas3Pieces](BSV.Tokens.Script.Stas3Pieces.md): STAS 3.0 v0.2.3 §8 / §9.5 atomic-swap and merge "piece array" trailing
parameters for STAS 3.0 unlocking scripts.
- [BSV.Tokens.Script.StasFields](BSV.Tokens.Script.StasFields.md): Fields extracted from a STAS v2 locking script.
- [BSV.Tokens.Script.Templates](BSV.Tokens.Script.Templates.md): Byte-pattern constants for classifying STAS script versions, plus
builders for fixed locking-script bodies (such as the STAS 3.0 v0.1
§10.2 P2MPKH locking script).

- [BSV.Tokens.ScriptFlags](BSV.Tokens.ScriptFlags.md): STAS protocol flags field.
- [BSV.Tokens.ScriptType](BSV.Tokens.ScriptType.md): Classification of script types relevant to token operations.
- [BSV.Tokens.SigningKey](BSV.Tokens.SigningKey.md): Signing credentials for a UTXO — either a single key (P2PKH) or
threshold keys with a multisig script (P2MPKH).
- [BSV.Tokens.SpendType](BSV.Tokens.SpendType.md): STAS protocol spending-type parameter.
- [BSV.Tokens.Stas3.EngineVerify](BSV.Tokens.Stas3.EngineVerify.md): End-to-end script-engine verification helper for STAS 3.0 transactions.
- [BSV.Tokens.Stas3.Validate](BSV.Tokens.Stas3.Validate.md): STAS 3.0 v0.1 §9 build-time enforcement helpers.
- [BSV.Tokens.Stas3Destination](BSV.Tokens.Stas3Destination.md): A destination specific to STAS 3.0 token operations.
- [BSV.Tokens.Stas3LockingParams](BSV.Tokens.Stas3LockingParams.md): Parameters for constructing a STAS 3.0 locking script.
- [BSV.Tokens.Stas3OutputParams](BSV.Tokens.Stas3OutputParams.md): Parameters for a STAS 3.0 output in spend operations.
- [BSV.Tokens.Stas3SpendType](BSV.Tokens.Stas3SpendType.md): STAS 3.0 spending operation type.
- [BSV.Tokens.Stas3UnlockWitness](BSV.Tokens.Stas3UnlockWitness.md): STAS 3.0 v0.1 §7 unlocking-script witness assembly (slots 1-20).
- [BSV.Tokens.SwapDescriptor](BSV.Tokens.SwapDescriptor.md): STAS 3.0 v0.1 §6.3 swap descriptor — the canonical, recursive form of the
`var2` payload pushed by an atomic-swap STAS UTXO (action byte `0x01`).
- [BSV.Tokens.Template.Stas](BSV.Tokens.Template.Stas.md): STAS unlocking script templates (P2PKH and P2MPKH).
- [BSV.Tokens.Template.Stas3](BSV.Tokens.Template.Stas3.md): STAS3 unlocking script templates (P2PKH and P2MPKH).
- [BSV.Tokens.TokenInput](BSV.Tokens.TokenInput.md): A token input for STAS 3.0 spend operations.
- [BSV.Tokens.TxType](BSV.Tokens.TxType.md): STAS 3.0 v0.1 §8.1 transaction-type (txType) parameter.
- [BSV.Transaction.P2MPKH](BSV.Transaction.P2MPKH.md): Pay-to-Multiple-Public-Key-Hash (P2MPKH) signing template — STAS 3.0 v0.1 §10.2.
- [BSV.Wallet.Types](BSV.Wallet.Types.md): Core wallet types: Protocol, Counterparty, EncryptionArgs, etc.

- [BSV.Wallet.Types.Counterparty](BSV.Wallet.Types.Counterparty.md): Counterparty in a cryptographic operation.
- [BSV.Wallet.Types.EncryptionArgs](BSV.Wallet.Types.EncryptionArgs.md): Common parameters for cryptographic operations.
- [BSV.Wallet.Types.Protocol](BSV.Wallet.Types.Protocol.md): Protocol identifier with security level and name.

- Primitives
  - [BSV.Base58](BSV.Base58.md): Base58 and Base58Check encoding/decoding using the Bitcoin alphabet.

  - [BSV.ChainHash](BSV.ChainHash.md): A 32-byte hash used for block and transaction identifiers in Bitcoin.
Hex display follows Bitcoin convention (byte-reversed).

  - [BSV.Crypto](BSV.Crypto.md): Cryptographic hash functions using OTP `:crypto`.

  - [BSV.PrivateKey](BSV.PrivateKey.md): Bitcoin private key operations: generation, WIF encoding, signing.
  - [BSV.PublicKey](BSV.PublicKey.md): Bitcoin public key operations: derivation, compression, address generation, verification.

  - [BSV.SymmetricKey](BSV.SymmetricKey.md): AES-256-GCM symmetric encryption.
  - [BSV.VarInt](BSV.VarInt.md): Bitcoin variable-length integer encoding/decoding.

- Script
  - [BSV.Script](BSV.Script.md): Bitcoin Script type — a sequence of opcodes and data pushes.
  - [BSV.Script.Address](BSV.Script.Address.md): Bitcoin address handling for scripts.
  - [BSV.Script.Interpreter](BSV.Script.Interpreter.md): Full Bitcoin script interpreter.
  - [BSV.Script.Opcodes](BSV.Script.Opcodes.md): Bitcoin script opcode definitions.
  - [BSV.Script.ScriptNum](BSV.Script.ScriptNum.md): Bitcoin script number encoding/decoding.

- Transaction
  - [BSV.Transaction](BSV.Transaction.md): Bitcoin SV transaction.
  - [BSV.Transaction.Builder](BSV.Transaction.Builder.md): Pipe-friendly transaction builder.
  - [BSV.Transaction.Input](BSV.Transaction.Input.md): Bitcoin transaction input.
  - [BSV.Transaction.Output](BSV.Transaction.Output.md): Bitcoin transaction output.
  - [BSV.Transaction.P2PKH](BSV.Transaction.P2PKH.md): P2PKH signing template.
  - [BSV.Transaction.Sighash](BSV.Transaction.Sighash.md): BIP-143 style signature hash computation for BSV (with FORKID).
  - [BSV.Transaction.Template](BSV.Transaction.Template.md): Behaviour for transaction signing templates.

- Wallet
  - [BSV.Wallet](BSV.Wallet.md): The wallet behaviour — defines the interface for BSV wallet operations.
  - [BSV.Wallet.KeyDeriver](BSV.Wallet.KeyDeriver.md): BRC-42/43 key derivation.
  - [BSV.Wallet.ProtoWallet](BSV.Wallet.ProtoWallet.md): A foundational wallet capable of cryptographic operations (key derivation,
encrypt/decrypt, sign/verify, HMAC) but not transaction management or
blockchain interaction.

- Message
  - [BSV.Message.Encrypted](BSV.Message.Encrypted.md): BRC-78 message encryption and decryption.
  - [BSV.Message.Signed](BSV.Message.Signed.md): BRC-77 message signing and verification.

- Auth
  - [BSV.Auth.Certificate](BSV.Auth.Certificate.md): BRC-31 identity certificate.
  - [BSV.Auth.MasterCertificate](BSV.Auth.MasterCertificate.md): A master certificate with encrypted symmetric keys for each field.
  - [BSV.Auth.Nonce](BSV.Auth.Nonce.md): Cryptographic nonce creation and verification for auth protocols.
  - [BSV.Auth.VerifiableCertificate](BSV.Auth.VerifiableCertificate.md): A certificate with a verifier-specific keyring for selective field decryption.

- SPV
  - [BSV.SPV.Beef](BSV.SPV.Beef.md): BEEF (Background Evaluation Extended Format) transaction container.
  - [BSV.SPV.MerklePath](BSV.SPV.MerklePath.md): Merkle path (BUMP) types and verification — BRC-74 binary format.
  - [BSV.SPV.MerkleTreeParent](BSV.SPV.MerkleTreeParent.md): Merkle tree parent computation using double-SHA256.

- Tokens
  - [BSV.Tokens](BSV.Tokens.md): STAS and STAS 3.0 token support for BSV.
  - [BSV.Tokens.Factory.Contract](BSV.Tokens.Factory.Contract.md): Contract transaction builder.
  - [BSV.Tokens.Factory.Stas](BSV.Tokens.Factory.Stas.md): STAS transaction factories.
  - [BSV.Tokens.Factory.Stas3](BSV.Tokens.Factory.Stas3.md): STAS3 transaction factories.
  - [BSV.Tokens.Scheme](BSV.Tokens.Scheme.md): Token scheme defining the properties of a token.
  - [BSV.Tokens.Script.Reader](BSV.Tokens.Script.Reader.md): Script reader for parsing STAS and STAS 3.0 locking scripts.
  - [BSV.Tokens.Script.Stas3Builder](BSV.Tokens.Script.Stas3Builder.md): Builder for STAS 3.0 (stas3-freeze-multisig) locking scripts.
  - [BSV.Tokens.Script.StasBuilder](BSV.Tokens.Script.StasBuilder.md): Builder for STAS locking scripts.
  - [BSV.Tokens.TokenId](BSV.Tokens.TokenId.md): Token identifier derived from a BSV address.

- Transports
  - [BSV.ARC.Client](BSV.ARC.Client.md): HTTP client for the ARC API.
  - [BSV.ARC.Config](BSV.ARC.Config.md): Configuration for an ARC client.
  - [BSV.JungleBus.Client](BSV.JungleBus.Client.md): HTTP client for the JungleBus API.
  - [BSV.JungleBus.Config](BSV.JungleBus.Config.md): Configuration for a JungleBus client.

- Exceptions
  - [BSV.ARC.Error](BSV.ARC.Error.md): Error types for ARC operations.
  - [BSV.JungleBus.Error](BSV.JungleBus.Error.md): Error types for JungleBus operations.
  - [BSV.Tokens.Error](BSV.Tokens.Error.md): Token error types.
  - [BSV.Wallet.Error](BSV.Wallet.Error.md): Wallet-specific error types.

