Skip to content

Commands

This page lists every command you can send to the wallet coordinator in libspiffy 6.0.0: the fields each one takes, the reply that answers it, and how long ask() waits for that reply by default. Queries (…Query classes) are on Queries, and every event’s fields are on Events.

All commands are defined in lib/src/actors/coordinator_messages.dart and exported by package:libspiffy/coordinator.dart. The replies come from WalletCoordinatorActor (lib/src/actors/wallet_coordinator_actor.dart) and, for channels and proofs, from ChannelP2PAdapter and ProofP2PAdapter.

LibSpiffyActorSystem.coordinator is a WalletCoordinator. Every command with an answer is a CoordinatorRequest<R>, where R is its reply type. ask() sends the command and completes with that reply:

// Sketch: assumes an initialized LibSpiffyActorSystem named `libspiffy`
// and a mnemonic your app generated and backed up.
import 'dart:async';
import 'package:libspiffy/coordinator.dart';
Future<void> createAlice(String mnemonic) async {
try {
final created = await libspiffy.coordinator.ask(
CreateWalletCommand(walletId: 'alice', name: 'Alice', mnemonic: mnemonic),
);
print('created ${created.walletId}, root address ${created.rootAddress}');
} on CoordinatorFailure catch (failure) {
print('not created: ${failure.message}');
} on TimeoutException {
print('no reply yet; it may still arrive on coordinatorEvents');
}
}

How a request is answered:

  • requestId. Every request takes an optional requestId (String?). When you leave it out, one is generated when the command is made. The reply carries it back, and so does an ErrorEvent the request causes, so two requests of the same kind running at once each get their own answer. The field tables below leave requestId out.
  • A returned reply is a success. ask() throws CoordinatorFailure when the reply reports a failure, when an ErrorEvent names the request, or when the coordinator stops first (CoordinatorFailure.closed). CoordinatorFailure.event holds the failed reply or the ErrorEvent.
  • Error codes. Since 5.10.0, CoordinatorFailure.spiffyCode is a SpiffyErrorCode when the failed reply carries one, so your app can say what went wrong in its own words. See Error codes.
  • Timeouts. ask() throws TimeoutException when no reply arrives within the request’s replyTimeout, the default timeout listed for each command below. Pass timeout: to override it. A timeout does not cancel the request: it may still finish, and its reply then arrives on the event stream only.
  • tell() sends a command without waiting. Its reply is still published on libspiffy.coordinatorEvents. Use tell() for the commands marked “none — tell only”.

Field types such as InvoiceOutputSpec, PaymentPrivacy, Type42Derivation, Brc100KeyRequest and DeferredPaymentNetworkSource are exported by package:libspiffy/libspiffy.dart. See the API reference for their members.

The defaults are constants on CoordinatorRequest:

Constant Value Used by
defaultTimeout 1 minute Requests answered from the coordinator’s own state or one wallet round trip
paymentTimeout 3 minutes PayInvoiceCommand, ProvisionFundingCommand
networkTimeout 3 minutes Requests that wait on one ARC answer
receiveTimeout 5 minutes ValidateBEEFCommand, ImportTransactionCommand
channelTimeout 5 minutes OpenChannelCommand, CloseChannelCommand
reclaimTimeout 6 minutes ReclaimDeferredPaymentCommand
splitTimeout 15 minutes SplitUTXOsCommand
foreignSpendsTimeout 15 minutes CheckForeignSpendsCommand
importTimeout 1 hour ImportWalletCommand

TimestampCommand, LockCoinsCommand and UnlockCoinsCommand wait paymentTimeout + networkTimeout, 6 minutes. QuoteUnlockFeeCommand waits networkTimeout.

Creates a wallet from one of mnemonic (HD wallet), wif, xpriv or xpub (watch-only). libspiffy generates no keys: a wallet with no key material is refused, and your app generates and backs up the mnemonic.

Field Type Required
walletId String yes
name String yes
mnemonic String? no
wif String? no
xpriv String? no
xpub String? no
walletMetadata Map<String, dynamic>? no

Reply: WalletCreatedEvent, once the read model holds the wallet. Default timeout: 1 minute.

