feat: module deploys (BC protocol, Module index & getModules API) - #483
Open
ltardivo wants to merge 8 commits into
Open
feat: module deploys (BC protocol, Module index & getModules API)#483ltardivo wants to merge 8 commits into
ltardivo wants to merge 8 commits into
Conversation
…tadata
Break module deploys out of the transition/Update path so they are no longer
encoded as fake expressions.
lib:
- Multisig: Modules.toTx/broadcast store cleartext { ept } only (no exp/env/mod/v,
no encryption); still create an owner output for the UTXO/Output graph.
- Taproot: reveal scripts use protocol id BC (not ordinals ord); content-type
remains text/javascript; TxInscription.read uses parseInscriptionData.
- Modules.load/fetchSource read ept or the BC witness only (no legacy exp/ord).
- Computer.decode and Update.fromTx reject module deploys with ModuleDecodeError
(use load). Computer.deploy/load JSDoc updated.
- module-meta: isModuleMeta, tryParseModuleFromTx, tryParseModule for keyless
detection (prep for a future node Modules table; table not added yet).
- Types: ModuleOnChainMeta, ExtractedModule.
- Tests: module-meta unit tests; modules async ept/decode coverage; getInscription
builds a BC witness tx instead of a frozen ordinals hex fixture.
- monorepo types: PROTOCOL_ID constant 'BC'.
docs (monorepo/packages/docs):
- Transaction.onChainMetaData: transition vs multisig module vs taproot module.
- Computer deploy/load/decode/constructor and comparison page aligned with the
new wire formats.
Add first-class Module indexing so multisig { ept } and taproot BC
witness deploys are stored and queryable, not treated as transitions.
node:
- Schema: Module table (mod, ept, storageType, blockHash, blockHeight,
timestamp) with blockHash/blockHeight indexes; mirrored in monorepo
packages/node/db.
- Detection: module-extract (isModuleMeta, tryParseModuleFromTx) for
cleartext { ept } and BC reveal witnesses (protocol id BC).
- Stack: ModuleDao / ModuleService / ModuleAction; getModules attaches
optional block context for sync and ZMQ.
- Wire-in: insertSpendGraph / insertAndUpdateMod accept modules;
ZMQ and sync-blockchain batch inserts; reorg eraseBlockHash; mempool
hard-delete removes unconfirmed modules with outputs/inputs.
- API: GET /modules (verbosity 0 = specifiers, 1 = full rows; limit,
offset, order, storageType, isConfirmed) and GET /module/:mod.
- Utils: formatPositions5 for 5-column Module inserts.
- Fix: Module.query prepared-statement names unique per filter combo
(storageType × isConfirmed × order) to avoid pg name collisions.
tests:
- module-extract unit coverage (meta, multisig/taproot, getModules).
- ModuleAction async: insert/upsert, filters, reorg, mempool delete,
insertSpendGraph.
- smart-object routes for /modules and /module/:mod; formatPositions5.
docs (monorepo/packages/docs):
- Node: modules.md, module.md; index architecture/API/Postgres notes.
- Clarify non-standard-utxos / get-txos mod = membership, not source.
- Cross-link deploy/load to the node module endpoints.
Expose the node Module index on the client so apps can list and fetch deployed module sources without evaluating them. lib: - Types: ModuleRecord and ModuleQuery (verbosity, limit, offset, order, storageType, isConfirmed). - RestClient.getModules → GET /modules; RestClient.getModule → GET /module/:mod (validates specifier via isValidRevString). - Computer.getModules / getModule thin wrappers next to deploy/load; verbosity 0 returns specifier strings, 1 returns full rows with ept. - Does not evaluate modules (still use load for exports). tests: - modules.async-test: after deploy, poll getModules and assert getModule returns the indexed source and storageType.
…ence Bring Computer method docs in line with the current public API: add the module index helpers, fill missing method pages, and fix outdated signatures and recommendations. docs: - index.md: reorganize Basic / Modules / Query outputs / History / Wallet / Indexer readiness / SSE / Deprecated; prefer getOUTXOs over query; fix faucet link; link getTXOs family, fund, streams, etc. - New: getModules, getModule, getInscription, isIndexed, waitForIndexed, listTxs, getUrl, getPath, getFee, setFee, delete, last, spendingInput, isUnspent. - waitForIndex.md: redirect to waitForIndexed (correct method name and return type with timeout options). - query.md: mark deprecated; real Query shape (no ids); point to getOUTXOs; distinguish object membership vs module source. - getTXOs / getUTXOs / getOTXOs / getOUTXOs / getUtxos: fix getUOTXOs → getOUTXOs, isSpent naming, TXORecord types, mod = membership. - deploy/load: link client getModules/getModule; Node modules/module pages cross-link the client methods. - fund, faucet, getAncestors, streamMempoolCleanup: accuracy fixes.
Document authentication, empty results, Module schema upgrades, and version matching in Node/operations.md, plus a 0.27 changelog for module deploy breaking changes. Correct the tutorial (load exports, getOUTXOs/latest instead of query ids), rename getTXOs/getUTXOs pages to match the API, and cross-link Node and Computer docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multisig modules now live as cleartext
{ ept }data outputs, taproot modules use the newBCprotocol id (replacing ordinals-styleORD), and the node gains a dedicated Module table plus list/get endpoints. The client follows withgetModules/getModuleso apps can inspect source without evaluating it. Everything is versioned as0.27.0-beta.1.Breaking changes
Wire format
Multisig: only
{ ept: string }is written (noexp/env/mod/v, no encryption).Taproot: reveal witness envelope now carries protocol id
BC(content-typeremainstext/javascript).Legacy shapes that stored modules as transition
expfields orordinscriptions are no longer read.Client
computer.decode(tx)now throwsModuleDecodeErroron a module deploy. Usecomputer.load(rev)instead.Prefer
getOUTXOs/latest+syncover the deprecatedquery(especially the old ids filter).Node
Existing Postgres volumes created before this feature need the Module table applied manually (see migration below).
Lib and node must be the same version line; mismatched pairs produce 404s, parse failures, or empty indexes.
Lib
PROTOCOL_IDconstant changed fromORDtoBC.Modules.toTx/broadcastemit pure multisig{ ept }(still creates an owner output so the UTXO appears in the Output graph).BCenvelope;TxInscription.readandparseInscriptionDataunderstand only the new format.isModuleMeta,tryParseModuleFromTx,tryParseModule(keyless, ready for node indexing).Computer.decoderejects module deploys with a clear error pointing to load.Node
Moduletable (mod, ept, storageType, blockHash, blockHeight, timestamp) with indexes.GET /v1/:chain/:network/modules(verbosity, limit, offset, order, storageType, isConfirmed)GET /v1/:chain/:network/module/:modDocs
Migration