githubEdit

Input Redemption

Ty Everett ([email protected])

Abstract

We define a mechanism by which BRC-1 applications can denote UTXOs to be unlocked and redeemed by wallets as part of new Bitcoin transactions. We extend the message format defined by BRC-1 with information about the inputs requested by the application, including all information needed for a wallet to check the veracity of any inputs being redeemed.

Motivation

BRC-1 defines a mechanism for an application to request the creation of a Bitcoin transaction by a wallet, but it is incomplete without a way for applications to consume and use tokens that previously existed. Allowing applications to unlock and redeem inputs as part of their transactions also facilitates their ability to update, extend or delete assets that are tokenized within Bitcoin UTXOs.

Status Note

BRC-4 is historical. Current wallets consume application-provided inputs through BRC-100 createAction with inputBEEF, inputs[].outpoint, inputs[].unlockingScript or inputs[].unlockingScriptLength, inputs[].inputDescription, and optional sequenceNumber. Extended BRC-8 input envelopes are deprecated for current implementations.

Specification

We extend the BRC-1 Transaction Creation Request message with an additional field, the inputs field. This is an object whose keys are the TXIDs of transactions that contain outputs which are to be spent as part of this transaction, and whose values comprise extended BRC-8 transaction envelopes.

In addition to the normal envelope fields, we specify that these input envelopes contain an additional field called outputsToRedeem, which is an array of objects. Each of the objects comprises an output from the subject transaction that is to be redeemed and used as input to the transaction being requested by the application.

We specify that each of the objects in the array contains index and unlockingScript. The index value is an integer that denotes which output to redeem from the transaction, and the unlockingScript comprises a BRC-14 hex-formatted input script.

We further specify that each of the elements in each of the outputsToRedeem arrays may contain an additional spendingDescription string that describes the redemption of the tokens being used.

Example

Here is an example of a Transaction Creation Request object that contains an input:

Implementations

This functionality is implemented by current bsv-blockchain/ts-sdk BRC-100 wallet interfaces and bsv-blockchain/wallet-toolbox storage/action processing.

Last updated

Was this helpful?