SDK Authentication and Secure Credential Management
Research status: Theoretical SDK design. Examples are illustrative and have not been built or tested against the live engine.
Credentials are capabilities
A wallet authorization key must be treated as sensitive authority, not an ordinary application identifier. Recovery material is even more sensitive. Keep it out of source code, package examples, telemetry, crash dumps and published test artifacts. Do not assume that a client-side read-only wrapper makes the underlying key read-only.
Credential injection
The wallet operations document an X-BTC-KEY header. Inject it only for the intended trusted engine origin. Keep factory and restore request handling separate from ordinary authenticated calls. Disable automatic cross-origin redirects for credential-bearing requests; do not forward secrets to an arbitrary URL supplied by an application or agent.
import os
def wallet_headers():
key = os.environ.get("WAB_BTC_KEY")
if not key:
raise RuntimeError("Wallet credential unavailable")
return {"X-BTC-KEY": key, "Content-Type": "application/json"}This is an illustrative development pattern. Environment variables are not a complete secret vault; process inheritance, diagnostics and privileged local users may expose them. In production use deployment-appropriate protected secret storage and least-privilege process identities.
Trusted transport
Loopback HTTP can be reasonable for a local trusted engine. Remote traffic requires an authenticated protected channel such as correctly validated TLS or an authorized SSH tunnel. Do not disable certificate validation to make integration easier. Configure fixed trusted destinations rather than let an AI-generated URL choose where the credential goes.
Authorization above the engine
An AI tool or mobile application should expose narrow business operations through a trusted executor. Keep payment authorization, cumulative budgets and approval rules in that executor when required. Such restrictions are proposed application policies, not existing engine features. Do not expose the merchant's wallet key to game clients or browser JavaScript. Preserve the documented idempotency header for an authorized send; an identifier is not itself permission to spend.
Acceptance plan
Exercise missing credentials, wrong credentials, redirect handling, log redaction and network failures with synthetic secrets. Then use a dedicated test wallet for authorized calls. Review generated artifacts before publication. Avoid testing recovery or removal on a production wallet. No authentication mechanism beyond the documented contract is assumed.
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-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