The wallet’s network is walletMetadata['network'] ('main', 'test' or 'regtest', in any accepted spelling). Without it, the wallet is on the network initialize() was given (since 6.0.0; before, it was always testnet).

Deletes a wallet. The deletion is journaled as an event.

Field Type Required
walletId String yes
reason String? no

Reply: WalletDeletedEvent, once the read model no longer holds the wallet. A refusal is the reply’s failure. Default timeout: 1 minute.

Since 5.5.0. Renames a wallet. The new name is journaled as an event.

Field Type Required
walletId String yes
name String yes

Reply: WalletRenamedEvent, once the wallet row holds the new name. A wallet that does not exist is refused. Default timeout: 1 minute.

Imports a wallet’s history from the network. With a mnemonic, the wallet is created from it and its import run as a resume, which derives its keys from the stored mnemonic. With resume: true the wallet must already exist and you give no key: the import reads the key from secure storage, skips what the wallet already holds and imports the rest. Use resume to continue an import after the app was killed, to retry one that ended with transactionsFailed above zero, or to rescan.

Field Type Required
walletId String yes
walletName String yes
xpriv String? no
mnemonic String? no
wif String? no
gapLimit int no (default 20)
networkType String? no (default: the system’s network)
resume bool no (default false)
addresses List<String>? no
lockKeyWifs List<String> no (default const [])

Reply: ImportCompleteEvent. ImportProgressEvent, ImportUTXOConfirmedEvent and ImportTransactionConfirmedEvent are emitted while it runs. With no key and no resume, or without a blockchain data source, the reply is a failed ImportCompleteEvent. Default timeout: 1 hour.

Without networkType, the wallet is imported on the network initialize() was given (since 6.0.0; before, it defaulted to 'test'). A network you pass wins.

  • addresses (since 5.7.0, with resume: true) scans only these addresses of the wallet instead of discovering its addresses up to gapLimit. Each must be an address the wallet holds. Transactions the wallet has recorded are skipped, so you can repeat the scan, for example to look for a payment to an address you handed out. Since 5.16.0 it also finds payments to those addresses that are still in the mempool: each is checked with SPV, answered with its own BEEFValidationResultEvent, and counted in ImportCompleteEvent.unminedPayments. A transaction whose lock time is still in the future is left out.
  • lockKeyWifs (since 5.12.0, with xpriv) are private keys outside the account that HODLocker coins may be locked to. The wallet takes them before the scan, so coins locked to them are found as its own and can be unlocked. Derive them from the seed the account came from.
  • Restored coins (since 5.17.0) are available at once only when their merkle proof checks against a header the wallet holds. Otherwise they are pending until the header arrives. See What waits for older headers.

Derives a fresh address no payment has used yet, on the receive chain (purpose 'receive', the default) or the change chain ('change'). With includePublicKey: true the reply carries the key’s public key, which a counterparty needs for P2PK outputs or a multisig.

Field Type Required
walletId String yes
label String? no
purpose String? no
includePublicKey bool no (default false)

Reply: AddressGeneratedEvent, once the read model holds the address, so a payment to it validates at once. Default timeout: 1 minute.

Adds an address the wallet watches but holds no key for. Funds at it count in watchOnlyBalance, not in the spendable balance.

Field Type Required
walletId String yes
address String yes
scriptType String yes
label String? no

Reply: WatchAddressRegisteredEvent. Default timeout: 1 minute.

Creates an invoice and issues its receive addresses. Give amount for a simple invoice, or outputs for a multi-output one. expiresIn wins over expiresInSeconds.

Field Type Required
walletId String yes
amount BigInt? no
outputs List<InvoiceOutputSpec>? no
description String? no
expiresIn Duration? no
expiresInSeconds int? no
invoiceMetadata Map<String, dynamic>? no
numberOfAddresses int no (default 1)

Reply: InvoiceCreatedEvent. Default timeout: 1 minute.

With amount and numberOfAddresses above 1, the amount is split evenly over the addresses, and since 5.16.0 the last address takes the remainder.

Builds and signs a payment for an invoice and returns it as BEEF. It does not broadcast: you hand the BEEF to the recipient, who normally broadcasts it. Until the network has it, the payment is a deferred payment and its inputs stay held. deadline makes the wallet reclaim the payment by itself if it is still outstanding then.

