How Arkade’s intent system coordinates user participation in batch swaps using BIP322
Receiver
format (onchain address vs. offchain pubkey), and the IntentMessage
that captures execution parameters and the intent’s validity window.
Intent structure
Intent domain
is a user-submitted presigned Bitcoin transaction that:IntentId
(UUID)Inputs
(VTXOs, UTXOs, or expired coins)Outputs
(via Receivers
). Either:
OnchainAddress
)PubKey
to create new VTXOs)Proof
of ownership of those funds via a bip322
signatureMessage
(bip322 message
) with intent detailsReceiver Structure
Receivers
is defined via an Amount
, an OnchainAddress
and a PubKey
(of which at least one must be present during Intent submission. Those are used to construct Arkade transaction outputs or direct onchain payments. IntentMessage Format
IntentMessage
contains intent details in JSON structure:Type
indicates if the intent is for renewal or ownership proof to delete anotherInputTapTrees
is the revealed Taproot tree of all inputs of the intent. Revelation occurs like witness data in BitcoinOnchainOutputIndexes
: Indicates which outputs become UTXOs; others are VTXOsValidAt
: Time (seconds) when the intent becomes valid; 0 = valid right awayExpireAt
: Time (seconds) when the intent expires; 0 = no expiryCosignersPublicKeys
: Public keys signing the VTXO tree; typically one, but can be more to support flexible user needsGetEventStream
) is a server-side streaming RPC method in the ArkService
) that provides real-time batch processing coordination events to clients including batch start, finalization, and failure notifications. The server uses this stream to indicate the next required action and corresponding API call. The full Intent lifecycle is as follows:
Code example: BIP322 signature implementation from the TS-SDK
create
function takes a string message corresponding to the associated action described below (“Register” or “Delete”).RegisterIntentRequest
which contains a Bip322Signature
field and an intent message:Code example: RegisterIntentRequest
Intent message format
InputTapTrees
- Taproot trees for spent inputsOnchainOutputIndexes
- Which outputs should be considered onchainValidAt
/ExpireAt
- Timestamp validity windowsCosignersPublicKeys
- Required for offchain outputsExample: intent message
RegisterIntentResponse
containing an intent_id
string for tracking.BatchStartedEvent
containing their intent ID hash, clients must call ConfirmRegistration
with a ConfirmRegistrationRequest
containing the intent_id
to confirm participation. The server responds with an empty ConfirmRegistrationResponse
.DeleteIntent
method accepts a DeleteIntentRequest
with a Bip322Signature
proof that demonstrates ownership of any input VTXOs from the original intent. The server responds with an empty DeleteIntentResponse
upon successful deletion.Code example: delete from Typescript SDK
recoverVtxos
)redeemNotes
)