Burn
Asset burning on Liquid allows you to provably destroy units of an asset, reducing the total supply. This is useful for various purposes such as token buybacks, reducing inflation, or implementing deflationary mechanisms.
When you burn an asset, the units are permanently removed from circulation and cannot be recovered. The burn operation creates a special output in the transaction that destroys the specified amount of the asset.
To burn an asset, use TxBuilder::add_burn() before calling finish(). The asset must be owned by the wallet generating the burn transaction.
The add_burn() method takes the following arguments:
satoshi(u64): The number of units (in satoshis) of the asset to burn. Must be greater than 0.asset(AssetId): The ID of the asset you want to burn. This is obtained from the original issuance transaction or from your wallet's balance.
Rust
let burn_asset = 50;
let builder = wollet.tx_builder();
let mut pset = builder.add_burn(burn_asset, asset_id)?.finish()?;
let signatures_added = signer.sign(&mut pset)?;
let _ = wollet.finalize(&mut pset)?;
let tx = pset.extract_tx()?;
let txid = client.broadcast(&tx)?;
Python
burn_asset = 50
builder = network.tx_builder()
builder.add_burn(burn_asset, asset_id)
unsigned_pset = builder.finish(wollet)
signed_pset = signer.sign(unsigned_pset)
finalized_pset = wollet.finalize(signed_pset)
tx = finalized_pset.extract_tx()
txid = client.broadcast(tx)
Next Steps
After burning an asset, you can:
- Reissue the asset if you have reissuance tokens available
- Send the remaining asset to other addresses using regular transaction creation
Previous: Reissuance