UTXO Transfer

In Bitcoin, transactions are processed using OP encoding. To enhance clarity on the Avalanche network, we utilize the JSON inscription format. The transaction data should be similar to that of BTC, but certain keys have been modified to optimize gas consumption.

One notable difference between the transaction mode and Account mode JSON is the alteration of the "to" field to "vin" and "vout". These fields explicitly specify transaction details, and for each input, "txid" and "vout" need to be utilized.

Compared to the Account mode, this processing introduces a more transparent data verification approach within the block, ensuring greater clarity and security.

The transfer is the same as the above event, sent to address 0x0000000000000000000000000000000000000000, and then you can choose to send to an unlimited number of recipients, it only needs one gas.

When transferring, we need to specify some required fields.

KeyRequiredDescription

p

yes

protocol name asc-20

op

yes

transfer

tick

yes

same as deployment.

vin

yes

array object with "txid" and "vout" fields. txid is transaction hash and vout is the transaction index.

vout

yes

array object, with "amt" and "scriptPubKey" fields. amt is the quantity to transfer. scriptPubKey "addr" is th the recipient address must start with 0x, and the length is appropriate, otherwise the entire transaction is invalid.

This is example:

// Transfer
{
    "p":"asc-20",
    "op":"transfer",
    "tick":"aval",
    "vin":[{"txid":"0x000","vout":"0"}],
    "vout":[{"amt":"2","scriptPubKey":{"addr":"0x000"}}]
}

Last updated