reputrans 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +114 -0
- package/circuits/composite/target/composite.json +1 -0
- package/circuits/field_disclosure/target/field_disclosure.json +1 -0
- package/circuits/map_to_curve/target/map_to_curve.json +1 -0
- package/circuits/poseidon_compat/target/poseidon_compat.json +1 -0
- package/circuits/range_proof/target/range_proof.json +1 -0
- package/circuits/set_membership/target/set_membership.json +1 -0
- package/circuits/signature_verify/target/signature_verify.json +1 -0
- package/dist/cli/src/auto-detect.d.ts +9 -0
- package/dist/cli/src/auto-detect.d.ts.map +1 -0
- package/dist/cli/src/auto-detect.js +21 -0
- package/dist/cli/src/auto-detect.js.map +1 -0
- package/dist/cli/src/commands/inspect.d.ts +6 -0
- package/dist/cli/src/commands/inspect.d.ts.map +1 -0
- package/dist/cli/src/commands/inspect.js +43 -0
- package/dist/cli/src/commands/inspect.js.map +1 -0
- package/dist/cli/src/commands/issue.d.ts +8 -0
- package/dist/cli/src/commands/issue.d.ts.map +1 -0
- package/dist/cli/src/commands/issue.js +107 -0
- package/dist/cli/src/commands/issue.js.map +1 -0
- package/dist/cli/src/commands/keygen.d.ts +7 -0
- package/dist/cli/src/commands/keygen.d.ts.map +1 -0
- package/dist/cli/src/commands/keygen.js +39 -0
- package/dist/cli/src/commands/keygen.js.map +1 -0
- package/dist/cli/src/commands/prove.d.ts +9 -0
- package/dist/cli/src/commands/prove.d.ts.map +1 -0
- package/dist/cli/src/commands/prove.js +139 -0
- package/dist/cli/src/commands/prove.js.map +1 -0
- package/dist/cli/src/commands/verify.d.ts +6 -0
- package/dist/cli/src/commands/verify.d.ts.map +1 -0
- package/dist/cli/src/commands/verify.js +63 -0
- package/dist/cli/src/commands/verify.js.map +1 -0
- package/dist/cli/src/index.d.ts +3 -0
- package/dist/cli/src/index.d.ts.map +1 -0
- package/dist/cli/src/index.js +45 -0
- package/dist/cli/src/index.js.map +1 -0
- package/dist/sdk/src/circuit-loader.d.ts +19 -0
- package/dist/sdk/src/circuit-loader.d.ts.map +1 -0
- package/dist/sdk/src/circuit-loader.js +65 -0
- package/dist/sdk/src/circuit-loader.js.map +1 -0
- package/dist/sdk/src/eddsa.d.ts +63 -0
- package/dist/sdk/src/eddsa.d.ts.map +1 -0
- package/dist/sdk/src/eddsa.js +177 -0
- package/dist/sdk/src/eddsa.js.map +1 -0
- package/dist/sdk/src/encoder.d.ts +49 -0
- package/dist/sdk/src/encoder.d.ts.map +1 -0
- package/dist/sdk/src/encoder.js +117 -0
- package/dist/sdk/src/encoder.js.map +1 -0
- package/dist/sdk/src/identity.d.ts +69 -0
- package/dist/sdk/src/identity.d.ts.map +1 -0
- package/dist/sdk/src/identity.js +110 -0
- package/dist/sdk/src/identity.js.map +1 -0
- package/dist/sdk/src/index.d.ts +18 -0
- package/dist/sdk/src/index.d.ts.map +1 -0
- package/dist/sdk/src/index.js +18 -0
- package/dist/sdk/src/index.js.map +1 -0
- package/dist/sdk/src/poseidon.d.ts +33 -0
- package/dist/sdk/src/poseidon.d.ts.map +1 -0
- package/dist/sdk/src/poseidon.js +59 -0
- package/dist/sdk/src/poseidon.js.map +1 -0
- package/dist/sdk/src/proof-request.d.ts +58 -0
- package/dist/sdk/src/proof-request.d.ts.map +1 -0
- package/dist/sdk/src/proof-request.js +68 -0
- package/dist/sdk/src/proof-request.js.map +1 -0
- package/dist/sdk/src/prover.d.ts +38 -0
- package/dist/sdk/src/prover.d.ts.map +1 -0
- package/dist/sdk/src/prover.js +108 -0
- package/dist/sdk/src/prover.js.map +1 -0
- package/dist/sdk/src/vc-parser.d.ts +50 -0
- package/dist/sdk/src/vc-parser.d.ts.map +1 -0
- package/dist/sdk/src/vc-parser.js +96 -0
- package/dist/sdk/src/vc-parser.js.map +1 -0
- package/dist/sdk/src/verifier.d.ts +19 -0
- package/dist/sdk/src/verifier.d.ts.map +1 -0
- package/dist/sdk/src/verifier.js +31 -0
- package/dist/sdk/src/verifier.js.map +1 -0
- package/dist/verifier/src/did-resolver.d.ts +36 -0
- package/dist/verifier/src/did-resolver.d.ts.map +1 -0
- package/dist/verifier/src/did-resolver.js +179 -0
- package/dist/verifier/src/did-resolver.js.map +1 -0
- package/dist/verifier/src/index.d.ts +2 -0
- package/dist/verifier/src/index.d.ts.map +1 -0
- package/dist/verifier/src/index.js +9 -0
- package/dist/verifier/src/index.js.map +1 -0
- package/dist/verifier/src/server.d.ts +6 -0
- package/dist/verifier/src/server.d.ts.map +1 -0
- package/dist/verifier/src/server.js +75 -0
- package/dist/verifier/src/server.js.map +1 -0
- package/dist/verifier/src/verify.d.ts +20 -0
- package/dist/verifier/src/verify.d.ts.map +1 -0
- package/dist/verifier/src/verify.js +97 -0
- package/dist/verifier/src/verify.js.map +1 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sibrox Ltd
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# reputrans-core
|
|
2
|
+
|
|
3
|
+
Zero-knowledge credential verification for portable reputation. Issue signed credentials, generate ZK proofs about them, verify proofs without seeing the underlying data. Built on Noir circuits with Barretenberg UltraHonk proofs. 91/91 tests pass. Real cryptography, not simulations.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/danielabrahamx/reputrans-core.git
|
|
9
|
+
cd reputrans-core
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Try it - zero-argument flow
|
|
14
|
+
|
|
15
|
+
Every command auto-detects files from previous steps. Just run them in order:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 1. Generate an issuer keypair
|
|
19
|
+
npx tsx cli/src/index.ts keygen
|
|
20
|
+
|
|
21
|
+
# 2. Issue a credential (uses example data if no --claims given)
|
|
22
|
+
npx tsx cli/src/index.ts issue
|
|
23
|
+
|
|
24
|
+
# 3. See what's inside
|
|
25
|
+
npx tsx cli/src/index.ts inspect
|
|
26
|
+
|
|
27
|
+
# 4. Generate a ZK proof - prove field_of_study without revealing name or GPA
|
|
28
|
+
npx tsx cli/src/index.ts prove --disclose field_of_study
|
|
29
|
+
|
|
30
|
+
# 5. Verify the proof (works without the original credential)
|
|
31
|
+
npx tsx cli/src/index.ts verify
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Custom credentials
|
|
35
|
+
|
|
36
|
+
Create a `claims.json` file with your own fields:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"role": "engineer",
|
|
41
|
+
"clearance": "3",
|
|
42
|
+
"department": "R&D"
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then issue, prove, and verify:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx tsx cli/src/index.ts keygen --name "Acme Corp"
|
|
50
|
+
npx tsx cli/src/index.ts issue --key acme-corp-key.json --claims claims.json
|
|
51
|
+
npx tsx cli/src/index.ts prove --disclose department --range clearance:gte:2
|
|
52
|
+
npx tsx cli/src/index.ts verify
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The proof reveals only `department = "R&D"` and that `clearance >= 2`. The verifier never sees the actual clearance value or the role.
|
|
56
|
+
|
|
57
|
+
### Run tests
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm test # 91/91 pass, including real ZK proof generation
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## How it works
|
|
64
|
+
|
|
65
|
+
1. **Issuer** generates a keypair and signs claims into a credential (Poseidon Merkle tree + EdDSA signature)
|
|
66
|
+
2. **Provar** (credential holder) generates a ZK proof revealing only selected fields
|
|
67
|
+
3. **Arbiter** (verifier) checks the proof - mathematically, no trust required
|
|
68
|
+
|
|
69
|
+
The proof is portable. Verify it on any machine, via REST API, or on-chain. No blockchain needed for the basic flow.
|
|
70
|
+
|
|
71
|
+
## Architecture
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
reputrans-core/
|
|
75
|
+
circuits/ 7 Noir circuits (compiled to Barretenberg UltraHonk)
|
|
76
|
+
sdk/src/ TypeScript SDK (poseidon, eddsa, encoder, identity, prover, verifier)
|
|
77
|
+
cli/src/ CLI tool (keygen, issue, inspect, prove, verify)
|
|
78
|
+
verifier/ REST verifier service with DID resolution
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Circuits
|
|
82
|
+
|
|
83
|
+
| Circuit | Purpose | Used by CLI |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `composite` | EdDSA sig verify + Merkle selective disclosure + range proof | Yes - the main circuit |
|
|
86
|
+
| `field_disclosure` | Standalone selective disclosure | No |
|
|
87
|
+
| `range_proof` | Standalone range check | No |
|
|
88
|
+
| `set_membership` | Merkle tree membership proof | No |
|
|
89
|
+
| `signature_verify` | Standalone EdDSA verification | No |
|
|
90
|
+
| `poseidon_compat` | Cross-boundary hash validation | Testing only |
|
|
91
|
+
| `map_to_curve` | BabyJubjub point mapping | Optimization, not required |
|
|
92
|
+
|
|
93
|
+
## CLI Reference
|
|
94
|
+
|
|
95
|
+
| Command | Required args | Optional args | Auto-detects |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| `keygen` | none | `--name`, `--out` | - |
|
|
98
|
+
| `issue` | none | `--key`, `--claims`, `--out` | `*-key.json` |
|
|
99
|
+
| `inspect` | none | `--credential` | `credential-*.json` |
|
|
100
|
+
| `prove` | `--disclose` or `--range` | `--credential`, `--out` | `credential-*.json` |
|
|
101
|
+
| `verify` | none | `--proof` | `proof-*.json` |
|
|
102
|
+
|
|
103
|
+
Range format: `field:operator:threshold` (e.g. `gpa:gte:3`, `age:lte:65`)
|
|
104
|
+
|
|
105
|
+
## Protocol
|
|
106
|
+
|
|
107
|
+
- **Provar** - credential holder, generates proofs
|
|
108
|
+
- **Arbiter** - verifier of proofs
|
|
109
|
+
|
|
110
|
+
Anyone can be an issuer. The Provar does not need their own keys - the credential file contains everything needed for proof generation. Anonymous identity (master secret, nullifiers) is an upgrade path for the Enterprise product.
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|