Skip to content

Low level sdk helper - #209

Open
Jumongweb wants to merge 5 commits into
Bitcoindefi:mainfrom
Jumongweb:main
Open

Low level sdk helper#209
Jumongweb wants to merge 5 commits into
Bitcoindefi:mainfrom
Jumongweb:main

Conversation

@Jumongweb

Copy link
Copy Markdown

Summary

closes #56

Add a low-level SDK helper for building a ready-to-sign Soroban verification transaction from a raw snarkjs Groth16 proof.

What changed

  • implemented buildVerifyCall(proof, publicInputs, contractId, networkPassphrase) in sdk/src/verify.ts
  • accept raw Groth16 proofs in snarkjs shape (pi_a, pi_b, pi_c) and encode them into Soroban-compatible proof bytes internally
  • encode public inputs from hex strings into Soroban Vec arguments
  • surface malformed proof/input failures as typed ProofEncodingError
  • added fixture-backed unit coverage for:
    • successful transaction construction from a known pre-generated proof
    • correct proof byte packing into the contract call
    • both testnet and mainnet passphrases
    • malformed proof rejection

Verification

  • cd sdk && npm test -- --run src/verify.test.ts
  • cd sdk && npm run typecheck

@leocagli

Copy link
Copy Markdown
Collaborator

Hi @Jumongweb 👋 — two things before this can be reviewed/merged:

  1. Required check failing: Frontend fails (Contracts/SDK/SDK bindings/Circuit artifacts are green).
  2. Missing evidence: please add a video or screenshots showing the SDK helper working.

Happy to merge once both are green. 🙏

@leocagli

Copy link
Copy Markdown
Collaborator

Hi @Jumongweb 👋 — quick update: video/screenshots are not required to merge anymore, just a bonus — if you add one it'll be considered for GrantFox rewards on this issue. So I'll review this on code + checks alone now. 🙏

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.

SDK: TypeScript helper to construct verify_credential call from raw inputs

2 participants