Skip to content

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

Open
@Roasbeef

Description

@Roasbeef

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

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

  • QueryProof: allows to query based on a combination of: universe ID, script key, and also outpoint
  • AssetLeaves: queries for the entire set of leaves for for a given ID

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:

taproot-assets/rpcserver.go

Lines 5037 to 5041 in b154a99

default:
// TODO(roasbeef): can actually allow not to be, then would
// fetch all for the given outpoint
return leafKey, fmt.Errorf("script key must be set")
}

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🔖 Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions