ord
ord copied to clipboard
feat: burn rune through forcing Cenotaph
fixes: #3640
add a command to burn all specific runes in a wallet
Logic
- Add Burn impl in subcommand/wallet: forcing burn through Cenotaph EdictOutput Flaw
Test
- 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";
I implemented a generic burn in #3437. Can extend that to support runes?
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
.