Field Type Required
walletId String yes
invoiceId String yes
addresses List<String> yes
amount BigInt yes
outputs List<InvoiceOutputSpec>? no
changeAddress String? no
paymentMetadata Map<String, dynamic>? no
counterpartyMarker String? no
memo String? no
deadline DateTime? no
privacy PaymentPrivacy? no

Reply: PaymentReadyEvent with beefBytes, txid, amountPaid and changeAmount. Default timeout: 3 minutes.

Without outputs, amount is split evenly over addresses. Since 5.16.0 the last address takes the remainder; before, it went to the fee, and the payee was paid short.

Receives a counterparty’s payment: checks the BEEF structurally and with SPV against the local headers, records it, and submits a transaction that carries no proof of its own to ARC. type42Derivations is the payer’s hand-off for a payment to one of this wallet’s anchor keys.

Field Type Required
walletId String yes
beefHex String yes
invoiceId String? no
fromCounterparty String? no
memo String? no
type42Derivations List<Type42Derivation> no (default const [])

Reply: BEEFValidationResultEvent. If the proofs name a block header the wallet has not synced, the reply has awaitingHeader: true and a second event follows when the header arrives, after a restart too. If the payment pays an invoice, InvoicePaidEvent follows. Default timeout: 5 minutes.

Since 5.13.0, when ARC accepts the payment but is still taking it to the network (Arcade’s RECEIVED), a PaymentAcceptedEvent comes before the reply, so you can answer the payer sooner.

After the reply, the wallet keeps following the payment with ARC. Since 5.16.0, a payment ARC does not know is submitted again, at most every 30 minutes (ARCActor’s unknownResendInterval), and a payment ARC reports REJECTED has its outputs voided. Nothing is deleted: a later SEEN_ON_NETWORK or merkle proof makes the outputs available again.

Records an outgoing transaction you built and broadcast outside the coordinator, and marks the inputs in spentUtxoKeys (txid:vout) spent.

Field Type Required
walletId String yes
txid String yes
rawHex String yes
totalInputSats int yes
totalOutputSats int yes
fee int yes
numInputs int yes
numOutputs int yes
txVersion int yes
txLockTime int yes
spentUtxoKeys List<String> yes
recipientAddresses List<String> yes
paymentAmount int yes
changeAddress String? no
changeAmount int? no
counterpartyMarker String? no
memo String? no

Reply: TransactionRecordedEvent, once the read model holds the transaction. A refusal is the reply’s failure. Default timeout: 1 minute.

Imports a transaction that is already mined. The BEEF must carry the merkle proof of its last transaction; one without is refused. Use delegatedIndices or type42Derivations to take over a payment that a service or a payer received for this wallet and handed over with ExportTransactionQuery. A counterparty’s unmined payment goes through ValidateBEEFCommand instead.

Field Type Required
walletId String yes
beef List<int> yes
fromCounterparty String? no
memo String? no
delegatedIndices List<int> no (default const [])
type42Derivations List<Type42Derivation> no (default const [])

Reply: TransactionImportedEvent, once the read model holds the transaction. SPVValidationResultEvent is emitted on the way. Default timeout: 5 minutes.

Broadcasts every transaction in a BEEF that has no merkle proof yet to ARC, in dependency order. You need it for self-payments (token issuance, an identity anchor) where no counterparty will broadcast for you.

Field Type Required
walletId String yes
beefHex String yes
txid String yes

Reply: BEEFSettledEvent with submittedCount, skippedCount, failedCount and the failed txids. Default timeout: 3 minutes.

Releases the UTXOs held by a reservation, so they can be spent again.

Field Type Required
walletId String yes
reservationId String yes

Reply: UTXOsReleasedEvent, once the read model shows the release. releasedUtxoKeys is empty when the reservation held none. A refusal is the reply’s failure. Default timeout: 1 minute.

Splits spendable UTXOs into smaller ones whose values follow Benford’s law, for privacy. utxoKeys picks the UTXOs (txid:vout); null takes any, largest first. targetUtxoCount defaults to 5 pieces per UTXO when null.

