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 Multi-Tenant Bitcoin Payment SDKs

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

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

Tenant isolation

A multi-tenant SDK is an application orchestration layer, not evidence that the engine implements tenant management. Map each authorized tenant to an explicitly configured wallet identity and engine context. Prefer separate wallet credentials and isolated runtime state where the deployment requires it. A shared operator wallet creates custody and accounting obligations; separate invoice labels do not provide cryptographic isolation. Never assume the engine can host arbitrary concurrent wallet contexts without verifying its deployment contract.

Conceptual Go routing contract

type TenantScope struct {
    TenantID string
    WalletID string
    Network string
}
type WalletRouter interface {
    ResolveAuthorized(scope TenantScope) (WalletClient, error)
}

Derive tenant identity from authenticated server context, not an untrusted request body. Resolve the credential from a protected store and verify the caller's entitlement to the wallet and network. Scope caches, idempotency records, invoice queries and audit logs by tenant and wallet. Never reuse a mutable global client whose credential changes between concurrent requests. Separate receive and spending permissions at the service boundary; an interface alone cannot restrict a leaked unrestricted key.

Reconciliation and operational controls

Use a globally unique output allocation within each network so the same on-chain output cannot be credited across tenants. Keep tenant ledger liabilities distinct from actual wallet reserves. Define per-tenant quotas and concurrency limits to protect shared infrastructure, without modifying the engine fee law. Credential rotation and wallet recovery follow documented identity operations; do not invent revocation endpoints. REMOVE affects local engine state, not blockchain history. Restrict destructive operations to authorized maintenance workflows and verify the target context before execution.

Acceptance plan

Test cross-tenant invoice lookup, forged tenant identifiers, concurrent requests with different credentials, duplicate output allocation and network mismatch. In isolated Testnet contexts, create two payment intents and verify that each payment is visible only to its authorized application tenant. Restart the routing service and repeat reconciliation. No production multi-tenant isolation guarantee is established until these tests and deployment review are complete.

Primary reference

https://thamer.org/api

Related reading

https://thamer.org/docs/wab-sdk-api-engine-application-boundaries
https://thamer.org/docs/wab-sdk-authentication-credential-management
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-payment-reconciliation
https://thamer.org/docs/wab-sdk-immutable-fee-policy

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