ord icon indicating copy to clipboard operation
ord copied to clipboard

feat: burn rune through forcing Cenotaph

Open nghuyenthevinh2000 opened this issue 10 months ago • 2 comments

fixes: #3640

add a command to burn all specific runes in a wallet

Logic

  1. Add Burn impl in subcommand/wallet: forcing burn through Cenotaph EdictOutput Flaw

Test

  1. Add a happy case test burning_rune_works():
  • send 100 rune to address B
  • burn rune in address A (which contains 900 rune), confirming that balances only return 100 rune
  • confirm that rune info return burned amount of 900

I think it can be fine - grained further to burn exact amount in a wallet through protocol recognized burn addresses. However, changes to updater are required to recognize the burn addresses. Changes to updater can be a lenghtly review process as it touches the core, so probably in another PR. Which burn addresses can be a topic for debates @raphjaph

However, in this PR, I still include burn address constants for reviews

// satoshi first block address
 pub const MAINNET_BURN_ADDRESS: &'static str = "1FvzCLoTPGANNjWoUo6jUGuAG3wg1w4YjR";
 // just a random testnet address
 pub const TESTNET_BURN_ADDRESS: &'static str = "tb1prqr6lpxeqcyfff8n7c748ad7szyh8hwmf9nly598r5uqewkm4kms0nevay";
 // just a random regnet address
 pub const REGNET_BURN_ADDRESS: &'static str = "bcrt1pyf99p0qrt8dsx8a8hnd7edzpnnpsndf9ce6hhx55s9f9v84e48eqdlyd6n";

nghuyenthevinh2000 avatar Apr 25 '24 04:04 nghuyenthevinh2000

I implemented a generic burn in #3437. Can extend that to support runes?

onchainguy-btc avatar Apr 29 '24 09:04 onchainguy-btc

I'll have a look at generic burning first (#3437) but probably we don't want to do protocol level burning through cenotaphs but rather by sending to an OP_RETURN.

raphjaph avatar Jun 28 '24 16:06 raphjaph