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

[feature] - tapdb+universe+rpc: expose outpoint based universe leaf queries over RPC #1040

Open Roasbeef opened 1 month ago

Roasbeef commented 1 month ago

Is your feature request related to a problem? Please describe.

Today users have two ways to query for a Universe leaf:

With just the behavior of the existing calls, there isn't an easy way to look up any asset related proofs given a txid/outpoint. Lack of such an API makes it harder to build a simpler overlay explorer (eg: click/hover an outpoint for extra info) for taproot assets.

Describe the solution you'd like

Resolve this TODO: https://github.com/lightninglabs/taproot-assets/blob/b154a998c8b1215310cdfb3e4f897a56cb4ee587/rpcserver.go#L5037-L5041

Additional context

The existing query partially supports this behavior: https://github.com/lightninglabs/taproot-assets/blob/b154a998c8b1215310cdfb3e4f897a56cb4ee587/tapdb/sqlc/queries/universe.sql#L56C10-L71

It needs to be made less strict, also allowing the namespace value to be unspecified.

dstadulis commented 1 month ago

This could be used in an integration for mempool.space etc

dstadulis commented 1 month ago

Existing product with similar queries: https://megalithic.me/taproot_assets_explorer?search=b8ef8e9030445fac119944190bf2f7a3026c9a12090fe8e422227577707d9ae1%3A0