Field Type Required
walletId String yes
targetUtxoCount int? no
maxUtxosToSplit int? no
utxoKeys List<String>? no
partSats BigInt? no
minPartSats BigInt? no

Reply: UTXOSplitCompleteEvent with one SplitTransactionOutcome per split transaction. UTXOSplitStartedEvent is emitted first when the split can start. Default timeout: 15 minutes.

Runs a script plugin’s funding provisioning: it builds a tree of transactions (a split and earmarks) from one large UTXO, and the coordinator records each transaction and registers the earmarked UTXOs.

Field Type Required
walletId String yes
pluginId String yes
pluginParams Map<String, dynamic> yes

Reply: ProvisioningCompleteEvent. Default timeout: 3 minutes.

Pays a transaction with one OP_RETURN output per file hash, to timestamp the hashes on chain.

Field Type Required
archiveId String yes
walletId String yes
fileHashes List<String> yes
archiveTitle String? no

Reply: TimestampCompleteEvent with the archiveId and the transactionId, after ARC answers the broadcast. A timestamp ARC refused records nothing. Default timeout: 6 minutes.

Asks the configured data source whether outputs the wallet holds were spent by someone else; by default every unspent plugin output (token). A spender that is mined and proven against the local headers is recorded in the wallet.

Field Type Required
walletId String yes
utxoKeys List<String>? no

Reply: ForeignSpendsCheckedEvent, once the read model shows what was recorded. Default timeout: 15 minutes.

A payment built by PayInvoiceCommand is a deferred payment until the network has it: the wallet holds its inputs, and no other payment can take them. List them with GetDeferredPaymentsQuery. via chooses where a network call goes: DeferredPaymentNetworkSource.arc (default), .dataSource or .arcThenDataSource.

Broadcasts a deferred payment yourself, for example when the recipient is slow to. Its unconfirmed ancestors are submitted first. Safe to repeat: a transaction the network already has is reported as such.

Field Type Required
walletId String yes
txid String yes
via DeferredPaymentNetworkSource no (default DeferredPaymentNetworkSource.arc)

Reply: DeferredPaymentBroadcastEvent. Default timeout: 3 minutes.

Asks the network about a deferred payment now instead of waiting for the periodic scan. A MINED answer confirms the payment only when its merkle proof matches the local headers.

Field Type Required
walletId String yes
txid String yes
via DeferredPaymentNetworkSource no (default DeferredPaymentNetworkSource.arc)

Reply: DeferredPaymentStatusEvent. Default timeout: 3 minutes.

Cancels an outstanding deferred payment and releases its inputs. The network is checked first; the cancellation is refused when the network knows the transaction, or when the check fails unless force is true. Cancelling does not revoke the signed transaction the recipient holds: use ReclaimDeferredPaymentCommand for that.

Field Type Required
walletId String yes
txid String yes
reason String? no
via DeferredPaymentNetworkSource no (default DeferredPaymentNetworkSource.arc)
force bool no (default false)

Reply: DeferredPaymentCancelledEvent with the releasedUtxoKeys. Default timeout: 3 minutes.

Spends the inputs a deferred payment holds back to this wallet and broadcasts that transaction, which makes the recipient’s copy unspendable. It is immediate and irreversible, and first seen wins: if the recipient’s copy reached the network first, the reclaim is rejected.

Field Type Required
walletId String yes
txid String yes
via DeferredPaymentNetworkSource no (default DeferredPaymentNetworkSource.arc)
reason String? no

Reply: DeferredPaymentReclaimedEvent. Default timeout: 6 minutes.

Replaces a deferred payment the wallet signed only in part with rawHex, the same transaction carrying the counterparty’s signatures. Nothing is broadcast.

Field Type Required
walletId String yes
txid String yes
rawHex String yes

Reply: DeferredPaymentCompletedEvent with the completedTxid. Default timeout: 1 minute.

Channel commands are handled by ChannelP2PAdapter, which answers a channel’s requests of one kind in the order they were made. Messages for the peer arrive as P2PMessageToSendEvent, which your app delivers on its own transport. A step of an open or close that fails, and the counterparty’s channel_reject or channel_error during an open, is an ErrorEvent with source ChannelP2PAdapter that names the request, so ask() throws CoordinatorFailure. When CoordinatorFailure.stillSent is true, the failure is not final: the client still sends what failed, and an event that answers no request reports it if it lands. A coordinator built without channel events answers every channel command with an ErrorEvent. Payment channels explains the flow.

