lightninglabs / taproot-assets

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)
MIT License
457 stars 110 forks source link

[bug]: Unable to burn freshly minted asset #582

Closed Liongrass closed 11 months ago

Liongrass commented 11 months ago

Background

I minted an asset, and now am trying to burn it with tapcli assets burn --asset_id 9cfada48cd7df34e61c4a29230aaf9f37e44b5381639d7bed667cd2e60565392 --amount 50

Your environment

{
    "version":  "0.3.0-alpha.rc1 commit=v0.3.0-alpha.rc1-10-ga67a085",
    "lnd_version":  "0.17.0-beta",
    "network":  "testnet3"
}

Steps to reproduce

Tell us how to reproduce this issue. Please provide stacktraces and links to code in question.

Logs:

2023-10-13 21:09:36.159 [INF] FRTR: Identified 1 eligible asset inputs for send of 50 to 9cfada48cd7df34e61c4a29230aaf9f37e44b5381639d7bed667cd2e60565392
2023-10-13 21:09:36.181 [INF] FRTR: Selected 1 asset inputs for send of 50 to 9cfada48cd7df34e61c4a29230aaf9f37e44b5381639d7bed667cd2e60565392
2023-10-13 21:09:36.189 [ERR] RPCS: [/taprpc.TaprootAssets/BurnAsset]: error funding burn: input commitment does not contain asset_id=9cfada48cd7df34e61c4a29230aaf9f37e44b5381639d7bed667cd2e60565392: send: Input does not contain requested asset

the output of tapcli assets list

