sm-parc 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sm_parc-0.2.0/.gitignore +22 -0
- sm_parc-0.2.0/CHANGELOG.md +76 -0
- sm_parc-0.2.0/GLOSSARY.md +27 -0
- sm_parc-0.2.0/GOVERNANCE.md +37 -0
- sm_parc-0.2.0/LICENSE +21 -0
- sm_parc-0.2.0/PKG-INFO +204 -0
- sm_parc-0.2.0/README.md +172 -0
- sm_parc-0.2.0/SPEC.md +187 -0
- sm_parc-0.2.0/THREATMODEL.md +116 -0
- sm_parc-0.2.0/WHITEPAPER.md +110 -0
- sm_parc-0.2.0/conftest.py +15 -0
- sm_parc-0.2.0/docs/WALKTHROUGH.md +109 -0
- sm_parc-0.2.0/examples/__init__.py +2 -0
- sm_parc-0.2.0/examples/mint_and_admit.py +120 -0
- sm_parc-0.2.0/examples/published_ledger_admission.py +438 -0
- sm_parc-0.2.0/examples/three_city_economy.py +374 -0
- sm_parc-0.2.0/examples/two_city_admission.py +407 -0
- sm_parc-0.2.0/pyproject.toml +90 -0
- sm_parc-0.2.0/sm_parc/__init__.py +45 -0
- sm_parc-0.2.0/sm_parc/admission.py +396 -0
- sm_parc-0.2.0/sm_parc/context.py +17 -0
- sm_parc-0.2.0/sm_parc/credential.py +144 -0
- sm_parc-0.2.0/sm_parc/disclosure.py +105 -0
- sm_parc-0.2.0/sm_parc/py.typed +0 -0
- sm_parc-0.2.0/tests/test_disclosure.py +113 -0
- sm_parc-0.2.0/tests/test_parc.py +266 -0
- sm_parc-0.2.0/tests/test_published_ledger_admission.py +331 -0
- sm_parc-0.2.0/tests/test_smoke.py +14 -0
- sm_parc-0.2.0/tests/test_three_city_economy.py +97 -0
- sm_parc-0.2.0/tests/test_two_city_admission.py +134 -0
sm_parc-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
.venv/
|
|
8
|
+
venv/
|
|
9
|
+
|
|
10
|
+
# Tooling caches
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.mypy_cache/
|
|
13
|
+
.ruff_cache/
|
|
14
|
+
.coverage
|
|
15
|
+
htmlcov/
|
|
16
|
+
coverage/
|
|
17
|
+
|
|
18
|
+
# Local brainstorming/design artifacts — never published
|
|
19
|
+
docs/superpowers/
|
|
20
|
+
|
|
21
|
+
# Launch-video frame captures (regenerable)
|
|
22
|
+
ui/screenshots/
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/) and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Pointer-mode admission** (`admit_over_published_ledger` + `subject_severed_score`).
|
|
11
|
+
The credential names a published community ledger (`credentialSubject.ledger_uri`);
|
|
12
|
+
the verifier fetches it, checks it against the signed `behavioral_merkle_root`, and
|
|
13
|
+
**derives the subject's collusion-severed score over the full graph itself** — so it
|
|
14
|
+
catches an N-party Sybil ring that the single-subject inline credential structurally
|
|
15
|
+
cannot. `examples/published_ledger_admission.py` demonstrates honest-admitted,
|
|
16
|
+
ring-severed-rejected, and the curated-ledger residual.
|
|
17
|
+
- `THREATMODEL.md` — honest coverage of what the gate does and does not defend, and the
|
|
18
|
+
inline-vs-pointer tradeoff (offline/privacy vs collusion-resistance).
|
|
19
|
+
- `SPEC.md` §3.1 — the `ledger_uri` mode discriminator and the verifier's pairing rule.
|
|
20
|
+
- `GLOSSARY.md` — canonical acronym expansions (ARP = Agency Receipt Protocol, VRP =
|
|
21
|
+
Verifiable Receipts Profile, PARC, DAT = Delegated Authority Token, …); every acronym
|
|
22
|
+
is now expanded on first use across the docs and linked to the glossary.
|
|
23
|
+
- **Selective disclosure** (`sm_parc.disclosure`: `inclusion_proof` + `verify_inclusion`).
|
|
24
|
+
A holder reveals only the receipts worth showing plus a Merkle inclusion proof for
|
|
25
|
+
each; a verifier confirms every one sits under the credential's signed
|
|
26
|
+
`behavioral_merkle_root` WITHOUT seeing the rest of the ledger. Pure SHA-256 over the
|
|
27
|
+
identical leaf/tree construction as the VRP root — no zero-knowledge.
|
|
28
|
+
- `examples/three_city_economy.py` + the **Three-city journey** viewer — one PARC
|
|
29
|
+
carried A (community) → B (marketplace) → C (enterprise): transactions (the ledger
|
|
30
|
+
grows 12→26→40), portability (the corroborated score compounds 60→130→200 and unlocks
|
|
31
|
+
the enterprise; shown cold it is rejected), security (a wash-trader is severed and
|
|
32
|
+
rejected at the lowest bar), and selective disclosure (3-of-40 revealed at the
|
|
33
|
+
enterprise, inclusion-verified in-browser).
|
|
34
|
+
|
|
35
|
+
- **Pointer-mode safeguards (v0.1 hardening for NANDA publication).**
|
|
36
|
+
`AdmissionPolicy.required_anchors` — a local allowlist of known-honest dids; a fetched
|
|
37
|
+
ledger involving none of them is rejected (`anchor_absent`), a stopgap that defeats the
|
|
38
|
+
trivial "publish my ring with no anchor" laundering until a notary layer exists.
|
|
39
|
+
`AdmissionPolicy.max_ledger_receipts` — an execution budget; an oversized fetched ledger
|
|
40
|
+
is rejected (`ledger_too_large`) before the severance recomputation, bounding the gate's
|
|
41
|
+
pure function against a hostile issuer. See SPEC §3.3 + THREATMODEL.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
- **Mode confusion**: the inline `admit` gate now refuses a pointer credential (and
|
|
45
|
+
vice-versa) with a distinct `wrong_mode` stage — admitting a pointer credential inline
|
|
46
|
+
would have thresholded the ledger-wide score and re-admitted a severed ring member.
|
|
47
|
+
|
|
48
|
+
## [0.2.0] — 2026-06-20
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
- **Adopt the PARC name** (Portable Agent Reputation Credential). Python package
|
|
52
|
+
`parc`; distribution `parc`; wire identifier `parc/0.1` (a Working Draft). The
|
|
53
|
+
credential `@context` term URL is `…/contexts/parc/v0.1`.
|
|
54
|
+
- **Un-vendor `sm_arp`.** The in-tree `sm_arp/` copy (and `VENDORED.md`) are removed;
|
|
55
|
+
`parc` now depends on the public `sm-arp>=0.2.3,<0.3` from PyPI. `from sm_arp.vrp
|
|
56
|
+
import …` resolves from the installed package.
|
|
57
|
+
- **Bind admission to `nanda-rep/0.2`** (corroboration-gated, collusion-severed). The
|
|
58
|
+
credential's `credentialSubject` facet now uses `scoring_method: "nanda-rep/0.2"` and
|
|
59
|
+
carries `corroboration_rate`. The admission gate REQUIRES `nanda-rep/0.2`: a
|
|
60
|
+
credential carrying the un-corroborated `nanda-rep/0.1` facet is rejected with a new
|
|
61
|
+
`scoring_method_unsupported` (`corroboration_required`) reason, and a wash-trading
|
|
62
|
+
ring's severed `nanda-rep/0.2` score (~0) fails the threshold.
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
- `examples/mint_and_admit.py` — runnable mint + admit demo (honest corroborated agent
|
|
66
|
+
admitted; wash-trade agent rejected).
|
|
67
|
+
- Hardened tooling: ruff `select` (`E,F,I,UP,B,SIM,C4,RUF`), strict mypy over `parc`.
|
|
68
|
+
|
|
69
|
+
## [0.1.0] — 2026-06-07
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
- Initial working-draft release (the package now known as PARC; see 0.2.0).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
Built at [labs.stellarminds.ai](https://labs.stellarminds.ai).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Glossary
|
|
2
|
+
|
|
3
|
+
Acronyms used across the agent-receipts stack. **These expansions are canonical — use
|
|
4
|
+
them verbatim and identically in every repo.** The source of truth for `ARP` / `VRP` /
|
|
5
|
+
`DAT` is [sm-arp](https://github.com/Sharathvc23/sm-arp); for `PARC`, this repo.
|
|
6
|
+
|
|
7
|
+
## Stack terms
|
|
8
|
+
|
|
9
|
+
| Acronym | Expansion | What it is |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| **ARP** | Agency Receipt Protocol | The signed receipt envelope — *what an agent did*. |
|
|
12
|
+
| **VRP** | Verifiable Receipts Profile | Composes ARP receipts into a Receipts Ledger + commitment (`behavioral_merkle_root`) + the corroborated `nanda-rep/0.2` scoring (`sm_arp.vrp`). |
|
|
13
|
+
| **PARC** | Portable Agent Reputation Credential | A signed W3C Verifiable Credential over a VRP facet, plus the admission gate (this repo). |
|
|
14
|
+
| **DAT** | Delegated Authority Token | The companion to ARP — *what an agent was allowed to do* (a sketch in ARP v0.1, normative in v0.2). |
|
|
15
|
+
|
|
16
|
+
## Standards referenced
|
|
17
|
+
|
|
18
|
+
| Acronym | Expansion |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| **VC** | Verifiable Credential (W3C VC Data Model 2.0) |
|
|
21
|
+
| **DID** | Decentralized Identifier (W3C) |
|
|
22
|
+
| **JCS** | JSON Canonicalization Scheme (RFC 8785) |
|
|
23
|
+
| **SCC** | Strongly Connected Component (graph theory; Tarjan's algorithm) |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
Built at [labs.stellarminds.ai](https://labs.stellarminds.ai).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Governance
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
| In scope | Out of scope |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| the ReputationCredential envelope (W3C VC) + the admission gate | the receipt format (Agency Receipt Protocol, ARP), the ledger commitment + scoring (Verifiable Receipts Profile, VRP — `sm_arp.vrp`), the auditor runtime, revocation transport, selective disclosure |
|
|
8
|
+
|
|
9
|
+
The primitive owns one thing — making a VRP reputation facet portable + checkable at
|
|
10
|
+
admission. Anything outside the table belongs to a companion package or the consumer.
|
|
11
|
+
|
|
12
|
+
## Versioning
|
|
13
|
+
|
|
14
|
+
Semantic Versioning 2.0.0. The credential shape and the admission-gate ordering are
|
|
15
|
+
frozen within a major; a change requires an RFC-style PR to `SPEC.md` before code.
|
|
16
|
+
|
|
17
|
+
## Conformance
|
|
18
|
+
|
|
19
|
+
The test suite under `tests/` is the authoritative behavioural specification. A change
|
|
20
|
+
in behaviour without a corresponding test change is a bug. Every guarantee in the
|
|
21
|
+
README has a happy-path test; every rejection stage has a hostile-path test.
|
|
22
|
+
|
|
23
|
+
## Contributions
|
|
24
|
+
|
|
25
|
+
- PRs must include tests and pass `ruff` + `mypy --strict` + `pytest`.
|
|
26
|
+
- No expansion of the credential/gate surface without an accepted RFC.
|
|
27
|
+
- No domain-specific or deployment-specific content — this is a generic primitive.
|
|
28
|
+
- Sign off with the Developer Certificate of Origin (DCO).
|
|
29
|
+
|
|
30
|
+
## Attribution
|
|
31
|
+
|
|
32
|
+
Composes sm-arp (ARP + VRP) and the sm-conformance signing pattern. Acronyms are
|
|
33
|
+
expanded in [`GLOSSARY.md`](./GLOSSARY.md).
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
Built at [labs.stellarminds.ai](https://labs.stellarminds.ai).
|
sm_parc-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 stellarminds.ai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sm_parc-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sm-parc
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Portable Agent Reputation Credential — a verifiable, recomputable reputation VC consumed at chapter admission
|
|
5
|
+
Project-URL: Homepage, https://labs.stellarminds.ai
|
|
6
|
+
Project-URL: Repository, https://github.com/Sharathvc23/sm-parc
|
|
7
|
+
Project-URL: Documentation, https://github.com/Sharathvc23/sm-parc/blob/main/docs/WALKTHROUGH.md
|
|
8
|
+
Project-URL: Live demo, https://demoparc.stellarminds.ai
|
|
9
|
+
Author: labs.stellarminds.ai
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agent,did,ed25519,nanda,reputation,trust,verifiable-credential
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Security :: Cryptography
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: base58>=2.1
|
|
23
|
+
Requires-Dist: cryptography>=41.0
|
|
24
|
+
Requires-Dist: jcs<0.3,>=0.2
|
|
25
|
+
Requires-Dist: sm-arp<0.3,>=0.2.3
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: coverage>=7.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# PARC — Portable Agent Reputation Credential
|
|
34
|
+
|
|
35
|
+
**A verifiable, recomputable reputation Verifiable Credential consumed at chapter admission**
|
|
36
|
+
|
|
37
|
+
Agent reputation today is siloed: each platform (or chapter) holds its own scores, and
|
|
38
|
+
an agent that moves to a new trust domain starts from zero. PARC makes reputation
|
|
39
|
+
**portable**. It wraps a [Verifiable Receipts Profile (VRP)](https://github.com/Sharathvc23/sm-arp)
|
|
40
|
+
Receipts Ledger's commitment + scores — a `behavioral_merkle_root` plus the reproducible,
|
|
41
|
+
corroborated `nanda-rep/0.2` `reputation_score` / `validity_rate` / `corroboration_rate` —
|
|
42
|
+
as a W3C Verifiable Credential, signed by the originating chapter or a credentialed
|
|
43
|
+
auditor. A new chapter consumes it at admission: it verifies the signature and
|
|
44
|
+
**recomputes the ledger itself**, so it never has to trust the issuing chapter's live server.
|
|
45
|
+
|
|
46
|
+
The one thing PARC owns: the **credential envelope + the admission gate**. The commitment
|
|
47
|
+
and scoring are VRP's; PARC makes them carriable and checkable across trust domains.
|
|
48
|
+
|
|
49
|
+
## See it live
|
|
50
|
+
|
|
51
|
+
**▶︎ [demoparc.stellarminds.ai](https://demoparc.stellarminds.ai)** — an interactive viewer
|
|
52
|
+
that **re-verifies every signature and Merkle proof in your browser** (no server trusted).
|
|
53
|
+
Switch between the *Admission* and *Three-city journey* tabs; click any credential, agent,
|
|
54
|
+
or receipt to inspect it.
|
|
55
|
+
|
|
56
|
+
<p align="center">
|
|
57
|
+
<img src="docs/images/journey-workflow.gif" alt="PARC viewer walkthrough: the three-city journey, a Merkle inclusion proof, and a stop's signed credential" width="760">
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
A full picture-by-picture tour is in [`docs/WALKTHROUGH.md`](./docs/WALKTHROUGH.md).
|
|
61
|
+
|
|
62
|
+
## What this package secures (parc/0.1)
|
|
63
|
+
|
|
64
|
+
- **Verifiable.** A reputation credential is a W3C VC with an Ed25519 proof over the
|
|
65
|
+
JCS-canonical credential — the same signing path as Agency Receipt Protocol (ARP)
|
|
66
|
+
receipts and Delegated Authority Tokens (DATs).
|
|
67
|
+
- **Recomputable, not asserted.** The admission gate recomputes the
|
|
68
|
+
`behavioral_merkle_root` and the `nanda-rep/0.2` scores from the presented ledger and
|
|
69
|
+
rejects any divergence — a signed-but-inflated score cannot pass.
|
|
70
|
+
- **Collusion-resistant.** The gate admits only on the corroborated `nanda-rep/0.2`
|
|
71
|
+
score: a credential carrying the un-corroborated `nanda-rep/0.1` score is rejected, and
|
|
72
|
+
a wash-trading ring's self-dealt receipts are severed to a score of ~0, so it fails the
|
|
73
|
+
threshold.
|
|
74
|
+
- **Adversarially tested.** Hostile-path tests for: tampered credential, untrusted issuer,
|
|
75
|
+
tampered ledger (root mismatch), issuer-inflated-and-re-signed score (score mismatch),
|
|
76
|
+
0.1-facet rejection, un-corroborated/severed score, below-threshold, stale, revoked,
|
|
77
|
+
wrong-mode, and refs-only (non-recomputable).
|
|
78
|
+
|
|
79
|
+
A **valid signature is not admission** — the gate trusts the issuer's key, then recomputes
|
|
80
|
+
the score and applies its own threshold, so a genuinely-signed wash credential is still
|
|
81
|
+
rejected:
|
|
82
|
+
|
|
83
|
+
<p align="center">
|
|
84
|
+
<img src="docs/images/passport-drawer.png" alt="The passport drawer: signature verified (green) but admission rejected (red) — score 0 below threshold" width="380">
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
## Two admission modes
|
|
88
|
+
|
|
89
|
+
- **Inline** (`admit`) — the credential carries the subject's own receipts; the gate
|
|
90
|
+
recomputes them fully offline. Catches self-dealing, but a single-subject graph is a
|
|
91
|
+
star, so it *cannot* show an N-party collusion ring.
|
|
92
|
+
- **Pointer** (`admit_over_published_ledger`) — the credential names a published community
|
|
93
|
+
ledger (`credentialSubject.ledger_uri`); the gate fetches it, checks it against the
|
|
94
|
+
signed root, and **re-runs the collusion severance itself**, deriving the subject's
|
|
95
|
+
severed score over the full graph. This catches N-party Sybil rings — at the cost of
|
|
96
|
+
fetching the issuer's whole ledger (privacy + availability), and a residual that moves
|
|
97
|
+
to *ledger completeness*. See
|
|
98
|
+
[`examples/published_ledger_admission.py`](./examples/published_ledger_admission.py) and
|
|
99
|
+
[`THREATMODEL.md`](./THREATMODEL.md).
|
|
100
|
+
|
|
101
|
+
## One passport, three worlds
|
|
102
|
+
|
|
103
|
+
A single agent earns reputation transacting across a **community**, a **marketplace**, and
|
|
104
|
+
an **enterprise**, carrying one PARC. Its corroborated score **compounds** as it goes — and
|
|
105
|
+
that accumulated reputation is what opens the high-bar enterprise gate (shown cold, the
|
|
106
|
+
same agent is rejected). Transactions, portability, and security in one picture:
|
|
107
|
+
|
|
108
|
+
<p align="center">
|
|
109
|
+
<img src="docs/images/journey.png" alt="The A→B→C journey: scores compound 60→130→200 against rising admission bars, all admitted" width="820">
|
|
110
|
+
</p>
|
|
111
|
+
|
|
112
|
+
And when the ledger grows too large to hand over, the agent reveals **only the receipts
|
|
113
|
+
worth showing** plus a **Merkle inclusion proof** for each — confirmed under the signed
|
|
114
|
+
root without exposing the rest:
|
|
115
|
+
|
|
116
|
+
<p align="center">
|
|
117
|
+
<img src="docs/images/selective-disclosure.png" alt="Selective disclosure: 3 of 40 receipts revealed, each with its Merkle inclusion proof verifying to the signed root" width="820">
|
|
118
|
+
</p>
|
|
119
|
+
|
|
120
|
+
Runnable: [`examples/three_city_economy.py`](./examples/three_city_economy.py).
|
|
121
|
+
|
|
122
|
+
## What this package does NOT (yet) do
|
|
123
|
+
|
|
124
|
+
- **Run the auditor.** PARC *verifies* an auditor's attestation; who computes and signs it
|
|
125
|
+
is deployment policy — the consumer's responsibility.
|
|
126
|
+
- **Catch a *curated* ledger.** Pointer mode re-severs only what the issuer published; a
|
|
127
|
+
colluding issuer that omits the honest anchor defeats it. Closing that needs an
|
|
128
|
+
independent receipt source (cross-attestation), not the published ledger.
|
|
129
|
+
- **Unlinkable disclosure.** Selective disclosure of *which receipts happened* ships today
|
|
130
|
+
via Merkle inclusion proofs (below); an unlinkable / BBS+ variant and a zero-knowledge
|
|
131
|
+
*score* proof are future properties; see [`SPEC.md`](./SPEC.md).
|
|
132
|
+
|
|
133
|
+
## Features
|
|
134
|
+
|
|
135
|
+
- `build_reputation_credential(...)` / `verify_credential_proof(...)` — issue + verify the VC.
|
|
136
|
+
- `AdmissionPolicy` + `admit(...)` — the inline chapter-admission gate (signature →
|
|
137
|
+
trusted issuer → revocation/freshness → recompute root + scores → thresholds).
|
|
138
|
+
- `admit_over_published_ledger(...)` + `subject_severed_score(...)` — the pointer-mode
|
|
139
|
+
gate: fetch the named ledger, re-verify the root, and derive the subject's
|
|
140
|
+
collusion-severed score over the full community graph.
|
|
141
|
+
- `inclusion_proof(...)` + `verify_inclusion(...)` — **selective disclosure**: reveal a few
|
|
142
|
+
receipts of a large ledger plus a Merkle inclusion proof for each, confirmed under the
|
|
143
|
+
credential's signed root without exposing the rest.
|
|
144
|
+
|
|
145
|
+
## Installation
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
pip install sm-parc # depends on sm-arp>=0.2.3,<0.3 (carries sm_arp.vrp)
|
|
149
|
+
# working draft: pip install git+https://github.com/Sharathvc23/sm-parc.git
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Quick start
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from sm_arp.vrp import build_ledger
|
|
156
|
+
from sm_parc import build_reputation_credential, AdmissionPolicy, admit
|
|
157
|
+
|
|
158
|
+
# Issuer (chapter or auditor) builds a corroborated nanda-rep/0.2 ledger from an
|
|
159
|
+
# agent's receipts, then a parc/0.1 VC over it.
|
|
160
|
+
ledger = build_ledger(subject=agent_did, receipts=receipts, method="nanda-rep/0.2",
|
|
161
|
+
is_valid=lambda r: verify_receipt(r).ok, as_of="2026-06-07T00:00:00Z")
|
|
162
|
+
vc = build_reputation_credential(ledger=ledger, issuer_sk=chapter_sk,
|
|
163
|
+
valid_from="2026-06-07T00:00:00Z",
|
|
164
|
+
valid_until="2026-07-07T00:00:00Z")
|
|
165
|
+
|
|
166
|
+
# A new chapter admits the agent — verifies the signature AND recomputes the ledger.
|
|
167
|
+
policy = AdmissionPolicy(trusted_issuers={chapter_did}, min_reputation_score=50.0)
|
|
168
|
+
result = admit(vc, policy=policy, ledger=ledger, is_valid=lambda r: verify_receipt(r).ok)
|
|
169
|
+
assert result.ok # admitted, without trusting the issuing chapter's server
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
See [`examples/mint_and_admit.py`](./examples/mint_and_admit.py) for a runnable end-to-end
|
|
173
|
+
demo (honest corroborated agent admitted; wash-trade agent rejected).
|
|
174
|
+
|
|
175
|
+
## Reference fixtures
|
|
176
|
+
|
|
177
|
+
The behavioural suite under `tests/` builds ledgers + credentials with deterministic test
|
|
178
|
+
keys and exercises every admission outcome. The suite IS the spec (see
|
|
179
|
+
[`GOVERNANCE.md`](./GOVERNANCE.md)); placeholder keys are test-only.
|
|
180
|
+
|
|
181
|
+
## Documentation
|
|
182
|
+
|
|
183
|
+
- [`docs/WALKTHROUGH.md`](./docs/WALKTHROUGH.md) — illustrated tour of the viewer + the mechanisms.
|
|
184
|
+
- [`SPEC.md`](./SPEC.md) — normative credential + admission profile (working draft).
|
|
185
|
+
- [`WHITEPAPER.md`](./WHITEPAPER.md) — design rationale.
|
|
186
|
+
- [`THREATMODEL.md`](./THREATMODEL.md) — what the gate does and does **not** defend.
|
|
187
|
+
- [`GLOSSARY.md`](./GLOSSARY.md) — every acronym (ARP, VRP, PARC, DAT, …) expanded.
|
|
188
|
+
|
|
189
|
+
## Related packages
|
|
190
|
+
|
|
191
|
+
| Package | Role |
|
|
192
|
+
| --- | --- |
|
|
193
|
+
| [`sm-arp`](https://github.com/Sharathvc23/sm-arp) | Agency Receipts + the VRP core (`sm_arp.vrp`) PARC composes |
|
|
194
|
+
| [`sm-conformance`](https://github.com/Sharathvc23/sm-conformance) | the signed-badge / signing infrastructure pattern |
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
[MIT](./LICENSE)
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
Built at [labs.stellarminds.ai](https://labs.stellarminds.ai).
|
|
203
|
+
|
|
204
|
+
*First published: 2026-06-07 | Last modified: 2026-06-21*
|
sm_parc-0.2.0/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# PARC — Portable Agent Reputation Credential
|
|
2
|
+
|
|
3
|
+
**A verifiable, recomputable reputation Verifiable Credential consumed at chapter admission**
|
|
4
|
+
|
|
5
|
+
Agent reputation today is siloed: each platform (or chapter) holds its own scores, and
|
|
6
|
+
an agent that moves to a new trust domain starts from zero. PARC makes reputation
|
|
7
|
+
**portable**. It wraps a [Verifiable Receipts Profile (VRP)](https://github.com/Sharathvc23/sm-arp)
|
|
8
|
+
Receipts Ledger's commitment + scores — a `behavioral_merkle_root` plus the reproducible,
|
|
9
|
+
corroborated `nanda-rep/0.2` `reputation_score` / `validity_rate` / `corroboration_rate` —
|
|
10
|
+
as a W3C Verifiable Credential, signed by the originating chapter or a credentialed
|
|
11
|
+
auditor. A new chapter consumes it at admission: it verifies the signature and
|
|
12
|
+
**recomputes the ledger itself**, so it never has to trust the issuing chapter's live server.
|
|
13
|
+
|
|
14
|
+
The one thing PARC owns: the **credential envelope + the admission gate**. The commitment
|
|
15
|
+
and scoring are VRP's; PARC makes them carriable and checkable across trust domains.
|
|
16
|
+
|
|
17
|
+
## See it live
|
|
18
|
+
|
|
19
|
+
**▶︎ [demoparc.stellarminds.ai](https://demoparc.stellarminds.ai)** — an interactive viewer
|
|
20
|
+
that **re-verifies every signature and Merkle proof in your browser** (no server trusted).
|
|
21
|
+
Switch between the *Admission* and *Three-city journey* tabs; click any credential, agent,
|
|
22
|
+
or receipt to inspect it.
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="docs/images/journey-workflow.gif" alt="PARC viewer walkthrough: the three-city journey, a Merkle inclusion proof, and a stop's signed credential" width="760">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
A full picture-by-picture tour is in [`docs/WALKTHROUGH.md`](./docs/WALKTHROUGH.md).
|
|
29
|
+
|
|
30
|
+
## What this package secures (parc/0.1)
|
|
31
|
+
|
|
32
|
+
- **Verifiable.** A reputation credential is a W3C VC with an Ed25519 proof over the
|
|
33
|
+
JCS-canonical credential — the same signing path as Agency Receipt Protocol (ARP)
|
|
34
|
+
receipts and Delegated Authority Tokens (DATs).
|
|
35
|
+
- **Recomputable, not asserted.** The admission gate recomputes the
|
|
36
|
+
`behavioral_merkle_root` and the `nanda-rep/0.2` scores from the presented ledger and
|
|
37
|
+
rejects any divergence — a signed-but-inflated score cannot pass.
|
|
38
|
+
- **Collusion-resistant.** The gate admits only on the corroborated `nanda-rep/0.2`
|
|
39
|
+
score: a credential carrying the un-corroborated `nanda-rep/0.1` score is rejected, and
|
|
40
|
+
a wash-trading ring's self-dealt receipts are severed to a score of ~0, so it fails the
|
|
41
|
+
threshold.
|
|
42
|
+
- **Adversarially tested.** Hostile-path tests for: tampered credential, untrusted issuer,
|
|
43
|
+
tampered ledger (root mismatch), issuer-inflated-and-re-signed score (score mismatch),
|
|
44
|
+
0.1-facet rejection, un-corroborated/severed score, below-threshold, stale, revoked,
|
|
45
|
+
wrong-mode, and refs-only (non-recomputable).
|
|
46
|
+
|
|
47
|
+
A **valid signature is not admission** — the gate trusts the issuer's key, then recomputes
|
|
48
|
+
the score and applies its own threshold, so a genuinely-signed wash credential is still
|
|
49
|
+
rejected:
|
|
50
|
+
|
|
51
|
+
<p align="center">
|
|
52
|
+
<img src="docs/images/passport-drawer.png" alt="The passport drawer: signature verified (green) but admission rejected (red) — score 0 below threshold" width="380">
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
## Two admission modes
|
|
56
|
+
|
|
57
|
+
- **Inline** (`admit`) — the credential carries the subject's own receipts; the gate
|
|
58
|
+
recomputes them fully offline. Catches self-dealing, but a single-subject graph is a
|
|
59
|
+
star, so it *cannot* show an N-party collusion ring.
|
|
60
|
+
- **Pointer** (`admit_over_published_ledger`) — the credential names a published community
|
|
61
|
+
ledger (`credentialSubject.ledger_uri`); the gate fetches it, checks it against the
|
|
62
|
+
signed root, and **re-runs the collusion severance itself**, deriving the subject's
|
|
63
|
+
severed score over the full graph. This catches N-party Sybil rings — at the cost of
|
|
64
|
+
fetching the issuer's whole ledger (privacy + availability), and a residual that moves
|
|
65
|
+
to *ledger completeness*. See
|
|
66
|
+
[`examples/published_ledger_admission.py`](./examples/published_ledger_admission.py) and
|
|
67
|
+
[`THREATMODEL.md`](./THREATMODEL.md).
|
|
68
|
+
|
|
69
|
+
## One passport, three worlds
|
|
70
|
+
|
|
71
|
+
A single agent earns reputation transacting across a **community**, a **marketplace**, and
|
|
72
|
+
an **enterprise**, carrying one PARC. Its corroborated score **compounds** as it goes — and
|
|
73
|
+
that accumulated reputation is what opens the high-bar enterprise gate (shown cold, the
|
|
74
|
+
same agent is rejected). Transactions, portability, and security in one picture:
|
|
75
|
+
|
|
76
|
+
<p align="center">
|
|
77
|
+
<img src="docs/images/journey.png" alt="The A→B→C journey: scores compound 60→130→200 against rising admission bars, all admitted" width="820">
|
|
78
|
+
</p>
|
|
79
|
+
|
|
80
|
+
And when the ledger grows too large to hand over, the agent reveals **only the receipts
|
|
81
|
+
worth showing** plus a **Merkle inclusion proof** for each — confirmed under the signed
|
|
82
|
+
root without exposing the rest:
|
|
83
|
+
|
|
84
|
+
<p align="center">
|
|
85
|
+
<img src="docs/images/selective-disclosure.png" alt="Selective disclosure: 3 of 40 receipts revealed, each with its Merkle inclusion proof verifying to the signed root" width="820">
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
Runnable: [`examples/three_city_economy.py`](./examples/three_city_economy.py).
|
|
89
|
+
|
|
90
|
+
## What this package does NOT (yet) do
|
|
91
|
+
|
|
92
|
+
- **Run the auditor.** PARC *verifies* an auditor's attestation; who computes and signs it
|
|
93
|
+
is deployment policy — the consumer's responsibility.
|
|
94
|
+
- **Catch a *curated* ledger.** Pointer mode re-severs only what the issuer published; a
|
|
95
|
+
colluding issuer that omits the honest anchor defeats it. Closing that needs an
|
|
96
|
+
independent receipt source (cross-attestation), not the published ledger.
|
|
97
|
+
- **Unlinkable disclosure.** Selective disclosure of *which receipts happened* ships today
|
|
98
|
+
via Merkle inclusion proofs (below); an unlinkable / BBS+ variant and a zero-knowledge
|
|
99
|
+
*score* proof are future properties; see [`SPEC.md`](./SPEC.md).
|
|
100
|
+
|
|
101
|
+
## Features
|
|
102
|
+
|
|
103
|
+
- `build_reputation_credential(...)` / `verify_credential_proof(...)` — issue + verify the VC.
|
|
104
|
+
- `AdmissionPolicy` + `admit(...)` — the inline chapter-admission gate (signature →
|
|
105
|
+
trusted issuer → revocation/freshness → recompute root + scores → thresholds).
|
|
106
|
+
- `admit_over_published_ledger(...)` + `subject_severed_score(...)` — the pointer-mode
|
|
107
|
+
gate: fetch the named ledger, re-verify the root, and derive the subject's
|
|
108
|
+
collusion-severed score over the full community graph.
|
|
109
|
+
- `inclusion_proof(...)` + `verify_inclusion(...)` — **selective disclosure**: reveal a few
|
|
110
|
+
receipts of a large ledger plus a Merkle inclusion proof for each, confirmed under the
|
|
111
|
+
credential's signed root without exposing the rest.
|
|
112
|
+
|
|
113
|
+
## Installation
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pip install sm-parc # depends on sm-arp>=0.2.3,<0.3 (carries sm_arp.vrp)
|
|
117
|
+
# working draft: pip install git+https://github.com/Sharathvc23/sm-parc.git
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Quick start
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
from sm_arp.vrp import build_ledger
|
|
124
|
+
from sm_parc import build_reputation_credential, AdmissionPolicy, admit
|
|
125
|
+
|
|
126
|
+
# Issuer (chapter or auditor) builds a corroborated nanda-rep/0.2 ledger from an
|
|
127
|
+
# agent's receipts, then a parc/0.1 VC over it.
|
|
128
|
+
ledger = build_ledger(subject=agent_did, receipts=receipts, method="nanda-rep/0.2",
|
|
129
|
+
is_valid=lambda r: verify_receipt(r).ok, as_of="2026-06-07T00:00:00Z")
|
|
130
|
+
vc = build_reputation_credential(ledger=ledger, issuer_sk=chapter_sk,
|
|
131
|
+
valid_from="2026-06-07T00:00:00Z",
|
|
132
|
+
valid_until="2026-07-07T00:00:00Z")
|
|
133
|
+
|
|
134
|
+
# A new chapter admits the agent — verifies the signature AND recomputes the ledger.
|
|
135
|
+
policy = AdmissionPolicy(trusted_issuers={chapter_did}, min_reputation_score=50.0)
|
|
136
|
+
result = admit(vc, policy=policy, ledger=ledger, is_valid=lambda r: verify_receipt(r).ok)
|
|
137
|
+
assert result.ok # admitted, without trusting the issuing chapter's server
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
See [`examples/mint_and_admit.py`](./examples/mint_and_admit.py) for a runnable end-to-end
|
|
141
|
+
demo (honest corroborated agent admitted; wash-trade agent rejected).
|
|
142
|
+
|
|
143
|
+
## Reference fixtures
|
|
144
|
+
|
|
145
|
+
The behavioural suite under `tests/` builds ledgers + credentials with deterministic test
|
|
146
|
+
keys and exercises every admission outcome. The suite IS the spec (see
|
|
147
|
+
[`GOVERNANCE.md`](./GOVERNANCE.md)); placeholder keys are test-only.
|
|
148
|
+
|
|
149
|
+
## Documentation
|
|
150
|
+
|
|
151
|
+
- [`docs/WALKTHROUGH.md`](./docs/WALKTHROUGH.md) — illustrated tour of the viewer + the mechanisms.
|
|
152
|
+
- [`SPEC.md`](./SPEC.md) — normative credential + admission profile (working draft).
|
|
153
|
+
- [`WHITEPAPER.md`](./WHITEPAPER.md) — design rationale.
|
|
154
|
+
- [`THREATMODEL.md`](./THREATMODEL.md) — what the gate does and does **not** defend.
|
|
155
|
+
- [`GLOSSARY.md`](./GLOSSARY.md) — every acronym (ARP, VRP, PARC, DAT, …) expanded.
|
|
156
|
+
|
|
157
|
+
## Related packages
|
|
158
|
+
|
|
159
|
+
| Package | Role |
|
|
160
|
+
| --- | --- |
|
|
161
|
+
| [`sm-arp`](https://github.com/Sharathvc23/sm-arp) | Agency Receipts + the VRP core (`sm_arp.vrp`) PARC composes |
|
|
162
|
+
| [`sm-conformance`](https://github.com/Sharathvc23/sm-conformance) | the signed-badge / signing infrastructure pattern |
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
[MIT](./LICENSE)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
Built at [labs.stellarminds.ai](https://labs.stellarminds.ai).
|
|
171
|
+
|
|
172
|
+
*First published: 2026-06-07 | Last modified: 2026-06-21*
|