Opens a payment channel to serverPeerId, funded with fundingAmountSats and refundable after lockTimeDurationSeconds.

Field Type Required
walletId String yes
serverPeerId String yes
fundingAmountSats int yes
lockTimeDurationSeconds int yes
context String? no
counterpartyMarker String? no

Reply: the channel’s ChannelOpenedEvent, once the server has opened the channel and its channel_opened arrived. P2PMessageToSendEvents for the peer (channel_request, later channel_open) are emitted on the way, and channel_open is resent until the server answers. A channel_error refusing the open is an ErrorEvent with stillSent true while channel_open is still resent; a funding that can never be mined is one with stillSent false. Default timeout: 5 minutes.

Accepts a channel request you received as ChannelRequestReceivedEvent; copy its fields.

Field Type Required
channelId String yes
walletId String yes
clientPeerId String yes
clientPubKey String yes
clientAddress String yes
fundingAmountSats int yes
lockTimeUnix int yes
counterpartyMarker String? no

Reply: ChannelAcceptedEvent, once the acceptance is journaled and channel_accept is handed to your transport. The channel opens later, when the client funds it (ChannelOpenedEvent). Default timeout: 1 minute.

Rejects a channel request.

Field Type Required
channelId String yes
reason String? no

Reply: ChannelRejectedEvent. clientTold is true when the request was held and channel_reject was handed to your transport. Default timeout: 1 minute.

Pays amountSats over an open channel.

Field Type Required
channelId String yes
walletId String yes
amountSats int yes
purpose String? no
invoiceId String? no

Reply: the payment’s ChannelPaymentEvent, with the new sequence and balances, once the server acknowledges it (payment_ack). ChannelPaymentPendingEvent is emitted when the payment is signed and sent. A payment not acknowledged within ChannelTiming.confirmWithin (default 20 seconds) is an ErrorEvent with stillSent true: it is still resent and goes with the close. A refused payment (for example more than the client’s balance, or one the server refuses) is an ErrorEvent, and is not resent. Default timeout: 1 minute.

Closes a channel cooperatively.

Field Type Required
channelId String yes
reason String? no

Reply: ChannelClosedEvent, with what the settlement pays each side. The client’s channel_close carries its latest payment and is resent until the server’s channel_closed arrives. A close that fails (for example a settlement ARC did not take) is an ErrorEvent. Default timeout: 5 minutes.

Records that a channel’s lock time has passed. observedBy is 'client' or 'server'. It records the refund without broadcasting it.

Field Type Required
channelId String yes
observedBy String yes
settlementOrRefundTxId String? no

Reply: ChannelExpiredEvent. A failed expiry is the reply’s failure. Default timeout: 3 minutes.

Broadcasts the refund of an expired channel through ARC (non-cooperative close) and records the money back in the wallet. Leave refundTxHex null to use the signed refund the channel holds.

Field Type Required
channelId String yes
refundTxHex String? no

Reply: ChannelRefundClaimedEvent. Default timeout: 3 minutes.

Broadcasts again the funding transaction of a channel whose funding broadcast failed. The transaction is read from the channel’s journal; it is safe to repeat. A channel whose funding was already sent is refused.

Field Type Required
channelId String yes

Reply: ChannelFundingRetriedEvent. On success channel_open is sent, and ChannelOpenedEvent follows once the server opens the channel. Default timeout: 3 minutes.

Sends channel_open again, and goes on resending it until the server’s channel_opened, for a channel this node is the client of whose funding was sent, or that is open. Nothing is journaled. A channel whose funding can never be mined is refused.

Field Type Required
channelId String yes

Reply: ChannelOpenResentEvent. Default timeout: 1 minute.

libspiffy owns no transport. Your app carries bytes between peers, hands what arrives to the coordinator, and sends what the coordinator emits as P2PMessageToSendEvent.

