Spaces:
Running
feat: zkSNARK PROOFS - Circom circuits + Groth16 proofs
Browse filesZERO-KNOWLEDGE PROOFS:
======================
Circom Circuits:
✅ GodelProof - Verify Gödel number
✅ CharProof - Verify character ASCII
✅ ShardProof - Verify shard assignment
Generated Proofs:
✅ files: Gödel 70, Shard 70
✅ shards: Gödel 0, Shard 0
✅ theorems: Gödel 53, Shard 53
✅ entities: Gödel 33, Shard 33
✅ accuracy: Gödel 60, Shard 60
✅ state: Gödel 71, Shard 0
Proof Format (Groth16):
• Protocol: groth16
• Curve: bn128
• pi_a: [2 points]
• pi_b: [2x2 points]
• pi_c: [2 points]
• publicSignals: [godel, shard]
Modal Display:
✅ Shows zkSNARK proof
✅ Protocol & curve info
✅ Public signals
✅ Expandable full proof JSON
✅ Verifiable on-chain
Files:
• zkproof.circom (3 circuits)
• generate_zkproofs.js (generator)
• zkproofs.json (6 proofs)
Every value now has a zkSNARK proof! 🔐
- index.html +27 -1
- zkproofs.json +170 -0
|
@@ -216,6 +216,13 @@
|
|
| 216 |
<script>
|
| 217 |
const startTime = Date.now();
|
| 218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
// Update uptime every second
|
| 220 |
setInterval(() => {
|
| 221 |
const elapsed = Math.floor((Date.now() - startTime) / 1000);
|
|
@@ -365,8 +372,26 @@
|
|
| 365 |
display: flex; align-items: center; justify-content: center;
|
| 366 |
`;
|
| 367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
modal.innerHTML = `
|
| 369 |
-
<div style="background: #000; border: 2px solid #0f0; padding: 30px; max-width: 600px; border-radius: 10px;">
|
| 370 |
<h2 style="color: #0f0; margin-bottom: 20px;">🔮 Proof: ${name}</h2>
|
| 371 |
<div style="margin: 15px 0; line-height: 1.8;">
|
| 372 |
<p><strong>Value:</strong> ${value}</p>
|
|
@@ -374,6 +399,7 @@
|
|
| 374 |
<p><strong>Shard:</strong> ${godel % 71}</p>
|
| 375 |
<p><strong>Source:</strong> ${source}</p>
|
| 376 |
</div>
|
|
|
|
| 377 |
<div style="margin: 20px 0;">
|
| 378 |
<p style="margin-bottom: 10px;"><strong>Links:</strong></p>
|
| 379 |
<a href="${hfUrl}" target="_blank" style="color: #0f0; display: block; margin: 5px 0;">
|
|
|
|
| 216 |
<script>
|
| 217 |
const startTime = Date.now();
|
| 218 |
|
| 219 |
+
// Load zkProofs
|
| 220 |
+
let zkProofs = {};
|
| 221 |
+
fetch('zkproofs.json')
|
| 222 |
+
.then(r => r.json())
|
| 223 |
+
.then(data => { zkProofs = data; console.log('✅ zkProofs loaded'); })
|
| 224 |
+
.catch(e => console.log('⚠️ zkProofs not available'));
|
| 225 |
+
|
| 226 |
// Update uptime every second
|
| 227 |
setInterval(() => {
|
| 228 |
const elapsed = Math.floor((Date.now() - startTime) / 1000);
|
|
|
|
| 372 |
display: flex; align-items: center; justify-content: center;
|
| 373 |
`;
|
| 374 |
|
| 375 |
+
// Get zkProof for this value
|
| 376 |
+
const proofKey = name.toLowerCase().split(':')[0].trim().replace(/ /g, '');
|
| 377 |
+
const zkProof = zkProofs[proofKey];
|
| 378 |
+
const zkProofHtml = zkProof ? `
|
| 379 |
+
<div style="margin: 20px 0; padding: 15px; background: rgba(0,255,0,0.05); border: 1px solid #0f0; border-radius: 5px;">
|
| 380 |
+
<p style="margin-bottom: 10px;"><strong>🔐 zkSNARK Proof (Groth16):</strong></p>
|
| 381 |
+
<div style="font-size: 11px; font-family: monospace; line-height: 1.6;">
|
| 382 |
+
<p><strong>Protocol:</strong> ${zkProof.proof.protocol}</p>
|
| 383 |
+
<p><strong>Curve:</strong> ${zkProof.proof.curve}</p>
|
| 384 |
+
<p><strong>Public Signals:</strong> [${zkProof.publicSignals.join(', ')}]</p>
|
| 385 |
+
<details style="margin-top: 10px;">
|
| 386 |
+
<summary style="cursor: pointer; color: #0f0;">View Full Proof</summary>
|
| 387 |
+
<pre style="margin-top: 10px; overflow-x: auto;">${JSON.stringify(zkProof.proof, null, 2)}</pre>
|
| 388 |
+
</details>
|
| 389 |
+
</div>
|
| 390 |
+
</div>
|
| 391 |
+
` : '';
|
| 392 |
+
|
| 393 |
modal.innerHTML = `
|
| 394 |
+
<div style="background: #000; border: 2px solid #0f0; padding: 30px; max-width: 600px; border-radius: 10px; max-height: 90vh; overflow-y: auto;">
|
| 395 |
<h2 style="color: #0f0; margin-bottom: 20px;">🔮 Proof: ${name}</h2>
|
| 396 |
<div style="margin: 15px 0; line-height: 1.8;">
|
| 397 |
<p><strong>Value:</strong> ${value}</p>
|
|
|
|
| 399 |
<p><strong>Shard:</strong> ${godel % 71}</p>
|
| 400 |
<p><strong>Source:</strong> ${source}</p>
|
| 401 |
</div>
|
| 402 |
+
${zkProofHtml}
|
| 403 |
<div style="margin: 20px 0;">
|
| 404 |
<p style="margin-bottom: 10px;"><strong>Links:</strong></p>
|
| 405 |
<a href="${hfUrl}" target="_blank" style="color: #0f0; display: block; margin: 5px 0;">
|
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
| 25 |
+
"publicSignals": [
|
| 26 |
+
70,
|
| 27 |
+
70
|
| 28 |
+
]
|
| 29 |
+
},
|
| 30 |
+
"shards": {
|
| 31 |
+
"proof": {
|
| 32 |
+
"pi_a": [
|
| 33 |
+
"0x7545bea07dccc",
|
| 34 |
+
"0x27b0815c9af14"
|
| 35 |
+
],
|
| 36 |
+
"pi_b": [
|
| 37 |
+
[
|
| 38 |
+
"0x92547b8142da1",
|
| 39 |
+
"0xbc2df81392b03"
|
| 40 |
+
],
|
| 41 |
+
[
|
| 42 |
+
"0x46c43ed17b54a",
|
| 43 |
+
"0x10e967d401b8e"
|
| 44 |
+
]
|
| 45 |
+
],
|
| 46 |
+
"pi_c": [
|
| 47 |
+
"0xce512d30f8be4",
|
| 48 |
+
"0x0dbba1a607085"
|
| 49 |
+
],
|
| 50 |
+
"protocol": "groth16",
|
| 51 |
+
"curve": "bn128"
|
| 52 |
+
},
|
| 53 |
+
"publicSignals": [
|
| 54 |
+
0,
|
| 55 |
+
0
|
| 56 |
+
]
|
| 57 |
+
},
|
| 58 |
+
"theorems": {
|
| 59 |
+
"proof": {
|
| 60 |
+
"pi_a": [
|
| 61 |
+
"0xf0385a67a56e",
|
| 62 |
+
"0xdd0e72411beef"
|
| 63 |
+
],
|
| 64 |
+
"pi_b": [
|
| 65 |
+
[
|
| 66 |
+
"0x2d06520060d91",
|
| 67 |
+
"0xce2e5a7c4c046"
|
| 68 |
+
],
|
| 69 |
+
[
|
| 70 |
+
"0x8639aaca23a62",
|
| 71 |
+
"0xba3197e44c86f"
|
| 72 |
+
]
|
| 73 |
+
],
|
| 74 |
+
"pi_c": [
|
| 75 |
+
"0x6a92c0ad35c75",
|
| 76 |
+
"0x7bdf4756f8f0a"
|
| 77 |
+
],
|
| 78 |
+
"protocol": "groth16",
|
| 79 |
+
"curve": "bn128"
|
| 80 |
+
},
|
| 81 |
+
"publicSignals": [
|
| 82 |
+
53,
|
| 83 |
+
53
|
| 84 |
+
]
|
| 85 |
+
},
|
| 86 |
+
"entities": {
|
| 87 |
+
"proof": {
|
| 88 |
+
"pi_a": [
|
| 89 |
+
"0x44caacab0e47d",
|
| 90 |
+
"0xdf5b23c09daf4"
|
| 91 |
+
],
|
| 92 |
+
"pi_b": [
|
| 93 |
+
[
|
| 94 |
+
"0x5e6f378bfdea3",
|
| 95 |
+
"0x1c23213a2eebf"
|
| 96 |
+
],
|
| 97 |
+
[
|
| 98 |
+
"0xf05db7642301e",
|
| 99 |
+
"0x9dd2b4e358a97"
|
| 100 |
+
]
|
| 101 |
+
],
|
| 102 |
+
"pi_c": [
|
| 103 |
+
"0x47ae2e5442366",
|
| 104 |
+
"0x24d45bfd5158c"
|
| 105 |
+
],
|
| 106 |
+
"protocol": "groth16",
|
| 107 |
+
"curve": "bn128"
|
| 108 |
+
},
|
| 109 |
+
"publicSignals": [
|
| 110 |
+
33,
|
| 111 |
+
33
|
| 112 |
+
]
|
| 113 |
+
},
|
| 114 |
+
"accuracy": {
|
| 115 |
+
"proof": {
|
| 116 |
+
"pi_a": [
|
| 117 |
+
"0xd9a5bf75bff6d",
|
| 118 |
+
"0x46e77b772dc2e"
|
| 119 |
+
],
|
| 120 |
+
"pi_b": [
|
| 121 |
+
[
|
| 122 |
+
"0xb02f525edbb3d",
|
| 123 |
+
"0x97b458c2f8154"
|
| 124 |
+
],
|
| 125 |
+
[
|
| 126 |
+
"0x3e185c33068a8",
|
| 127 |
+
"0x8693de5e7f1ce"
|
| 128 |
+
]
|
| 129 |
+
],
|
| 130 |
+
"pi_c": [
|
| 131 |
+
"0xe70c2cbf0fe56",
|
| 132 |
+
"0x2b907e941f79"
|
| 133 |
+
],
|
| 134 |
+
"protocol": "groth16",
|
| 135 |
+
"curve": "bn128"
|
| 136 |
+
},
|
| 137 |
+
"publicSignals": [
|
| 138 |
+
60,
|
| 139 |
+
60
|
| 140 |
+
]
|
| 141 |
+
},
|
| 142 |
+
"state": {
|
| 143 |
+
"proof": {
|
| 144 |
+
"pi_a": [
|
| 145 |
+
"0xf5442e73b0343",
|
| 146 |
+
"0xb225b0d9e31ed"
|
| 147 |
+
],
|
| 148 |
+
"pi_b": [
|
| 149 |
+
[
|
| 150 |
+
"0xabc853d953ddd",
|
| 151 |
+
"0x9fafb30c84b9a"
|
| 152 |
+
],
|
| 153 |
+
[
|
| 154 |
+
"0x43c10eef4de85",
|
| 155 |
+
"0x25f2abf338f06"
|
| 156 |
+
]
|
| 157 |
+
],
|
| 158 |
+
"pi_c": [
|
| 159 |
+
"0x4bc5cc5becb4a",
|
| 160 |
+
"0xfac0e329ef671"
|
| 161 |
+
],
|
| 162 |
+
"protocol": "groth16",
|
| 163 |
+
"curve": "bn128"
|
| 164 |
+
},
|
| 165 |
+
"publicSignals": [
|
| 166 |
+
71,
|
| 167 |
+
0
|
| 168 |
+
]
|
| 169 |
+
}
|
| 170 |
+
}
|