THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Designing Bitcoin Payment SDKs with WAB

permalink THAMER
#bitcoin#payments#sdk#software-engineering#wab

Research status: Theoretical SDK design. Examples are illustrative and have not been built or tested against the live engine.

Payment architecture

A payment SDK composes wallet operations into a business-facing interface. It is not a second wallet engine. Keep the factory responsible for identity issuance and the engine responsible for Bitcoin execution. A merchant adapter may expose payment requests and observations without exposing SEND or recovery credentials to its callers.

Model three independent records: an order with an expected amount, an engine observation with its original identifiers, and an application decision with a policy version. A payment request is not proof of funds. A successful HTTP response is not necessarily a successful application operation. Preserve both transport and application outcomes.

Conceptual Go interface

type PaymentRequest struct {
    OrderID string
    ExpectedSat int64
    Network string
    AddressType string
}
type PaymentPort interface {
    Register(ctx context.Context, req PaymentRequest) (ObservationRef, error)
    Observe(ctx context.Context, ref ObservationRef) (PaymentEvidence, error)
}

The types and methods are proposed SDK abstractions, not API fields. Implement them with the documented WATCH operations and transaction status contract. Store the returned address and watch identifier durably before presenting payment instructions. Do not substitute a locally invented watch identifier for the engine identifier.

Operational boundaries

A merchant receiving Bitcoin does not need to invoke SEND to mark an order paid. Refunds are separate authorized spending intents. A payment adapter must not promise Lightning invoices, exchange conversion or automatic refunds as native WAB capabilities. Use integer satoshis and keep network and wallet scope immutable for each order.

Acceptance plan

Simulate registration failure, duplicate order creation, partial payment and delayed observations. On Testnet, register a watch, pay from a separate funded wallet and compare the observed destination and amount with transaction evidence. Check that a restart does not lose the order-to-watch mapping. Measure registration and observation latency separately from confirmation time.

Primary reference

https://thamer.org/api

Related reading in this series

https://thamer.org/docs/wab-sdk-designing-bitcoin-sdk
https://thamer.org/docs/wab-sdk-api-engine-application-boundaries
https://thamer.org/docs/wab-sdk-wallet-identity-management
https://thamer.org/docs/wab-sdk-cross-language-interfaces
https://thamer.org/docs/wab-sdk-typed-json-contracts
https://thamer.org/docs/wab-sdk-authentication-credential-management
https://thamer.org/docs/wab-sdk-wallet-creation-restoration
https://thamer.org/docs/wab-sdk-receive-address-interfaces
https://thamer.org/docs/wab-sdk-balance-utxo-management
https://thamer.org/docs/wab-sdk-transaction-execution
https://thamer.org/docs/wab-sdk-idempotency-retry-strategies
https://thamer.org/docs/wab-sdk-wallet-recovery-local-lifecycle
https://thamer.org/docs/wab-sdk-watch-payment-monitoring
https://thamer.org/docs/wab-sdk-invoice-abstractions
https://thamer.org/docs/wab-sdk-confirmation-settlement-states
https://thamer.org/docs/wab-sdk-immutable-fee-policy
https://thamer.org/docs/wab-sdk-payment-reconciliation

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects