taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

[bug]: `tapcli universe roots --proof_type issuance` is returning proofs of type `transfer`

Open ZZiigguurraatt opened this issue 4 months ago • 3 comments

tapcli universe roots --proof_type issuance is returning proofs of type transfer when it should only return proofs of type issuance

002d4af395f0:/$ tapcli universe roots --proof_type issuance
{
    "universe_roots":  {
        "issuance-332b46369a74d33695f446d9ac8e1607cc4b279fdb0c7f76b4e689e4d4d0e822":  {
            "id":  {
                "asset_id":  "332b46369a74d33695f446d9ac8e1607cc4b279fdb0c7f76b4e689e4d4d0e822",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "71c2cefef82f246c726f2af078849e5f007244bc6f242ea1568460d9e3e1c00b",
                "root_sum":  "210000000000000000"
            },
            "asset_name":  "{non grouped asset",
            "amounts_by_asset_id":  {
                "332b46369a74d33695f446d9ac8e1607cc4b279fdb0c7f76b4e689e4d4d0e822":  "210000000000000000"
            }
        },
        "issuance-36c1026cf97ee29c7ea22ef370c4088d7bfb0a1f6a496e43096c084f0cc52580":  {
            "id":  {
                "group_key":  "db0099403a225cff87db6adc1d7b65997681eaecef3489fb0b9737d3481cbd8d",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "9010b43668c125e72e2212625261a3e533e0663592d28af6b1b99aa3249994fd",
                "root_sum":  "1700000"
            },
            "asset_name":  "ThirdGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "03cc0ca7866d5e848605beaa5ead575bea88b652c79ec7f41b0b43ffdf28500b":  "1700000"
            }
        },
        "issuance-708057a7f5016382de5329615749a788a83407ddb25812247b1f3cdeab1ec4f1":  {
            "id":  {
                "group_key":  "94c3ab89e49a9e063cbc3ec95e0e576c657e5e94bceb2452f2a5e65e325adde8",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "16464f71b5591878908939dc7556d12265243c96ae9d710b4b572abfcc70178b",
                "root_sum":  "3300000"
            },
            "asset_name":  "SecondGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "5a004896991d0d73d6858253d13bb76bd7206dc398db246c5e86d8e5f4f8820a":  "1700000",
                "dac4f72890b69b23048ef7d2ff999d41f49983678998d9aa5ca88d5ba294d5cb":  "1600000"
            }
        },
        "issuance-c95eea4b60ac2c90964a5b6bc54fa776068b6a51c961a1eea1870a0cd0149777":  {
            "id":  {
                "group_key":  "abf2c664f1ca9b0975a42df07c9f76b60c2e9204e741a427338f2945e3627073",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "4798051eff352895537590e4267fdd09985ca65bc850cc5943159db820b2386e",
                "root_sum":  "5900000"
            },
            "asset_name":  "FirstGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "0f0c1ecdf9978da26da2961f16e18ab0a9c92fda63cc99636405ef00f1315ade":  "2100000",
                "0f3cfcfbcd3322e547dc1816d75c25b5a496405d6a798bc0298bf28c525b3342":  "1800000",
                "7b23bb2449305edeaeb196b7889d5780b91a45f373afd8dfe911931152e065f3":  "2000000"
            }
        },
        "issuance-da66b9083cf410c74a36fc45aaee11098f443e03dded7b437ed5cedfd07a5840":  {
            "id":  {
                "group_key":  "9b5be8fdc73cf3740e206c24bcf48ca222be6c99388ec4dabb0c9b52a658f975",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "5f99c796a76316b762a88334955af67154da4e2fcc3877dfe60bc68c98d44c8d",
                "root_sum":  "59600000"
            },
            "asset_name":  "FourthGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "93d52c8ae4987c3726f4ca39e8dbc375ad2d3a443fa7a4ac64dcf032af66adf4":  "21200000",
                "ad32827c8c6fd2defb6ce83350a69cb89f56a4aac8659581e4949c3d5a2d60b4":  "18200000",
                "d8d2afbd1c38fca131183d3436485a22da941be5e1696e7f0d4e9d86dafc6bc3":  "20200000"
            }
        },
        "transfer-36c1026cf97ee29c7ea22ef370c4088d7bfb0a1f6a496e43096c084f0cc52580":  {
            "id":  {
                "group_key":  "db0099403a225cff87db6adc1d7b65997681eaecef3489fb0b9737d3481cbd8d",
                "proof_type":  "PROOF_TYPE_TRANSFER"
            },
            "mssmt_root":  {
                "root_hash":  "4083b372a46b97e9a81e3b5abd11c853deefc4d5572fe8450a4773b5b616335a",
                "root_sum":  "2"
            },
            "asset_name":  "ThirdGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "03cc0ca7866d5e848605beaa5ead575bea88b652c79ec7f41b0b43ffdf28500b":  "1"
            }
        },
        "transfer-708057a7f5016382de5329615749a788a83407ddb25812247b1f3cdeab1ec4f1":  {
            "id":  {
                "group_key":  "94c3ab89e49a9e063cbc3ec95e0e576c657e5e94bceb2452f2a5e65e325adde8",
                "proof_type":  "PROOF_TYPE_TRANSFER"
            },
            "mssmt_root":  {
                "root_hash":  "2a1d585e823140122bfd9a14f8daf1b7efee34014b9981b88a9e6ecb8887b87d",
                "root_sum":  "27"
            },
            "asset_name":  "SecondGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "5a004896991d0d73d6858253d13bb76bd7206dc398db246c5e86d8e5f4f8820a":  "1",
                "dac4f72890b69b23048ef7d2ff999d41f49983678998d9aa5ca88d5ba294d5cb":  "1"
            }
        },
        "transfer-c95eea4b60ac2c90964a5b6bc54fa776068b6a51c961a1eea1870a0cd0149777":  {
            "id":  {
                "group_key":  "abf2c664f1ca9b0975a42df07c9f76b60c2e9204e741a427338f2945e3627073",
                "proof_type":  "PROOF_TYPE_TRANSFER"
            },
            "mssmt_root":  {
                "root_hash":  "8f465141461468376a8b71006f4d6833e64b07a3f5889a34c1d7d33c1e039779",
                "root_sum":  "3"
            },
            "asset_name":  "FirstGroup{ThirdTranche",
            "amounts_by_asset_id":  {
                "0f0c1ecdf9978da26da2961f16e18ab0a9c92fda63cc99636405ef00f1315ade":  "1",
                "0f3cfcfbcd3322e547dc1816d75c25b5a496405d6a798bc0298bf28c525b3342":  "1",
                "7b23bb2449305edeaeb196b7889d5780b91a45f373afd8dfe911931152e065f3":  "1"
            }
        }
    }
}
002d4af395f0:/$ 

Also,

002d4af395f0:/$ tapcli universe roots -h
NAME:
   tapcli universe roots - list the known asset universe roots

USAGE:
   tapcli universe roots [command options] [arguments...]

DESCRIPTION:
   Query for the set of known asset universe roots

OPTIONS:
   --asset_id value      the asset ID of the universe to query for
   --group_key value     the group key of the universe to query for
   --proof_type value    the type of proof to show the roots for, either 'issuance' or 'transfer' (default: "issuance")
   --skip_amounts_by_id  skip showing the amounts by ID for grouped assets to optimize response size and speed; only applies if no asset ID or group key is specified
   --offset value        the offset to start returning results from; only applies if no asset ID or group key is specified (default: 0)
   --limit value         the maximum number of results to return; only applies if no asset ID or group key is specified (default: 512)
   
002d4af395f0:/$ 

says the default value for --proof_type should be issuance, but that also shows transfers

002d4af395f0:/$ tapcli universe roots
{
    "universe_roots":  {
        "issuance-332b46369a74d33695f446d9ac8e1607cc4b279fdb0c7f76b4e689e4d4d0e822":  {
            "id":  {
                "asset_id":  "332b46369a74d33695f446d9ac8e1607cc4b279fdb0c7f76b4e689e4d4d0e822",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "71c2cefef82f246c726f2af078849e5f007244bc6f242ea1568460d9e3e1c00b",
                "root_sum":  "210000000000000000"
            },
            "asset_name":  "{non grouped asset",
            "amounts_by_asset_id":  {
                "332b46369a74d33695f446d9ac8e1607cc4b279fdb0c7f76b4e689e4d4d0e822":  "210000000000000000"
            }
        },
        "issuance-36c1026cf97ee29c7ea22ef370c4088d7bfb0a1f6a496e43096c084f0cc52580":  {
            "id":  {
                "group_key":  "db0099403a225cff87db6adc1d7b65997681eaecef3489fb0b9737d3481cbd8d",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "9010b43668c125e72e2212625261a3e533e0663592d28af6b1b99aa3249994fd",
                "root_sum":  "1700000"
            },
            "asset_name":  "ThirdGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "03cc0ca7866d5e848605beaa5ead575bea88b652c79ec7f41b0b43ffdf28500b":  "1700000"
            }
        },
        "issuance-708057a7f5016382de5329615749a788a83407ddb25812247b1f3cdeab1ec4f1":  {
            "id":  {
                "group_key":  "94c3ab89e49a9e063cbc3ec95e0e576c657e5e94bceb2452f2a5e65e325adde8",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "16464f71b5591878908939dc7556d12265243c96ae9d710b4b572abfcc70178b",
                "root_sum":  "3300000"
            },
            "asset_name":  "SecondGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "5a004896991d0d73d6858253d13bb76bd7206dc398db246c5e86d8e5f4f8820a":  "1700000",
                "dac4f72890b69b23048ef7d2ff999d41f49983678998d9aa5ca88d5ba294d5cb":  "1600000"
            }
        },
        "issuance-c95eea4b60ac2c90964a5b6bc54fa776068b6a51c961a1eea1870a0cd0149777":  {
            "id":  {
                "group_key":  "abf2c664f1ca9b0975a42df07c9f76b60c2e9204e741a427338f2945e3627073",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "4798051eff352895537590e4267fdd09985ca65bc850cc5943159db820b2386e",
                "root_sum":  "5900000"
            },
            "asset_name":  "FirstGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "0f0c1ecdf9978da26da2961f16e18ab0a9c92fda63cc99636405ef00f1315ade":  "2100000",
                "0f3cfcfbcd3322e547dc1816d75c25b5a496405d6a798bc0298bf28c525b3342":  "1800000",
                "7b23bb2449305edeaeb196b7889d5780b91a45f373afd8dfe911931152e065f3":  "2000000"
            }
        },
        "issuance-da66b9083cf410c74a36fc45aaee11098f443e03dded7b437ed5cedfd07a5840":  {
            "id":  {
                "group_key":  "9b5be8fdc73cf3740e206c24bcf48ca222be6c99388ec4dabb0c9b52a658f975",
                "proof_type":  "PROOF_TYPE_ISSUANCE"
            },
            "mssmt_root":  {
                "root_hash":  "5f99c796a76316b762a88334955af67154da4e2fcc3877dfe60bc68c98d44c8d",
                "root_sum":  "59600000"
            },
            "asset_name":  "FourthGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "93d52c8ae4987c3726f4ca39e8dbc375ad2d3a443fa7a4ac64dcf032af66adf4":  "21200000",
                "ad32827c8c6fd2defb6ce83350a69cb89f56a4aac8659581e4949c3d5a2d60b4":  "18200000",
                "d8d2afbd1c38fca131183d3436485a22da941be5e1696e7f0d4e9d86dafc6bc3":  "20200000"
            }
        },
        "transfer-36c1026cf97ee29c7ea22ef370c4088d7bfb0a1f6a496e43096c084f0cc52580":  {
            "id":  {
                "group_key":  "db0099403a225cff87db6adc1d7b65997681eaecef3489fb0b9737d3481cbd8d",
                "proof_type":  "PROOF_TYPE_TRANSFER"
            },
            "mssmt_root":  {
                "root_hash":  "4083b372a46b97e9a81e3b5abd11c853deefc4d5572fe8450a4773b5b616335a",
                "root_sum":  "2"
            },
            "asset_name":  "ThirdGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "03cc0ca7866d5e848605beaa5ead575bea88b652c79ec7f41b0b43ffdf28500b":  "1"
            }
        },
        "transfer-708057a7f5016382de5329615749a788a83407ddb25812247b1f3cdeab1ec4f1":  {
            "id":  {
                "group_key":  "94c3ab89e49a9e063cbc3ec95e0e576c657e5e94bceb2452f2a5e65e325adde8",
                "proof_type":  "PROOF_TYPE_TRANSFER"
            },
            "mssmt_root":  {
                "root_hash":  "2a1d585e823140122bfd9a14f8daf1b7efee34014b9981b88a9e6ecb8887b87d",
                "root_sum":  "27"
            },
            "asset_name":  "SecondGroup{FirstTranche",
            "amounts_by_asset_id":  {
                "5a004896991d0d73d6858253d13bb76bd7206dc398db246c5e86d8e5f4f8820a":  "1",
                "dac4f72890b69b23048ef7d2ff999d41f49983678998d9aa5ca88d5ba294d5cb":  "1"
            }
        },
        "transfer-c95eea4b60ac2c90964a5b6bc54fa776068b6a51c961a1eea1870a0cd0149777":  {
            "id":  {
                "group_key":  "abf2c664f1ca9b0975a42df07c9f76b60c2e9204e741a427338f2945e3627073",
                "proof_type":  "PROOF_TYPE_TRANSFER"
            },
            "mssmt_root":  {
                "root_hash":  "8f465141461468376a8b71006f4d6833e64b07a3f5889a34c1d7d33c1e039779",
                "root_sum":  "3"
            },
            "asset_name":  "FirstGroup{ThirdTranche",
            "amounts_by_asset_id":  {
                "0f0c1ecdf9978da26da2961f16e18ab0a9c92fda63cc99636405ef00f1315ade":  "1",
                "0f3cfcfbcd3322e547dc1816d75c25b5a496405d6a798bc0298bf28c525b3342":  "1",
                "7b23bb2449305edeaeb196b7889d5780b91a45f373afd8dfe911931152e065f3":  "1"
            }
        }
    }
}
002d4af395f0:/$ 

