Skip to content

Phase 2: IntentRank matching + ZK provenance circuit#1

Closed
Timwal78 wants to merge 7 commits into
mainfrom
claude/solana-gossip-xah-did-20k6zu
Closed

Phase 2: IntentRank matching + ZK provenance circuit#1
Timwal78 wants to merge 7 commits into
mainfrom
claude/solana-gossip-xah-did-20k6zu

Conversation

@Timwal78

@Timwal78 Timwal78 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Superseded by #4 (clean rebase from main HEAD). All changes from this PR landed there. Closing to avoid confusion.

- IntentRank (packages/sdk/src/intentrank.ts): reputation-weighted matching
  (spec §4.2). Σ(value·proofQuality·recencyDecay) / (1 + Σ(severity·decay)),
  with deterministic DID tie-break so agents converge on the same winner.
  7 tests.
- ZK provenance (circuits/): Groth16 circuit proving knowledge of
  (apiResponseHash, salt, privateKey) s.t. commitment=Poseidon(hash,ts,salt)
  and nullifier=Poseidon(key,intentHash) — no reveal of response or key
  (spec §3.5, §4.5). Pure-JS reference (same Poseidon) verifies determinism,
  hiding, identity/intent binding, replay detectability — 7 tests. build.sh
  does circom compile + Groth16 setup + verifier export (needs circom/snarkjs).
- CI job for the ZK reference; docs/PHASE2.md; README status refreshed.

Verified: 48 JS tests (35 sdk + 6 relay + 7 circuits); cargo check --workspace
clean; hook wasm builds; end-to-end example runs.
@Timwal78 Timwal78 marked this pull request as ready for review June 14, 2026 05:30
Timwal78 and others added 6 commits June 14, 2026 05:57
… trio

The spec (§10) names three Solana programs: gossip, escrow, subscription.
This adds the third.

- programs/poi-subscription: SOL tier management (spec §6.1) — Scout(0) /
  Runner(5) / Relay(25) / Builder(50) SOL/month. `subscribe(tier)` pays the
  monthly SOL price to the treasury and sets a 30-day expiry; renewals stack.
  Non-custodial: only SOL infra revenue moves; Rail Miles (§6.4) stay
  database-only/off-chain, never on-chain.
- Unit tests for tier pricing (matches spec §6.1) — 3 passing via cargo test.
- CI runs `cargo test -p poi-subscription`; README refreshed.

Verified: cargo check --workspace clean (3 programs); cargo test
-p poi-subscription 3/3; 48 JS/circuit tests; hook wasm; example runs.
- Anchor.toml: include both poi_subscription (Phase 2 PR) and
  poi_verifier (added to main by commit 9106b77) in localnet + devnet
- packages/sdk/src/index.ts: export intentrank.js alongside
  verifier.js and rank.js (both added to main by 9106b77)

Cargo.lock still needs manual resolution: insert poi-subscription
block between poi-gossip and poi-verifier entries.
… + poi-verifier

Merge main into PR branch. Conflicts resolved:
- Anchor.toml: retain both poi_subscription (SaaS tiers) and poi_verifier (on-chain verification) in localnet and devnet
- Cargo.lock: insert poi-subscription block (anchor-lang dep) before poi-verifier block (anchor-lang + poi-escrow deps), preserving alphabetical order
- packages/sdk/src/index.ts: export all modules including intentrank.js (was dropped by -X theirs merge strategy)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ci.yml: SHA-pin all actions (security hardening); replace cargo
  check --workspace in zk-circuits with cargo read-manifest to avoid
  sp1-sdk 3.0/3.4 version conflict; retain poi-subscription test and
  JS circuits job with SHA-pinned checkout
- ghost-layer: remove invalid `peerId` from RelayNode constructor
  (RelayOptions only accepts maxIntents and 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.

2 participants