Skip to content

feat(sdk): add buildCredentialMerkleRoot and hashLeaf helpers#185

Open
Akinyemi04 wants to merge 1 commit into
Bitcoindefi:mainfrom
Akinyemi04:feat/credential-merkle-sdk
Open

feat(sdk): add buildCredentialMerkleRoot and hashLeaf helpers#185
Akinyemi04 wants to merge 1 commit into
Bitcoindefi:mainfrom
Akinyemi04:feat/credential-merkle-sdk

Conversation

@Akinyemi04

Copy link
Copy Markdown

Closes #63

Implements the same Poseidon2/PoseidonCompress parameters as the agent_passport
circuit so callers can compute a credential Merkle root without re-implementing
the hash themselves.

- sdk/src/merkle.ts: Poseidon2 permutation (t=2, BN254), PoseidonCompress,
  hashLeaf, buildCredentialMerkleRoot, CredentialFields interface
- sdk/src/merkle.test.ts: 11 unit tests covering determinism, field encoding,
  field-order sensitivity, and per-field mutation
- sdk/src/index.ts: re-exports hashLeaf, buildCredentialMerkleRoot, CredentialFields
- sdk/vitest.config.ts: local config so vitest does not crawl to the root
@Akinyemi04 Akinyemi04 force-pushed the feat/credential-merkle-sdk branch from e8148f2 to b256480 Compare June 29, 2026 19:42
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.

Add Merkle tree helper to SDK for building credential roots

1 participant