Hands an inbound peer message to the coordinator. proof_request and proof_response go to the merkle-proof protocol; every other messageType goes to the channel protocol. A channel message from a peer whose channel messages were held back (ChannelPeerAwayEvent) also has them sent again.

Field Type Required
fromPeerId String yes
messageType String yes
payload Map<String, dynamic> yes

Reply: none — tell only. What follows depends on the message: channel events, AncestorProofResponseEvent or AncestorProofRequestReceivedEvent.

Tells the coordinator your transport could not deliver a P2PMessageToSendEvent. Copy the event’s fields. For a channel message still waiting for its answer, the client sends it again after ChannelTiming.resendAfter, sooner than its resend would come; once per wait.

Field Type Required
toPeerId String yes
messageType String yes
payload Map<String, dynamic> yes
error String? no

Reply: none — tell only.

Tells the coordinator a peer is reachable again, after a ChannelPeerAwayEvent named it. Every channel message held back for it is sent again at once, and the resend waits start over.

Field Type Required
peerId String yes

Reply: none — tell only.

Asks the counterparty who sent you txid for a fresh BEEF, when a reorg took an ancestor’s block off the active chain and the outputs can no longer be spent. The peer asked is the counterparty marker recorded on the transaction.

Field Type Required
walletId String yes
txid String yes
ancestorTxids List<String> no (default const [])

Reply: AncestorProofRequestedEvent. A P2PMessageToSendEvent with messageType proof_request goes out for your transport. The peer’s answer arrives later as AncestorProofResponseEvent. Default timeout: 1 minute.

Since 5.11.0 a wallet can lock coins until a block height with a HODLocker output, and unlock them after it. A locked coin counts in lockedBalance, not in totalBalance. A seed-phrase import finds locked coins again. The guide is Locked coins.

Locks amount satoshis of the wallet’s coins until block lockHeight: a HODLocker output to a fresh receive address of the wallet, paid like any payment (coin selection, fee, change), recorded and broadcast. lockHeight must be above the wallet’s current chain height and below 500,000,000; a larger value would be a time, which the contract refuses.

Field Type Required
walletId String yes
amount BigInt yes
lockHeight int yes

Reply: CoinsLockedEvent, after ARC answers the broadcast. Default timeout: 6 minutes.

Spends a locked coin back to a fresh address of the wallet, less the fee, and broadcasts it. Refused before anything is built while the chain is below the coin’s lock height, and when the coin is worth no more than the unlock’s fee.

Field Type Required
walletId String yes
utxoKey String yes

Reply: CoinsUnlockedEvent, after ARC answers the broadcast. Default timeout: 6 minutes.

Since 5.12.0. Quotes the fee of unlocking a coin whose HODLocker locking script is lockingScriptLength bytes: ARC’s policy rate on HodlockerLock.unlockSize(lockingScriptLength). An unlock carries the whole locking script, about 1,300 bytes, so a coin of a few satoshis can cost more to unlock than it holds. Nothing is built.

Field Type Required
lockingScriptLength int yes

Reply: UnlockFeeQuotedEvent with the fee in satoshis. Default timeout: 3 minutes.

These commands use the wallet’s anchor keys. An anchor key is issued per anchorContext (opaque bytes, for example an identity key followed by a rotation epoch). A wallet created from an xpub or a WIF has no anchor key.

Returns the wallet’s anchor public key for a context. Payers derive type-42 destinations from it to pay the wallet while it is offline. An empty context is refused.

Field Type Required
walletId String yes
anchorContext List<int> yes

Reply: AnchorPublicKeyEvent with publicKey (compressed, hex). Default timeout: 1 minute.

Signs SHA-256 of message with the anchor key for a context, to bind that anchor to an identity. The wallet hashes the message itself.

Field Type Required
walletId String yes
anchorContext List<int> yes
message List<int> yes

Reply: AnchorSignedEvent with signatureDer (hex, RFC 6979, low S). Default timeout: 1 minute.

Runs a BRC-100 key operation (request) with a BRC-42 child of the anchor key for a context. The private keys stay in the wallet.

Field Type Required
walletId String yes
anchorContext List<int> yes
request Brc100KeyRequest yes

Reply: Brc100KeyOperationEvent with the result. Default timeout: 1 minute.