ZZiigguurraatt avatar Aug 22 '25 21:08 ZZiigguurraatt

Adding the keyword AssetRoots

ZZiigguurraatt avatar Aug 22 '25 21:08 ZZiigguurraatt

With the way the CLI works right now, if you don't sepcify a group key or asset ID, then it returns all of the first page of roots: https://github.com/lightninglabs/taproot-assets/blob/8ff0ae9650c80c50413afaa2cbe50a2cf9cfaa64/cmd/commands/universe.go#L219-L240

Roasbeef avatar Aug 22 '25 22:08 Roasbeef

With the way the CLI works right now, if you don't sepcify a group key or asset ID, then it returns all of the first page of roots:

taproot-assets/cmd/commands/universe.go

Lines 219 to 240 in 8ff0ae9 // If neither an asset ID or group key is specified, then we'll query // for all the known universe roots. if universeID == nil { universeRoots, err := client.AssetRoots( ctxc, &unirpc.AssetRootRequest{ WithAmountsById: !ctx.Bool(skipAmountsByIdName), Offset: int32(ctx.Uint64(offsetName)), Limit: int32(ctx.Uint64(limitName)), }, ) if err != nil { return err }

printRespJSON(universeRoots) return nil }

rootReq := &unirpc.AssetRootQuery{ Id: universeID, }

Rather than clarify this in the docs for the CLI, I think it would be better to update the CLI to let you get issuance w/o specifying an asset ID or group key.

ZZiigguurraatt avatar Aug 25 '25 02:08 ZZiigguurraatt