Skip to content

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Sep 1, 2025

Extend the supplyverifier syncer to support pulling supply commitments from universe servers.

Add a supplyverifier state machine so that non-universe tapd nodes (regular node) can verify supply commitments by:

  • Watching for on-chain spends
  • Pull-syncing from universe servers

@ffranr ffranr self-assigned this Sep 1, 2025
@ffranr ffranr added the supply commit Work on the supply commitment feature, enabling issuers to attest to total asset supply on-chain. label Sep 1, 2025
@ffranr ffranr marked this pull request as draft September 1, 2025 15:24
@ffranr ffranr moved this from 🆕 New to 🏗 In progress in Taproot-Assets Project Board Sep 1, 2025
@ffranr ffranr force-pushed the wip/supplyverify/pull-sync-verify branch 2 times, most recently from 64ffd37 to cb2486f Compare September 1, 2025 16:48
@ffranr ffranr force-pushed the wip/supplycommit/add-verifier branch from 26cf469 to ded200f Compare September 3, 2025 20:35
This enables extending the supplyverifier syncer to support pulling
supply commitments in a follow-up commit.
Introduce the PullSupplyCommitment method, which calls the
FetchSupplyCommit RPC endpoint. Support for calling this endpoint from
the syncer was added in the previous commit.
Consolidate all state machine startup logic into a new method
called startAssetSM to improve code clarity. Added IsRunning
checks to ensure the state machine is active before returning
it from the cache.
Consolidate all state machine startup logic into a new method
called startAssetSM to improve code clarity. Added IsRunning
checks to ensure the state machine is active before returning
it from the cache.
Add a method that returns all asset groups with supply commitment
enabled.
Add a new SQL query to fetch the latest stored supply commitment
based on the highest block height.
Query the local database for asset groups with supply commitment enabled
where the node cannot publish commitments (no delegation key). These are
commitments published by external issuers. Commitments from the current
node are excluded, as they do not need to be tracked by the verifier.

A temporary limit of 50 state machines is set to prevent tapd nodes or
universe servers from exhausting resources.
Extract CheckSupplyCommitSupport function for use in the
supplyverifier package. Rename fetchLatestAssetMetadata to
FetchLatestAssetMetadata to allow external usage.
Verify that the asset group is supported before starting a
supplyverifier state machine for it.
Rename table `mint_anchor_uni_commitments` to `supply_pre_commits` to
align with current "supply" terminology. Drop the NOT NULL constraint
on `batch_id` so the table can also store pre-commit outputs from
peer-issued assets, not just those minted locally.

Also, remove the unique index on (batch_id, tx_output_index) and add
unique index on outpoint.
Rename SQL query to better align with "supply" terminology.
Rename SQL query to better align with "suppl" terminology.
@ffranr ffranr force-pushed the wip/supplyverify/pull-sync-verify branch from cb2486f to 87ca58f Compare September 3, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
supply commit Work on the supply commitment feature, enabling issuers to attest to total asset supply on-chain.
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

1 participant