Derives a type-42 address for paying the holder of anchorPublicKey. Pass the recipient’s anchorContext when it published one. Without invoiceNumber the wallet makes up a BRC-29 one.

Field Type Required
walletId String yes
anchorPublicKey String yes
anchorContext List<int>? no
invoiceNumber String? no
payerAnchorContext List<int>? no

Reply: Type42DestinationEvent with the destination: the address, the hand-off the payee imports the payment with, and the tweak that lets someone holding the anchor public key check the payment reached it. Default timeout: 1 minute.

Since 5.5.0. Records type-42 keys derived from the wallet’s anchor keys as the wallet’s own: the wallet then signs with them (a script plugin gets one with PluginTransactionRequest.keyFor) and credits outputs that pay them. Use it for keys the wallet uses for itself, such as the key a token it makes is locked to; a hand-off received with a payment records its addresses through ImportTransactionCommand. A derivation from an anchor the wallet never issued is refused. Recording a key again changes nothing. See Build a token plugin.

Field Type Required
walletId String yes
derivations List<Type42Derivation> yes

Reply: Type42AddressesRecordedEvent with each key’s addresses, in order, once the read model holds them all. Default timeout: 1 minute.

Once recorded, a key’s address is a payment spend key: Brc100KeyOperationCommand runs only getPublicKey with it.

Since 5.9.0. Hands a wallet back the type-42 destinations it derived as a payer, so it never uses their payer keys again. A wallet imported again from its phrase starts its payer keys at 0; pass the derivations your app’s payment records kept. The wallet derives each address itself. A derivation whose payer key is not one of the wallet’s own is skipped, not refused.

Field Type Required
walletId String yes
derivations List<Type42Derivation> yes

Reply: Type42DestinationsRecordedEvent with the addresses recorded, the number skipped, and payerKeysUsed, the index of the next payer key. Default timeout: 1 minute.

Since 5.14.0. Signs message as a Bitcoin Signed Message with the wallet key whose public key hashes to pubkeyHash (40 hex characters). Use it to prove the wallet holds an address’s key, for example the owner of a token held there. The wallet adds the message prefix and hashes the message itself, so a key never signs a digest the caller chose; name the message’s purpose in it. A hash the wallet holds no key for is refused, and so are watch-only wallets and a WIF wallet whose one key is another.

Field Type Required
walletId String yes
pubkeyHash String yes
message List<int> yes

Reply: MessageSignedEvent with the publicKey and the compact, base64 signature, as dartsv’s Message.sign makes it and Message.verifyFromAddress checks it. Default timeout: 1 minute.

Stores block headers from a source of your own. They are validated and placed on the header chain like headers from a peer.

Field Type Required
headers List<Map<String, dynamic>> yes
source String no (default 'external')

Reply: BlockHeadersStoredEvent with source set to the command’s source. Every StoreHeadersCommand is answered, also when its batch fails, with nothing stored. Default timeout: 1 minute.

Since 5.5.0. Broadcasts a fully signed transaction you hold through ARC: one the wallet did not build and has no command for, such as a payment channel’s settlement. It is not recorded in the wallet; what it pays the wallet arrives as any receive does. A transaction that does not reach ARC is queued for another submission.

Field Type Required
walletId String yes
txHex String yes

Reply: TransactionBroadcastEvent, ARC’s answer for the txid. A hex that is not a transaction is refused. Default timeout: 3 minutes.

Since 5.5.0. Asks ARC again about the wallet’s transactions that wait for a merkle proof, as a new block header does.

No fields.

Reply: none — tell only. What it finds arrives as the usual confirmation events.

Shuts the coordinator down: it cancels its subscriptions and closes the event stream. To stop the whole system, call LibSpiffyActorSystem.shutdown() instead.

No fields.

Reply: none — tell only. A WalletStatusEvent with status shutdown is emitted, then the event stream closes.

ChannelP2PReceived is gone: deliver inbound messages as P2PMessageReceived.

RefreshWalletCommand is gone: it refreshed nothing. To read a wallet’s current state, send the queries, or follow BalanceUpdatedEvent with libspiffy.coordinator.on<BalanceUpdatedEvent>(walletId: ...).