feat(dlv): a trader can find and verify the owner's reserve proof - #765
Merged
Conversation
The generic proof artifact landed with nothing pointing at it. Its content
address was carried by no published object, and nothing anywhere mapped a
vault to its owner's economic position, so the two inputs the 0x0026 arm needs
from the owner's side — the reserve leaves' 256-sibling inclusion paths, and
the position whose registered root they prove into — had no source a
counterparty could reach. Both are the same missing thing: a locator.
admitted create publishes the artifact
-> record stamps (addr, position)
-> routing advertisement carries them
-> trader resolves the position's root from the OWNER's register
-> fetches by content address, re-derives every path
-> verified reserve leaves
The locator is untrusted at every hop, and the advertisement is unsigned. A
reader never believes either half: it resolves the root from the publisher's
own write-once register cell and recomputes the inclusion paths against it. A
wrong address or position can only make the lookup FAIL — it cannot yield
leaves under a root the owner did not register — and what it does yield is
still just "what that root committed", never "the state you should trade
against".
- `AdmittedOutcome` carries the artifact's address, so the create can stamp
what it just published. A funded create always writes two reserve leaves, so
a missing artifact is a contradiction between the route and the producer and
is refused rather than left to surface later as an unexplained absence.
- `amm_vault_records` gains `economic_proof_addr` + `economic_proof_position`,
read back as one `Option` — both halves or neither, a present address of the
wrong width dropping the row exactly as a bad policy commit does. Written by
a narrow updater that refuses a zero address.
- `RoutingVaultAdvertisementV1` carries the same pair; the publish route fills
it from the record, never from the request, like the policy digest and the
baseline beside it.
- `verified_owner_reserve_leaves` is the trader's read: lineage walk to the
owner's validated root, fetch, recompute, filter to this vault.
Proven across TWO DEVICES: the owner creates and publishes; a trader on its
own database, holding no record of the vault, finds the ad through storage
alone, and turns the advertised pair into both reserve legs at the create's
vault generation. A locator naming another position, or another artifact,
yields nothing. Three mutation cycles — the stamp's UPDATE, the ad's fill from
the record, and the reader's verification — each reddening only its own named
test, restored checksum-verified. Two earlier attempts were no-ops that proved
nothing and were redone; one of them showed this test does not isolate the
artifact verification, which its own test does.
WIPE BOUNDARY (CHANGELOG): client schema 12 -> 13. `CREATE TABLE IF NOT
EXISTS` does not add columns, so an older database is structurally invalid and
is refused by design. No migration, deliberately.
NOT in this change: the 0x0026 bundle itself. `ReserveConsumptionEvidenceV1`
still carries its own leaf and path fields rather than consuming the generic
artifact, and nothing builds one. That is the next cut, which this one exists
to make possible.
Boards: workspace 74 binaries, 3965 passed / 0 failed / 17 ignored (dsm lib 1692/0, dsm_sdk lib 1814/0/7 ignored), exit 0; node 11 binaries, 276/0, exit 0; make lint exit 0; frontend
type-check, lint and jest green; production safety PASS (pinned 1.98.0);
ci_scan PASS.
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.
Summary
Step one of the
0x0026producer: a trader can now find and verify the owner's reserve proof. Both of the trader-side blockers were the same missing thing.What had no source
The
0x0026arm needs the owner's two reserve leaves with their 256-sibling paths, andowner_economic_position. The paths existed only inside the owner's own tree — the artifact that carries them shipped last cut, but its content address was carried by no published object. And nothing anywhere mapped a vault, or a(genesis, device)pair, to an economic position: the register key is a hash over the position, so it is not enumerable, and the lineage walk takes the position as an input.The locator is never believed
The advertisement is unsigned and this change does not make it authoritative. A reader resolves the position's root from the publisher's own register cell and recomputes every leaf key, commitment and path against it. A wrong address or position can only make the lookup fail; it cannot produce leaves under a root the owner did not register. Two arms of the test are exactly that.
AdmittedOutcomedlv.create(addr, position)after the admitted create; a funded create that published no artifact is refused, since it always writes two reserve leavesamm_vault_recordsOption— both halves or neither; a present address of the wrong width drops the row as a bad policy commit does; narrow updater refuses a zero addressRoutingVaultAdvertisementV1verified_owner_reserve_leavesWipe boundary
Client schema 12 → 13.
CREATE TABLE IF NOT EXISTSdoes not add columns to an existing file, so an older database is structurally invalid andenforce_schema_versionrefuses it by design. No migration, deliberately; beta runs ondsm-testnetwith no production user state. Recorded inCHANGELOG.md.Proof
UPDATE, the ad's fill from the record, the reader's verificationmake lintexit 0; frontend type-check 0, lint 0, jest 1101 passed;ci/production_safety_checks.shPASS (pinned 1.98.0, incl. TLA+);scripts/ci_scan.shPASS — all on tree stamp842c29c0ac4b, identical before and after every runTwo mutation attempts were no-ops that proved nothing and were redone. One of them was informative: it showed this test does not isolate the artifact verification, because the lineage walk fails first — that gate's real control is the artifact's own test, where the wrong position is handed straight to the reader.
Not in this PR
The
0x0026bundle itself.ReserveConsumptionEvidenceV1still carries its own leaf and path fields instead of consuming the generic artifact, and nothing builds one. That is the next cut, which this one exists to make possible.