BRC-100 Wallet Interface

BRC-100 is the standard application-to-wallet interface used by BSV Desktop, BSV Browser, @bsv/wallet-toolbox, and any compatible wallet implementation.

The authoritative sources for this page are:

  • packages/sdk/src/wallet/Wallet.interfaces.ts (TypeScript definitions)
  • specs/sdk/brc-100-wallet.json (wire-format schema)
  • BRC-100 in the BRC repository

This MD is a human-readable summary. Implement against the TS interfaces and JSON schema. The TypeScript interface passes originator?: OriginatorDomainNameStringUnder250Bytes as an optional second method parameter (wire formats carry it in the request envelope). See ReviewActionResult for delayed-broadcast responses.

Data Conventions

TypeShape
Byte[]Array of integers from 0 to 255. Conformance vectors may encode byte arrays as hex strings for readability.
BEEFBRC-62 transaction envelope bytes.
AtomicBEEFBRC-95 bytes used for action transactions.
OutpointString<64 hex txid>.<output index>.
PubKeyHexCompressed secp256k1 public key, 66 hex chars.
WalletProtocolTuple [securityLevel, protocolString], where security level is 0, 1, or 2.
WalletCounterpartyA PubKeyHex, 'self', or 'anyone'.

Every method returns Promise<object>. Errors are thrown as wallet error objects with isError: true.

Method Index

AreaMethods
ActionscreateAction, signAction, abortAction, listActions, internalizeAction
OutputslistOutputs, relinquishOutput
Keys and cryptographygetPublicKey, revealCounterpartyKeyLinkage, revealSpecificKeyLinkage, encrypt, decrypt, createHmac, verifyHmac, createSignature, verifySignature
Certificates and identity discoveryacquireCertificate, listCertificates, proveCertificate, relinquishCertificate, discoverByIdentityKey, discoverByAttributes
Wallet stateisAuthenticated, waitForAuthentication, getHeight, getHeaderForHeight, getNetwork, getVersion

Actions

createAction

Creates a transaction action. The wallet may fund, sign, and process it immediately, or it may return a signableTransaction reference when inputs need external unlocking scripts.

typescript
const result = await wallet.createAction(args)

Required args:

FieldTypeNotes
descriptionstringHuman-readable action description, 5-50 bytes.

Optional args:

FieldTypeNotes
inputBEEFBEEFSource transaction data for explicit inputs.
inputsCreateActionInput[]Explicit inputs to spend. Each needs outpoint and inputDescription; provide unlockingScript now or unlockingScriptLength for later signing.
outputsCreateActionOutput[]Outputs to create. Each needs lockingScript, satoshis, and outputDescription; may include basket, customInstructions, and tags.
lockTimenumberTransaction lock time.
versionnumberTransaction version.
labelsstring[]Action-level labels for listActions.
optionsCreateActionOptionsProcessing options below.

Options:

OptionTypeDefaultNotes
signAndProcessbooleantrueIf true and all inputs can be signed, return txid and/or tx. If false or an input has only unlockingScriptLength, return signableTransaction.
acceptDelayedBroadcastbooleantrueIf true, wallet may queue broadcast in the background. If false, broadcast errors can be returned immediately.
trustSelf'known'-Allows proof data for wallet-known transactions to be omitted.
knownTxidsstring[]-TXIDs the wallet may treat as known for chained transactions.
returnTXIDOnlybooleanfalseReturn only txid when possible.
noSendbooleanfalseConstruct without sending; useful for chained batches.
noSendChangestring[]-Change outpoints from prior noSend actions in the same batch.
sendWithstring[]-TXIDs of prior noSend actions to send with this action.
randomizeOutputsbooleantrueSet false when output order must remain deterministic.

Returns:

FieldTypeWhen present
txidTXIDHexStringWhen the action has a transaction ID to report.
txAtomicBEEFWhen transaction bytes are returned.
noSendChangeOutpointString[]When noSend produces change for later chained actions.
sendWithResultsSendWithResult[]When sending a batch created with sendWith.
signableTransaction{ tx: AtomicBEEF, reference: Base64String }When the action needs a follow-up signAction.
(ReviewActionResult fields)objectWhen acceptDelayedBroadcast: false; see ReviewActionResult (status, competingTxs, etc.) in Wallet.interfaces.ts.

Minimal shape:

typescript
const result = await wallet.createAction({
  description: 'Create payment',
  outputs: [{
    lockingScript,
    satoshis: 1000,
    outputDescription: 'Payment output'
  }],
  options: { acceptDelayedBroadcast: false }
})

