Understanding SDK, API, Engine, and Application Boundaries
Research status: Theoretical SDK design. Examples are illustrative and have not been built or tested against the live engine.
Responsibility model
The factory issues identities; the engine operates wallets; the SDK provides access to the engine; the application defines the business purpose. This separation prevents a payment library from silently becoming an accounting system or a second transaction engine.
For example, a merchant assigns an order ID, determines the expected amount and chooses a fulfillment policy. A payment adapter can register a watch and retrieve observations. The engine observes Bitcoin activity. The merchant decides whether the evidence satisfies its policy. An observed payment is not necessarily final settlement, nor does it prove that a product was delivered.
Conceptual TypeScript contract
type Network = "test" | "main";
type AddressType = "segwit" | "taproot";
interface WalletScope { net: Network; type: AddressType }
interface PaymentPort {
observe(scope: WalletScope, txid: string): Promise<unknown>;
}The adapter can implement observe using the documented transaction-status operation (which takes network and transaction ID, not address type). The business scope is deliberately richer than the wire request. The application should not pass arbitrary scope fields through to every endpoint.
What the SDK cannot promise
It cannot create consensus finality, make an offline engine reachable, guarantee future fees or infer a customer identity from an address. It cannot override the wallet's signed fee policy. Lightning routing, exchange conversion, game balances and refunds are not implied by exposing an on-chain payment operation. Any such capabilities require their own services and contracts.
Trust and failure
Treat an authenticated engine response as evidence from that engine, not as a universally independent verification. For important settlement decisions, compare transaction outputs and confirmation state using a trusted Bitcoin view. A database entry that says paid is an application assertion and should retain a reference to the underlying evidence. Reorganizations may invalidate earlier confirmation observations.
Acceptance plan
Test business logic using a fake payment port before live integration. Run separate cases for underpayment, delayed confirmation, duplicated observations and a temporarily unreachable engine. Do not allow a failed poll to erase an already recorded payment. Document which layer owns each decision before writing specialized SDKs.
Primary reference
https://thamer.org/api
Related reading in this stage
https://thamer.org/docs/wab-sdk-designing-bitcoin-sdk
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
