Phase 2: IntentRank matching + ZK provenance circuit#1
Closed
Timwal78 wants to merge 7 commits into
Closed
Conversation
- 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.
… 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)
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.
Superseded by #4 (clean rebase from main HEAD). All changes from this PR landed there. Closing to avoid confusion.