Skip to content

feat(wasm): export proveAncestor in the WebAssembly package (#26) - #39

Merged
samjay8 merged 1 commit into
Externalize-Labs:mainfrom
khoap1220-hue:feat/wasm-prove-ancestor-26-v2
Oct 29, 2026
Merged

samjay8 merged 1 commit into
Externalize-Labs:mainfrom
khoap1220-hue:feat/wasm-prove-ancestor-26-v2

Conversation

@khoap1220-hue

Copy link
Copy Markdown
Contributor

Closes #26

Summary

  • Export proveAncestor(bundleJson, headerFiles, ledger, trustToml?) from crates/externalize-wasm (and prove_ancestor_to_json for native Rust tests) to prove an older ledger from a certified bundle and archived ledger-*.xdr.gz checkpoints.
  • Enable externalize-core/archive in crates/externalize-wasm to decode gzipped XDR header frames via archive::read_gz_frames and walk the hash chain with externalize_core::prove_ancestor.
  • Return report::ancestry ({ verified: true, ledger, via, links }) or report::rejected ({ verified: false, error }) following the same never-throws contract as verify, and export the AncestryReport TypeScript interface in the generated .d.ts.

Validation

  • Added unit tests in crates/externalize-wasm/tests/verify.rs (proves_ancestor_and_rejects_when_headers_are_missing) proving ledger 64791250 across ledger-03dca33f.xdr.gz + ledger-03dca2ff.xdr.gz (links == 109) and verifying rejection when the older checkpoint file is omitted.
  • Updated crates/externalize-wasm/tests/node.cjs to test pkg.proveAncestor end-to-end in Node.js and assert AncestryReport and export function proveAncestor(...): AncestryReport | Rejection; in externalize_wasm.d.ts while keeping the .wasm binary well under the 1 MiB budget.

@samjay8
samjay8 merged commit a927da3 into Externalize-Labs:main Oct 29, 2026
12 checks passed
@samjay8

samjay8 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Merged — thanks for your contribution! 🎉

@khoap1220-hue

khoap1220-hue commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks so much for the fast review and merge! 🙏 Really enjoyed working on externalize-wasm.

To help finish the rest of the �ncestry track alongside #23 and #26, I have left implementation plans on #25 (CLI �ncestry --headers directory support — already rebased cleanly on �927da3) and externalize-node#15 (GET /v1/checkpoints/{checkpoint}/ledger for browser proveAncestor) whenever you'd like to assign one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[enhancement]: proveAncestor in the WebAssembly package

2 participants