Designing Bitcoin Game Economy SDKs
Research status: Theoretical SDK design. Examples are illustrative and have not been built or tested against the live engine.
Architecture and trust boundaries
A game economy SDK should expose business operations rather than unrestricted wallet calls. The client requests a purchase, deposit or withdrawal; the game server authenticates the player, checks the rules and commits ledger changes. A separate settlement worker communicates with WAB. The operator wallet is not a separate on-chain wallet for every player. Internal credits are liabilities of the operator, not Bitcoin UTXOs owned by players.
Conceptual Go interface
type Economy interface {
CreateDeposit(ctx context.Context, playerID string, sats int64) (Deposit, error)
Purchase(ctx context.Context, playerID, itemID, operationID string) (Receipt, error)
RequestWithdrawal(ctx context.Context, playerID, destination string, sats int64) (Withdrawal, error)
}These are proposed application methods, not engine endpoints. The server obtains player identity from an authenticated session rather than trusting the caller's playerID. Prices come from the server catalog. Every monetary value uses integer units, and the exchange rule between credits and satoshis is explicit. The client receives only its own records, never the operator BTC KEY.
Economic boundaries
Maintain separate available, reserved and pending balances. A deposit becomes spendable according to a documented confirmation policy; a withdrawal reserves funds before dispatch. Do not use the engine balance as the player ledger. Operator liquidity, fees and pending obligations must be reconciled independently. If credits are redeemable, track aggregate liabilities and suspend new withdrawals when reliable liquidity information is unavailable. An SDK cannot guarantee solvency or legal compliance.
Acceptance plan
Build a mock economy with two players, duplicate purchase requests, insufficient funds and interrupted settlement. Verify that no client can debit another player. Later use isolated Testnet wallets to validate deposit and withdrawal evidence against the direct API. Testnet does not establish commercial viability or permission to operate a real-money game.
Primary reference
https://thamer.org/api
Related reading
https://thamer.org/docs/wab-sdk-api-engine-application-boundaries
https://thamer.org/docs/wab-sdk-payment-reconciliation
https://thamer.org/docs/wab-sdk-immutable-fee-policy
https://thamer.org/docs/wab-sdk-idempotency-retry-strategies
https://thamer.org/docs/wab-sdk-mobile-secure-backend
https://thamer.org/docs/wab-sdk-game-internal-ledgers
https://thamer.org/docs/wab-sdk-game-deposit-withdrawal
https://thamer.org/docs/wab-sdk-unity-bitcoin-architecture
https://thamer.org/docs/wab-sdk-unreal-bitcoin-architecture
https://thamer.org/docs/wab-sdk-game-rewards-digital-purchases
