How to transfer BRC-20 token from one wallet to another in React JS

276 Views Asked by At

I am researching on this topic since long, but didn't get the solution. Looking for someone to help me with the code.

Here is what i have found till now:

  1. Its a two step process, first we can inscribe a transfer function using unisat wallet
  2. then we need to send the inscription to the other person. Now i am stuck at this step, on how to do it

Sharing some resources which might be helpful:

  1. https://github.com/bitcoinjs/bitcoinjs-lib
  2. https://github.com/unisat-wallet/wallet-sdk/blob/master/src/tx-helpers/send-inscription.ts
  3. https://domo-2.gitbook.io/brc-20-experiment/
  4. https://docs.unisat.io/dev/unisat-developer-service/unisat-inscribe/create-brc-20-transfer
1

There are 1 best solutions below

0
thks173 On

Inscription is just a special UTXO. Normally an inscription in BRC20 is an UTXO which has a value of 546 sats.

After creating inscription, sending it to other wallet is just like a normal transfering transaction with some attention to the order and value of inputs and outputs.

Here's an example

Inputs:

  • Inscription UTXO (546 sats) from the sender
  • A normal UTXO (to pay the transaction fee) from the sender

Outputs:

  • Output #1: 546 sats to the recipient (this's the inscription)
  • Output #2: change amount (after fee) to the sender

The order of the inscription needs to stay the same in the list of inputs and outputs.