signAction

Completes an action that was created with createAction and returned a signableTransaction.

typescript
const result = await wallet.signAction(args)

Required args:

FieldTypeNotes
referenceBase64StringsignableTransaction.reference from createAction.
spendsRecord<number, SignActionSpend>Map from input index to { unlockingScript, sequenceNumber? }.

Options:

OptionTypeDefault
acceptDelayedBroadcastbooleantrue
returnTXIDOnlybooleanfalse
noSendbooleanfalse
sendWithTXIDHexString[]-

Returns:

FieldType
txidTXIDHexString
txAtomicBEEF
sendWithResultsSendWithResult[]

Minimal shape:

typescript
await wallet.signAction({
  reference: action.signableTransaction!.reference,
  spends: {
    0: { unlockingScript }
  },
  options: { acceptDelayedBroadcast: false }
})

abortAction

Cancels an in-progress action before it is finalized.

ArgsReturns
{ reference: Base64String }{ aborted: true }

listActions

Lists wallet actions matching labels.

Required args:

FieldType
labelsLabelStringUnder300Bytes[]

Optional args:

FieldTypeDefault
labelQueryMode`'any''all'`
includeLabelsbooleanfalse
includeInputsbooleanfalse
includeInputSourceLockingScriptsbooleanfalse
includeInputUnlockingScriptsbooleanfalse
includeOutputsbooleanfalse
includeOutputLockingScriptsbooleanfalse
limitnumber10, max 10000
offsetnumber0
seekPermissionbooleantrue

Returns { totalActions, actions }, where each action includes txid, satoshis, status, isOutgoing, description, version, lockTime, and optional labels/inputs/outputs depending on include flags.

internalizeAction

Imports a transaction into the wallet so selected outputs become wallet payments or basket insertions.

Required args:

FieldTypeNotes
txAtomicBEEFTransaction bytes to internalize.
outputsInternalizeOutput[]Outputs to treat as wallet payments or basket insertions.
descriptionstringHuman-readable description, 5-50 bytes.

Optional args:

FieldType
labelsstring[]
seekPermissionboolean

InternalizeOutput uses:

FieldTypeNotes
outputIndexnumberOutput index in the transaction.
protocol`'wallet payment''basket insertion'`
paymentRemittance{ derivationPrefix, derivationSuffix, senderIdentityKey }Required for wallet payments.
insertionRemittance{ basket, customInstructions?, tags? }Required for basket insertions.

Returns { accepted: true }.

Outputs

listOutputs

Lists tracked outputs from a basket.

Required args:

FieldType
basketBasketStringUnder300Bytes

Optional args:

FieldTypeDefault
tagsOutputTagStringUnder300Bytes[]-
tagQueryMode`'all''any'`
include`'locking scripts''entire transactions'`
includeCustomInstructionsbooleanfalse
includeTagsbooleanfalse
includeLabelsbooleanfalse
limitnumber10, max 10000
offsetnumber0; negative offsets read newest first.
seekPermissionbooleantrue

Returns:

FieldType
totalOutputsnumber
BEEFBEEF, when include: 'entire transactions'
outputsWalletOutput[]

WalletOutput includes outpoint, satoshis, spendable, optional lockingScript, optional customInstructions, optional tags, and optional action labels.

relinquishOutput

Removes an output from a basket without spending it.

ArgsReturns
{ basket: string, output: OutpointString }{ relinquished: true }

Keys and Cryptography

Most key and crypto methods share WalletEncryptionArgs:

FieldTypeRequiredNotes
protocolIDWalletProtocolyes except getPublicKey({ identityKey: true })[securityLevel, protocolString].
keyIDstringyes except getPublicKey({ identityKey: true })Derivation key ID.
counterpartyWalletCounterpartynoPublic key, 'self', or 'anyone'.
privilegedbooleannoRequests privileged keyring.
privilegedReasonstringwhen privilegedReason shown to the user.
seekPermissionbooleannoDefaults to true.

getPublicKey

Retrieves the wallet identity key or a derived public key.

Args:

FieldTypeNotes
identityKeytrueIf true, returns the user's identity key and ignores protocol/key fields.
protocolIDWalletProtocolRequired when not requesting the identity key.
keyIDstringRequired when not requesting the identity key.
counterpartyWalletCounterpartyOptional derivation counterparty.
forSelfbooleanReturn a key derived from this user's identity rather than the counterparty's identity.
privileged, privilegedReason, seekPermissionsee shared argsOptional.

Returns { publicKey: PubKeyHex }.

revealCounterpartyKeyLinkage

