unisat-dev-docs

BRC20 Balance and Transfer

This document describes all endpoints and details related to BRC20 token balance, TRANSFER inscriptions, and transfer mechanism in UniSat OpenAPI.


1. BRC20 Model Overview

BRC20 uses an account-based model rather than a simple UTXO model. Transfers are not performed by directly moving UTXOs, but by minting a TRANSFER inscription and then sending this TRANSFER inscription. Once a TRANSFER inscription is spent (transferred), it no longer holds value.

Important: You cannot simply determine whether a BRC20 token has been received by checking if a TRANSFER inscription has arrived at an address. After the first transfer, the TRANSFER inscription becomes invalid for further transfers, and the BRC20 balance is updated in the account model.


2. BRC20 Balance Endpoints


3. BRC20 Balance Structure


4. Usage Scenarios and Special Cases


5. FAQ

Q: How do I get my BRC20 token balances? A: Use /v1/indexer/address/{address}/brc20/summary to get both transferable and available balances.

Q: What is the difference between transferable and available balance? A: transferableBalance is the amount currently locked in valid TRANSFER inscriptions and can be sent. Once a TRANSFER inscription is spent, its value is removed from transferableBalance and credited to the recipient’s availableBalance, which can then be inscribed as a new TRANSFER inscription for further transfers.

Q: How do I get the current valid TRANSFER inscriptions for sending BRC20? A: Use /v1/indexer/address/{address}/brc20/{ticker}/transferable-inscriptions to get all valid TRANSFER inscriptions for a specific ticker at an address.

Q: Can I determine a BRC20 deposit by checking if a TRANSFER inscription is received? A: No. After the first transfer, the TRANSFER inscription is no longer valid, and the BRC20 balance is managed by the account model. Always use the recommended event history endpoints and balance queries for accurate results.


6. References


7. How to Verify a BRC20 Deposit (Recharge) is Successful

To accurately verify whether a BRC20 deposit (recharge) is successful, do not rely solely on checking if a BRC20 inscription has been received by an address—this can lead to false positives. Instead, use the following recommended methods based on event history:

Method 1: Query by Address

Method 2: Query by Block Height

Important Notes

Example Verification Flow

  1. User deposits BRC20 to an address and provides the txid (optional).
  2. Backend queries the appropriate event history endpoint.
  3. Backend checks for a matching event with the correct type, validity, and sufficient confirmations.
  4. Only after all criteria are met, the deposit is considered successful and credited.

8. Indexer Height and Data Lag