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

Network Isolation Between Mainnet and Testnet

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

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

Network identity

A network is part of the identity of every operation, not a cosmetic display preference. Bind wallet context, engine endpoint, address family, operation record and transaction evidence to an explicit network. Do not infer the active network from a user-facing label or from an address prefix alone: multiple test networks can share address encodings. The SDK must not silently switch networks when a request fails.

Conceptual Go configuration

type Scope struct {
    Network string
    WalletID string
    EngineURL string
}
func (s Scope) CheckLab() error {
    if s.Network != "test" { return fmt.Errorf("lab network required") }
    return nil
}

This check is only one local guard. The network token must be mapped to the documented engine contract and the actual chain must be independently established through deployment configuration and node evidence. A string named test does not distinguish Testnet3 from Testnet4. Validate destination encoding and supported address type with a maintained Bitcoin library. Never rewrite a destination address to another network.

Isolation architecture

Use separate lab credentials, configuration files, persistent operation stores and deployment secrets. Include network in cache keys, invoice allocation and transaction lookup. A test-only build or runtime profile should reject Mainnet spending even if a caller supplies a valid Mainnet address. Avoid sharing a mutable global client across network contexts. Test fixtures must never contain production credentials. Health and discovery are useful readiness evidence but cannot alone establish spending authorization.

Acceptance plan

Test Mainnet addresses against a test-only profile, conflicting configuration, wrong explorer chain, and two concurrent network contexts. Verify that rejected requests do not reach the engine transport. Record actual chain identity in live test reports. Do not alter Bitcoin Core settings or engine topology to make an SDK test pass. Mainnet validation is a separate authorized activity, not an automatic fallback.

Primary reference

https://thamer.org/api

Related reading

https://thamer.org/docs/wab-sdk-receive-address-interfaces
https://thamer.org/docs/wab-sdk-authentication-credential-management
https://thamer.org/docs/wab-sdk-multi-tenant-payments

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