The 2.18.1 source candidate makes nLockTimeIsFinal apply the node's rule for the
next block: a height lock time below tip + 1 and a time lock time below the
median time past of the last eleven headers (BIP113), instead of the tip height
and the wall clock. Inputs with an omitted sequence count as final. No API, wire
or schema migration is required. Source is not publication or deployment.
The 2.18.1 source candidate scores broadcaster answers that judge nothing about the transaction as service errors: ARC HTTP 401 and 403 (a keyless request to the default arc.taal.com, or a refused key), WhatsOnChain 401, 403, 408, exhausted 429 and 5xx answers that relay no node refusal, and a Bitails per- transaction connection reset. Such a transaction now stays queued for retry or fails over instead of being marked invalid with its inputs released. No API, wire, configuration or schema migration is required. Source is not publication or deployment.
The 2.18.1 source candidate lets a sendMax (maxPossibleSatoshis) createAction
be funded from unproven change when the wallet holds no confirmed coins, instead
of failing with an invalid output amount. No API, wire or schema migration is
required. Source is not publication or deployment.
The 2.17.0 source candidate reports listCertificates totalCertificates as
the size of the matching set at every offset, including full and empty later
pages in IndexedDB. Non-empty final pages use the skipped rows plus the page;
other pages count without a page window. User, deletion, type and certifier
filters and returned certificate fields are unchanged. Upgrade the affected
local storage package or remote Storage service to receive corrected totals.
No API, wire or schema migration is required.
Spending authorization accounts for the inputs and outputs that permission modules pass to the wallet, including token funding and change. Caller input descriptions remain attached to their outpoints when a module reorders inputs. Output descriptions follow the metadata retained by copied or reordered outputs, including outputs with identical scripts and amounts. New module entries with no caller description use the existing description fallback. Requested-output verification, exact wallet-spend checks and storage service-charge accounting remain enforced. No API, wire or stored-data migration is required.
The 2.17.0 source candidate adds optional actionBatchMode to the Setup and
SetupClient factory arguments. Select legacy when your application broadcasts
its own noSend transactions and needs the existing per-action storage path:
import { SetupClient, type SetupClientWalletArgs } from '@bsv/wallet-toolbox'
declare const options: SetupClientWalletArgs
const { wallet } = await SetupClient.createWallet({ ...options, actionBatchMode: 'legacy' })The browser client exposes the same SetupClient option. Omission keeps auto,
including its existing storage-capability negotiation and fallback. When batching
is available, related signed noSend actions can remain staged until a subsequent
batch commit. The new option does not recover previously discarded batches or
change signing, BRC-100 calls or database schemas. Existing consumers need no
migration; package publication and consumer upgrades are separate steps.
The 2.15.3 source candidate restores ordinary import of exactly framed legacy AtomicBEEF with surplus unrelated branches. It retains the declared payment and its dependencies, reruns strict SDK argument validation, and preserves native proof, ownership and receipt checks. Truncated, trailing and incomplete inputs remain rejected. No API, wire or schema migration is required. Upgrade the host and remote Storage separately; reconcile and retry the original import instead of creating or broadcasting a replacement payment. Source is not publication or deployment.
The candidate now captures immutable journal field artifacts with a distinct metadata/extent encoding and version-four binding. The actual pinned source hashes every field, stores repeated content once, rehashes its replay and captures streamed notification identities in bounded profile-filtered batches. Content-index metadata enters the artifact hash chain, and READY waits for physical source closure. The existing archive quotas, row/version-three APIs and HTTP advertisements remain unchanged. Remote field transport, destination cache/semantic promotion and primary handoff still require integration and full qualification.
The held #569 candidate adds an internal bounded logical journal-field source and verified native content-staging connection. Client/mobile journal artifact capability and packet encoding remain unchanged; remote field transfer/promotion and remote primary handoff still need implementation. Exact leading U+FEFF, NUL and astral SQL text survives the existing journal frame format. This component does not establish complete large-field sync or production readiness.
The unpublished 2.15 candidate adds syncFromReaderResumable, fair foreground scheduling, network/error preflight and canonical proof recovery. See the sync contract and rollout guide. Existing sync methods and BRC-38/39/40 formats remain supported.
@bsv/wallet-toolbox is the reference toolkit for building BRC-100 wallets. It connects @bsv/sdk primitives to wallet storage, key derivation, signing, services, monitoring, permissions, and authentication flows.
Use this package when you are building a wallet product, a wallet-like service, or another implementation that must match BRC-100 behavior.
The 2.15.0 source candidate adds separate deep-import SQLite action and funding recovery controllers. They retain exact noSend preparation/signing state or atomically reconcile BRC-29 wallet ownership with a durable receipt. Ordinary BRC-100 APIs and SDK peer compatibility remain unchanged; the optional funding capability requires SDK 3.3.0 and explicit same-wallet schema installation.
Read local action recovery and local funding recovery before adopting them. Retain a consistent whole database plus keys and reopen existing auxiliary state after restart. Legacy entity sync/export, IndexedDB, remote providers and browser/mobile wrappers do not carry this state. Stop new use and reconcile outstanding operations before rollback. These local receipts do not establish settlement, quote-time service capacity or protected delivery.
Broadcast result completion in the 2.14.9 source candidate preserves an already
unmined or completed request while returning the actual provider outcome.
A successful first receipt without a mining proof therefore no longer fails
with an internal unknown-status error on shared storage or after concurrent
storage-worker progress. Negative provider outcomes still reject that receipt;
repeat successful receipt remains idempotent. Upgrade the implementation
performing broadcast/internalization after protected publication. No public
API or wire migration is required. SQL storage adds a durable user/TXID receipt
claim table while preserving historical transaction and output rows. Back up
and preflight the database, then coordinate the rollout across every serving storage instance;
older instances do not honor the claim. Local IndexedDB does not use the SQL
claim. This candidate does not deploy hosted storage or repair older partial
receipts automatically.
ProtoMap, BasketMap and CertMap supply descriptive metadata, not permission grants.
Wallets adopting the proposed registry framework must keep a usable normal
authorization flow when metadata is absent, disputed or unavailable, and must not
use listing status as a protocol gate. Existing permission, spending, validation
and supported-module checks remain separate. See registry metadata
for builder submissions, source selection and a wallet adoption checklist. Shared
trustedCertifiers settings in some consumers need care: trusting descriptions
and trusting certificate issuers are different decisions. This guide does not
claim a new registry-only settings API or universal UI conformance.
Recoverable root key material and wallet records are both required. A seed alone cannot reconstruct every BRC-100 output's derivation metadata. BRC-38/39 exports preserve wallet data, not root keys or unrelated product state.
Start with Wallet backup and recovery, then use BRC-38/39 integration, the recovery drill and the agent implementation brief. The integration guide documents concrete-provider requirements, explicit restore/merge modes and the limits of the current in-memory export helpers.
BRC-177 anchors cover both the delivery and an economic reclaim. When the reclaim floor is larger, the protected action pays the bounded surplus as miner fee while retaining no wallet change. Upgrade the active storage implementation to receive this funding fix; no wire or database migration is required.
Wallet Toolbox 2.11 adds the built-in BRC-177 p nosend expiry module. It
pre-funds expiring noSend actions, stores a signed reclaim durably across
active/backup storage and restarts, and lets the authoritative local or remote
monitor reclaim an unbroadcast action after its time or block-height deadline.
See Expiring noSend actions.
Knex and IndexedDB listOutputs providers report totalOutputs as the full
matching count on every page, including short final and out-of-range pages.
Knex storage can opt into prepared BEEF (COOK) for normal createAction
funding. Exact verified proof closures are persisted only after foreground
action work, while reads, writes, and bounded backfill remain separately
controlled and default off. Every miss or invalid artifact retains the
canonical BEEF builder.
WalletAuthenticationManager supports an additive WAB UMP outpoint pin for
legacy ambiguity and an OTP-verified phone-number change that always rolls the
presentation key. The same registered number is valid. A pin is ignored unless
normal verified lineage resolution remains ambiguous and the outpoint is one
of the wallet's verified candidates. Applications must persist
saveSnapshot() immediately after completePhoneNumberChange() succeeds.
Wallet-manager snapshots can carry root and privileged key material; they do
not include the Wallet Toolbox storage database. Possession of such a snapshot
is possession of the wallet's key material. Store each
complete snapshot only in an OS Keychain, hardware-backed keystore, or
comparably trusted secret store. Remote storage and credential-bearing Arcade
SSE require HTTPS except for explicit loopback development, and transport
debugging cannot log callback tokens or API credentials. Arcade status events
are validated, copied, and committed one at a time under per-event and aggregate
queue budgets; no later cursor can advance past a malformed or failed event.
The stream is silent by default and reports credential-bearing transport errors
only as a generic signal. Monitor and daemon startup await retryable ChainTracks
subscriptions, teardown closes SSE/subscriptions before storage, persisted
diagnostics are bounded, and monitor operational logging requires the additive
MonitorOptions.logging callback.
For fenced SQLite and MySQL stores, the multi-user Monitor reviews status and confirmed spends in physical keyset pages. It can correct an output only while its store holds the user's primary epoch. Passive copies follow their primary through normal synchronization. Recovery reopens an unchanged output only after a reorg invalidates its recorded spender and the canonical funding proof and positive outpoint check both pass. The receipt belongs to its SQL store. A handoff does not give another store authority to reopen the output from the flag alone.
The normal Knex migration adds monitor_checkpoints and
monitor_confirmed_spends. Each checkpoint replaces one row and each output
has at most one live spend receipt. The Monitor reads earlier cursor events and
imports receipts still eligible for recovery in bounded pages. Keep the legacy
ConfirmedOutputSpend records through that import. Diagnostic log retention
can then run separately from Monitor state. Keep both new tables for an
application rollback and for whole-store backups.
The default page sizes are 1,024 transaction rows and 32 proof rows. Tune
MonitorOptions.statusReviewPageSize from 1 to 2,048 or
MonitorOptions.confirmedSpendReviewPageSize from 1 to 128 for a store's
capacity. At a five-second scheduler interval, a million proofs take about
43 hours to sweep at 32 proofs per page before accounting for slow database
work or unusually large transactions. Time budgets limit when a page starts
another operation. The Monitor still waits for an operation already in progress
and resumes from the durable cursor on the next tick.
The default Arcade cursor is scoped to its endpoint and callback feed. A token change selects a fresh feed and starts from its beginning. Hosts that can prove feed continuity across a rotation can supply both cursor persistence hooks.
An Arcade endpoint that requires an API key takes it as the arcadeApiKey
argument of createDefaultWalletServicesOptions (or arcadeConfig.apiKey); it
is sent as Authorization: Bearer <key> on broadcast, lookup and SSE requests.
A refused key (HTTP 401 or 403) is a service error, like a 429 or 5xx: the
wallet fails over to the next broadcaster or retries, and never marks the
transaction invalid because of it.
Spending approvals apply to one operation per prompt and are never cached or
coalesced. Spending-token accounting reads every action page before authorizing
a spend. WalletPermissionsManager resolves a sendMax (maxPossibleSatoshis)
output's funded amount from the signable transaction by locking script before
billing it, so a createAction call funding the wallet's full balance through
the permissions manager is authorized and verified for its real amount instead
of the unfunded sentinel. Certificate handling also fails closed: direct and
issuer-mediated acquisition require a valid certifier signature before
storage, and identity discovery verifies overlay certificates before
decrypting or trust-scoring them.
relinquishOutput and internalizeAction confirm basket membership before
mutating it. relinquishOutput rejects a basket argument that does not match
the output's actual current basket, or names a basket that does not exist, so
an application cannot free an outpoint it does not actually hold by basket
membership. internalizeAction's basket-insertion merge path rejects
reclassifying an output that already belongs to a different real basket,
while re-internalizing into the same basket and inserting a currently
unbasketed (non-managed-change) output both keep working.
Action-batch workspaces now admit only explicitly connected transaction-graph members. Unrelated actions stay on their ordinary storage path, while related workspaces can resume an expired soft lease by reacquiring only their exact persisted inputs under the provider's advertised reservation bound.
Immediate actions may use wallet-managed change from a transaction awaiting background broadcast, but only after completed and unproven liquidity is exhausted or an over-16-input settled plan is larger by exact serialized transaction-plus-BEEF cost. Queued funds are never hidden.
Durable permission grants retain delayed broadcast, avoiding network latency in the permission path. New and existing wallets progressively target 144 useful 5,000-satoshi change outputs, create no more than eight outputs per action, and migrate no more than four fee-positive legacy fragments per action. Optional shaping cannot make a formerly fundable action fail.
Completed createAction and signAction results expose Atomic BEEF as a
numeric array at the public wallet boundary. The historical shape survives
plain JSON serialization for older BRC-100 applications; typed arrays remain
supported by the AtomicBEEF type and binary Wallet Wire transports.
WalletStorageManager.getStores() reports the configured endpointURL for
remote providers without relying on a class name. Browser and application
bundlers may safely minify the provider constructor while backup selection and
make-primary flows continue matching the original endpoint URL.
Opt-in remote-storage timing spans retain trace and parent-span correlation in the telemetry sink without adding headers to authenticated requests. BRC-103, BRC-104, AuthFetch, and the storage RPC wire contract remain unchanged.
UMP account lookup accepts one verified matching token as an existing account. When no token verifies, one clean empty overlay response establishes a new account even if other hosts fail or return malformed records. Multiple distinct verified tokens remain errors unless normal lineage finds one current token or an optional WAB pin names one of the verified candidates. Lookups with no usable response remain errors; WAB existing-account continuity still prevents replacement-wallet onboarding.
ChainTracks defaults to credential-free Arcade/go-chaintracks v2 HTTP and SSE on mainnet, testnet, and TerraTestNet. STN and Terra Scaling TestNet require an explicit operator endpoint. Remote header batches pass local serialization, hash, continuity, and genesis checks; source failures fall through in priority order; and synchronized trackers keep serving last-good local data. WhatsOnChain is an optional, rate-limited mainnet/testnet fallback; no key is required.
The configured remote ChainTracks service is authoritative for chain view, but
its response representation is still adversarially validated. HTTP reads have
whole-body deadlines and byte ceilings, redirects are prohibited, SSE streams
have event and idle bounds, and network/header/reorganization results must be
canonical, proof-of-work-valid, and exactly request-bound. Local submitted and
remote live-header queues are copy-isolated and bounded to prevent a faulty or
hostile source from retaining unbounded process memory.
Remote live metadata must be complete and use positive local identities.
Reorganization deactivation lists must start at the old tip, contain no
duplicates, form a descending linked chain, and fit their declared depth before
wallet monitor callbacks receive them. Remote diagnostics are bounded and
single-line. The monitor independently authenticates and copies custom-adapter
events, verifies that every configured chain source matches the wallet network,
and retains at most 4,096 unique deactivated headers by default. Applications
can lower this with MonitorOptions.maxQueuedDeactivatedHeaders. Prepared-proof
invalidation is coalesced and drained during teardown, while partial event
subscriptions and rejected host callbacks are contained as bounded monitor
events. Optional Chaintracks header/reorg push subscriptions no longer gate
the scheduler: an event source that declares supportsReorgEvents: false
(such as the built-in HTTP-polling ChaintracksServiceClient) is never called,
and a source that fails to subscribe is retried opportunistically on the next
tick while every other scheduled task keeps running. A genuine configured-chain
mismatch still fails closed — subscriptions are never registered against a
chaintracksWithEvents source that reports the wrong chain — and is recorded
as a chaintracksEventsError monitor event.
The legacy BHServiceClient also validates current canonical headers for every
Merkle-root verdict. Its compatibility cache is diagnostic state only and is
never trusted, so a rejected root, caller mutation, or reorganization cannot
turn an old root into authority. Redirects, endpoints, response bodies, ranges,
hashes, linkage, and proof of work are bounded and checked before use.
ChainTracks constructors reject malformed networks, recursion limits, and
ingestor collections; logging is silent unless the host explicitly provides
the optional logger. Startup awaits and reports initialization failure, failed
attempts can retry cleanly, and destruction drains sources and storage even
before readiness. Event subscriptions are bounded, removed on unsubscribe, and
copy-isolated between listeners.
Local ChainTracks adapters also enforce stored-state integrity. In-memory
instances do not share live headers, IndexedDB and Knex require unique active
headers and consecutive parent linkage, and bounded reorganization walks fail
closed on missing or cyclic state. Knex uses a transaction-held state row to
serialize competing tip mutations. Apply all ChainTracks Knex migrations before
startup. MySQL operators should expect the derived live-header cache to be
cleared once while legacy truncating VARBINARY(32) fields are widened to
VARCHAR(64); authenticated bulk data is retained and repopulates live state.
Before downgrading to code that predates this repair, stop all ChainTracks
writes and verify a database plus authenticated-bulk-data backup. Use the
current ChaintracksKnexMigrations source to roll down only the
2026-09-17-001 repair MySQL live-header encodings and bulk blob ledger entry;
its schema down is intentionally a no-op. Retain the repaired VARCHAR(64) and
LONGBLOB columns, the chaintracks_state lock row, and authenticated bulk
files, and validate that state against the older code in a non-production copy
before starting it. Never roll down the initial migration, recreate the tables,
or restore truncating VARBINARY(32) identifier columns.
Bulk-file additions and extensions persist before memory changes. Multi-file
replacements and initial reconciliation commit atomically in the built-in Knex
and IndexedDB adapters, and failed commits restore the manager's prior state.
Custom ChaintracksStorageBulkFileApi adapters must implement the additive
replaceBulkFiles method before multi-file changes are enabled; older custom
adapters fail closed instead of risking a durable gap or stale overlap.
WhatsOnChain is authoritative only when explicitly enabled as a fallback chain source. Its service-discovered CDN links are untrusted locators, not operator configuration: they must be credential-free public HTTPS, with public-address DNS pinning in Node. Manifests, binary objects, recent-header JSON, and legacy WebSocket frames have byte, count, ordering, handshake, and idle bounds. Every candidate is canonical and proof-of-work-valid before its declared target can participate in chain-work selection.
Local ChainTracks height reads now use stale-while-revalidate singleflight,
while immutable bulk objects coalesce misses and back off failed loads. Node
services can move complete length, digest, linkage, chain-work, genesis, and
proof-of-work validation into NodeBulkFileDataValidator; filesystem
deployments can pair content-addressed quarantine storage with a crash-safe,
per-attempt DurableFileBulkFileDownloadBudget. The shared ledger serializes
reservations across processes; a crash-abandoned <stateFile>.lock fails
closed and must be removed only after an operator proves no writer remains.
Filesystem cache reads allocate no more than the advertised object size plus
one rejection byte, and writes must match their advertised length and SHA-256.
Replacement, promotion, and quarantine serialize across processes through a
per-digest <digest>.headers.lock. Like the budget lock, it is never reclaimed
automatically after a crash; prove no cache writer remains before removing that
narrow directory. Cache metadata and byte inputs are snapshotted before any
lock wait.
Legacy filesystem manifests accept only path-free filenames and are never replaced merely because a read, permission, size, parse, or integrity check failed. Imported/exported files are bounded and must authenticate as one contiguous genesis-anchored header chain with matching digests and chain work.
npm install @bsv/wallet-toolboxBrowser and mobile bundles are also published:
npm install @bsv/wallet-toolbox-client
npm install @bsv/wallet-toolbox-mobile| Component | Purpose |
|---|---|
Wallet | Main BRC-100 implementation. |
WalletStorageManager | Coordinates active and backup storage providers. |
| Storage providers | SQL/Knex, IndexedDB, and remote storage over HTTP. |
WalletSigner | Bridges wallet-controlled keys into SDK transaction signing flows. |
Services | Network service container for broadcast, chain tracking, and proof services. |
Monitor | Background wallet maintenance tasks. |
| Key managers | BRC-42/43 derivation, privileged key management, Shamir-based recovery flows. |
WalletPermissionsManager | Permission gating around wallet methods and reserved protocols/baskets. |
MockChain | Test chain utilities for wallet behavior without a live network. |
The example package uses the Setup class for wallet construction. Create a .env with Setup.makeEnv(), then load the environment and construct a client wallet:
import { Setup } from '@bsv/wallet-toolbox'
const env = Setup.getEnv('test')
const setup = await Setup.createWalletClient({
env,
endpointUrl: 'https://store-us-1.bsvb.tech'
})
const { publicKey } = await setup.wallet.getPublicKey({
identityKey: true
})
console.log(publicKey)setup.wallet is the BRC-100 wallet. The surrounding setup object exposes the constructed rootKey, identityKey, keyDeriver, storage, services, and monitor so wallet builders can inspect or replace pieces while developing.
WalletPermissionsManager registers BRC-98/99/111 modules by the scheme after
the p prefix. Existing modules can transform calls with onRequest and
onResponse. A semantic module can instead implement
handleRequest(request, next) and return the conforming BRC-100 result itself;
if it needs the underlying wallet operation, next is guarded to one call.
The separate @bsv/ecpm-permission-module uses
this hook to implement point multiplication under p ecpm while keeping
getPublicKey as the public wallet method.
@bsv/sigma-permission-module uses it to
return statement points and zero-knowledge proofs under p sigma through
encrypt.
When every input can be signed by the wallet, createAction can return a completed action:
export async function createP2pkhOutput(recipientAddress: string) {
const lockingScript = Setup.getLockP2PKH(recipientAddress).toHex()
const result = await setup.wallet.createAction({
description: 'Create payment',
labels: ['payment'],
outputs: [
{
lockingScript,
satoshis: 1000,
outputDescription: 'Payment output'
}
],
options: {
randomizeOutputs: false,
acceptDelayedBroadcast: false
}
})
console.log(result.txid, result.tx)
}
await createP2pkhOutput('1EvmsbpAY7nESLkN4ajLTMbvsaQ1HpJPGX')When an explicit input needs an unlocking script supplied by the caller, createAction returns signableTransaction, then signAction completes it:
export async function finishCustomSpend(args: {
inputBEEF: number[]
outpoint: string
lockingScript: string
unlockingScript: string
}) {
const created = await setup.wallet.createAction({
description: 'Spend custom input',
inputBEEF: args.inputBEEF,
inputs: [
{
outpoint: args.outpoint,
unlockingScriptLength: 108,
inputDescription: 'Custom input'
}
],
outputs: [
{
lockingScript: args.lockingScript,
satoshis: 1000,
outputDescription: 'Payment output'
}
]
})
await setup.wallet.signAction({
reference: created.signableTransaction!.reference,
spends: {
0: { unlockingScript: args.unlockingScript }
},
options: { acceptDelayedBroadcast: false }
})
}See packages/wallet/wallet-toolbox-examples/src/p2pkh.ts, brc29.ts, pushdrop.ts, and nosend.ts for complete source-backed flows.
| Model | Use |
|---|---|
| SQL/Knex | Node.js wallets and servers with SQLite, MySQL, or another Knex-supported database. |
| IndexedDB | Browser and mobile wallets that keep state on-device. |
| Remote storage | Wallet clients that delegate storage to a Wallet Infra endpoint such as https://store-us-1.bsvb.tech. |
createAction, signAction, listOutputs, internalizeAction, and no-send batching.@bsv/simple/browser for ordinary web app integration.@bsv/simple/server for a backend agent with a private key.@bsv/sdk for raw crypto, scripts, transactions, BEEF, or the BRC-100 interface types.The source candidate adds exact completed-action binding for independently
validated local storage fees and change. The SDK capability marker is
completeBoundAction.outputAuthorizationVersion=1; upgrade the wallet and SDK together.
Existing SDK2 peers retain strict behavior. The separate SDK3 migration still
applies; SDK2 consumers need an additive backport or that migration. Serialized
wallet results do not carry local authority. The fee fix does not change signup
persistence or interrupted-funding reconciliation. See the package README and
release and migration ledger.
The source candidate restores bounded historical types through existing BRC-100 listing, proof, discovery and relinquishment APIs; SDK verification and BRC-103 requests retain the original type. New signing and acquisition require exactly 32 decoded bytes. Legacy binary use needs upgraded adapters on both ends. Listing and proof need no storage protocol or schema change; servers enforcing strict relinquishment must upgrade their SDK reference validator. See the wire profile and rollout contract.