Reveals the linkage between this wallet and a counterparty across all interactions to a verifier.

ArgsReturns
{ counterparty: PubKeyHex, verifier: PubKeyHex, privileged?, privilegedReason? }{ encryptedLinkage, encryptedLinkageProof, prover, verifier, counterparty, revelationTime }

revealSpecificKeyLinkage

Reveals linkage for one protocol/key interaction.

ArgsReturns
{ counterparty, verifier, protocolID, keyID, privileged?, privilegedReason? }{ encryptedLinkage, encryptedLinkageProof, prover, verifier, counterparty, protocolID, keyID, proofType }

encrypt

Encrypts bytes with a derived key.

Additional argType
plaintextByte[]

Returns { ciphertext: Byte[] }.

decrypt

Decrypts bytes with a derived key.

Additional argType
ciphertextByte[]

Returns { plaintext: Byte[] }.

createHmac

Creates an HMAC over bytes with a derived key.

Additional argType
dataByte[]

Returns { hmac: Byte[] }.

verifyHmac

Verifies an HMAC over bytes with a derived key.

Additional argsType
dataByte[]
hmacByte[]

Returns { valid: true } on success and throws on failure.

createSignature

Creates a DER-encoded ECDSA signature.

Additional argsTypeNotes
dataByte[]Provide this or hashToDirectlySign.
hashToDirectlySignByte[]For pre-hashed data.

Returns { signature: Byte[] }.

verifySignature

Verifies a DER-encoded ECDSA signature.

Additional argsTypeNotes
signatureByte[]Required.
dataByte[]Provide this or hashToDirectlyVerify.
hashToDirectlyVerifyByte[]For pre-hashed data.
forSelfbooleanVerifies against this user's derived key rather than the counterparty's.

Returns { valid: true } on success and throws on failure.

Certificates and Discovery

acquireCertificate

Acquires a certificate by direct receipt or issuance from a certifier.

Required args:

FieldType
typeBase64String
certifierPubKeyHex
acquisitionProtocol`'direct'
fieldsRecord<string, string>

Optional args include serialNumber, revocationOutpoint, signature, certifierUrl, keyringRevealer, keyringForSubject, privileged, and privilegedReason.

Returns a WalletCertificate with type, subject, serialNumber, certifier, revocationOutpoint, signature, and fields.

listCertificates

Lists certificates held by the wallet.

Required args:

FieldType
certifiersPubKeyHex[]
typesBase64String[]

Optional args: limit, offset, privileged, privilegedReason.

Returns { totalCertificates, certificates }. Each certificate may include keyring and verifier.

proveCertificate

Builds a selective disclosure proof for specified fields.

Required args:

FieldType
certificatePartial<WalletCertificate> in TypeScript; schema artifact describes WalletCertificate.
fieldsToRevealstring[]
verifierPubKeyHex

Optional args: privileged, privilegedReason.

Returns { keyringForVerifier, certificate?, verifier? }.

relinquishCertificate

Removes a certificate from wallet storage.

ArgsReturns
{ type: Base64String, serialNumber: Base64String, certifier: PubKeyHex }{ relinquished: true }

discoverByIdentityKey

Discovers trusted identity certificates for an identity key.

Required argType
identityKeyPubKeyHex

Optional args: limit, offset, seekPermission.

Returns { totalCertificates, certificates }, where certificates are IdentityCertificate[].

discoverByAttributes

Discovers identity certificates matching public attributes.

Required argType
attributesRecord<string, string>

Optional args: limit, offset, seekPermission.

Returns { totalCertificates, certificates }, where certificates are IdentityCertificate[].

Wallet State

isAuthenticated

Checks whether the user is authenticated.

ArgsReturns
{}{ authenticated: true }

waitForAuthentication

Waits until the user is authenticated.

ArgsReturns
{}{ authenticated: true }

getHeight

Gets the current chain height.

ArgsReturns
{}{ height: PositiveInteger }

getHeaderForHeight

Gets an 80-byte block header as hex.

ArgsReturns
{ height: PositiveInteger }{ header: HexString }

getNetwork

Gets the wallet network.

ArgsReturns
{}`{ network: 'mainnet'

getVersion

Gets the wallet implementation version string.

ArgsReturns
{}{ version: string }

Conformance

Current BRC-100 conformance vectors provide 100% coverage of the full WalletInterface (632 vectors across 25 files covering all 27+ methods, including actions, outputs, certificates, state queries, and key linkage).

See:

  • Vector Catalog
  • conformance/vectors/wallet/brc100/
  • conformance/META.json

Spec Artifact