{
    "assets":  [
        {
            "version":  "ASSET_VERSION_V0",
            "asset_genesis":  {
                "genesis_point":  "8df6117d62faf9ac6ed220b3ba6113756041f558b959825af2f8d3675f960045:1",
                "name":  "leocoin",
                "meta_hash":  "90313a0aaa38d15ae430d183ed46e8ed76ebabcc9ff88340ce2923a767b7dc43",
                "asset_id":  "835fb596dedfe29aa4c18a3013f59e221061ba9772122428e092ec25958d145b",
                "output_index":  0,
                "version":  0
            },
            "asset_type":  "NORMAL",
            "amount":  "21000",
            "lock_time":  0,
            "relative_lock_time":  0,
            "script_version":  0,
            "script_key":  "025db099e1f3e911493ce8b404650e1f1452f334d860d4e06c93cff8d0d0be324e",
            "script_key_is_local":  true,
            "asset_group":  {
                "raw_group_key":  "03430142d19c7aa03d40e7ff0d30ede20c7c23792eee04822a42a56d6e06244f67",
                "tweaked_group_key":  "037c8ce3461cbdb3fa85a775a5bc231d9302af8ed1a197be91b9cf41af984c54ce",
                "asset_witness":  "014012df0005835aa758dd2c727e03e41dedf26f4eddd280c113cde416ddea1c60fe7c3588e5531da9be20b19f37171ff5a8a64e8279e986e4af740ea559bc5dca52"
            },
            "chain_anchor":  {
                "anchor_tx":  "020000000001014500965f67d3f8f25a8259b958f54160751361bab320d26eacf9fa627d11f68d0100000000ffffffff02e803000000000000225120149c1ad1c20daed322c1847d7fdcaa1de77a6019ee7efcd661d931a525beae17fa087a000000000022512024623341e8fb96501c6f974ebcfe7e707b2abe64f45282f6668484d2f51f4e980140e79228eb5825ef1dcb163b77325bb486ceab62eedb7aee88952faa270c964221c79569202fb2553802f1f7be3bded7bd556712d5ef3ccf17caf3d1fbb587023e00000000",
                "anchor_txid":  "4840cc4dbf0c611abd2bf6fd431aeacb7f35f06291d8171f94fd965941fd2ac3",
                "anchor_block_hash":  "0000000000000042db928c8c178cd0ddbbeb6212fdc04a167e28a919c6d3654c",
                "anchor_outpoint":  "4840cc4dbf0c611abd2bf6fd431aeacb7f35f06291d8171f94fd965941fd2ac3:0",
                "internal_key":  "02bec52cc2b9c40c2643cf712cc4b223deacf1f8204a2bc57ce4017199a8657ae6",
                "merkle_root":  "5095d523c078ba4b851277d74836a742d7dc6a0fb85305acbb5f52ff0ac55259",
                "tapscript_sibling":  "",
                "block_height":  0
            },
            "prev_witnesses":  [],
            "is_spent":  false,
            "lease_owner":  "",
            "lease_expiry":  "0",
            "is_burn":  false
        },
        {
            "version":  "ASSET_VERSION_V0",
            "asset_genesis":  {
                "genesis_point":  "8bc4b17043b8d9165743accad55b8c8df6627b5d86341109f7f39a86eec07918:1",
                "name":  "beefbux",
                "meta_hash":  "0000000000000000000000000000000000000000000000000000000000000000",
                "asset_id":  "9cfada48cd7df34e61c4a29230aaf9f37e44b5381639d7bed667cd2e60565392",
                "output_index":  0,
                "version":  0
            },
            "asset_type":  "NORMAL",
            "amount":  "100",
            "lock_time":  0,
            "relative_lock_time":  0,
            "script_version":  0,
            "script_key":  "02256de46479e6e46869242401f5ea630d6a39e8c8eb5fea06c78fd257555414f8",
            "script_key_is_local":  true,
            "asset_group":  {
                "raw_group_key":  "02b397e289e828ea33ad15acb2253a7a0680e9b15e75c0315802ab7fdd465b3802",
                "tweaked_group_key":  "02671c771a383a34ac8c1872f71323a745db2ad87171590f4edd682568e453e3b3",
                "asset_witness":  "014001bfa9894c63f54f952a47e11e55215752f7d440575d7b05a60c74aad901754ae1e6412664cad0ed6f4040d3b539f8f71b22b0616739e1e0bc0078cfaa5fa1d1"
            },
            "chain_anchor":  {
                "anchor_tx":  "020000000001011879c0ee869af3f7091134865d7b62f68d8c5bd5caac435716d9b84370b1c48b0100000000ffffffff02e803000000000000225120e1a63c4f6f78d3cd29a5f743329e842198db9f011a5e36d1451247000f23c0d4cd112d0100000000225120f033f900443b347ce0b4110d287351987f99bd5e543dd3f5ed39ba45185128f501400bbc270e5ece3ff0d265ff8fd7315910c05aec9baa15d6c96a1e19acc88abe6a277ccc43fad5b49813816b55e1ae5de42cbfa8e411da32b54fea3e35f7c48f0e00000000",
                "anchor_txid":  "bfecde20f448263c5a604d133d5042e8f786a16ae71123f3e291c7d937fb53dd",
                "anchor_block_hash":  "000000000000001675b3e1f7ac958906fc32478132d14d8acf7729d4ef916fe9",
                "anchor_outpoint":  "bfecde20f448263c5a604d133d5042e8f786a16ae71123f3e291c7d937fb53dd:0",
                "internal_key":  "03539dfc5d425c9efdd364693f842d218e329a06b7bd40b823ff23859fb09938af",
                "merkle_root":  "e8baac237f2681b64c2a0c9fcea35d8d7253d09d68c9aa092d2d2a3989013840",
                "tapscript_sibling":  "",
                "block_height":  0
            },
            "prev_witnesses":  [],
            "is_spent":  false,
            "lease_owner":  "",
            "lease_expiry":  "0",
            "is_burn":  false
        }
    ]
}

Expected behavior

Tell us what should happen

Actual behavior

Tell us what happens instead

kulisekf commented 11 months ago

I found the same problem - cannot burn asset. In my case, I followed the same procedure - mined the asset, waited until it was mined within the block and then I wanted to burn 1/2 amount. In my log, the amount that I wanted to burn was "sent" to some address, but I didn't get any error, the transaction was broadcast to the network and mined. After burn, command assets list is empty (I also lost what I didn't want to burn), the asset record in assets balances and universe roots are still fully populated (it contains the amount before burning).

guggero commented 11 months ago

@kulisekf that sounds like a different issue. The "some address" you mention is actually the provable burn address for that asset. So it sounds like it either worked or you ran into something else. Can you please attach the logs of your daemon? Also, the full output of tapcli assets list --show_spent and tapcli assets transfers would be useful, thanks (can upload text files to GitHub directly).