Skip to content

Commit a9bd215

Browse files
authored
Merge pull request #127 from hyperledger-labs/move-to-buses
introducing commit input bus
2 parents 2451e53 + f29a4a6 commit a9bd215

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+869
-568
lines changed

.vscode/settings.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,37 @@
22
"yaml.format.singleQuote": false,
33
"prettier.enable": true,
44
"prettier.jsxSingleQuote": false,
5-
"yaml.format.enable": true
5+
"yaml.format.enable": true,
6+
"cSpell.words": [
7+
"babyjub",
8+
"Babyjubjub",
9+
"circom",
10+
"circomlib",
11+
"circomlibjs",
12+
"Commonlib",
13+
"ECDH",
14+
"fflonk",
15+
"Groth",
16+
"iden",
17+
"izeto",
18+
"Jubjub",
19+
"keypair",
20+
"maci",
21+
"merkletree",
22+
"ptau",
23+
"ptaus",
24+
"rapidsnark",
25+
"snarkjs",
26+
"solidityverifier",
27+
"supplypike",
28+
"tokenid",
29+
"UTXO",
30+
"UTXOs",
31+
"UTXOSMT",
32+
"UUPS",
33+
"verificationkey",
34+
"vkey",
35+
"WTNS",
36+
"zeto"
37+
]
638
}
-1.8 KB
Binary file not shown.

doc-site/docs/assets/paladin-logo-dark.svg

Lines changed: 0 additions & 15 deletions
This file was deleted.

doc-site/docs/assets/paladin-logo-light.svg

Lines changed: 0 additions & 15 deletions
This file was deleted.

doc-site/docs/assets/zeto-icon.jpeg

58.7 KB
Loading
134 KB
Loading
134 KB
Loading

doc-site/docs/assets/zeto-logo.png

1.73 MB
Loading

doc-site/docs/stylesheets/zeto.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@
4343
display: none;
4444
}
4545

46+
.md-header__button.md-logo img[alt=zeto] { height: 2rem; }
4647
img[alt=pqc] { width: 75px; border-radius: 15px; }

doc-site/mkdocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ repo_url: https://github.com/hyperledger-labs/zeto
44
theme:
55
name: material
66
custom_dir: overrides
7-
logo: assets/paladin-logo-light.svg
8-
logo_dark: assets/paladin-logo-dark.svg
9-
favicon: assets/paladin-icon-light.png
7+
logo: assets/zeto-logo-light.jpg
8+
logo_dark: assets/zeto-logo-dark.jpg
9+
favicon: assets/zeto-icon.jpg
1010
icon:
1111
repo: fontawesome/brands/github
1212
palette:

doc-site/overrides/partials/logo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
-->
2222

2323
<!-- Logo -->
24-
<img src="{{ config.theme.logo_dark | url }}#only-dark" alt="Paladin" />
25-
<img src="{{ config.theme.logo | url }}#only-light" alt="Paladin" />
24+
<img src="{{ config.theme.logo_dark | url }}#only-dark" alt="zeto" />
25+
<img src="{{ config.theme.logo | url }}#only-light" alt="zeto" />

go-sdk/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/hyperledger-labs/zeto/go-sdk
22

33
go 1.23.0
44

5-
toolchain go1.23.1
5+
toolchain go1.23.7
66

77
require (
88
github.com/iden3/go-rapidsnark/witness/wasmer v0.0.0-20230524142950-0986cf057d4e

solidity/contracts/verifiers/verifier_anon_nullifier_kyc.sol

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,26 @@ contract Groth16Verifier_AnonNullifierKyc {
4343
uint256 constant deltay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;
4444

4545

46-
uint256 constant IC0x = 17336513663167332377949169478575466284101907029078607810833872321788374659601;
47-
uint256 constant IC0y = 10397020245967735952916558183702669414774017177600319015152617686952244560097;
46+
uint256 constant IC0x = 1368020126977316196213187057636983114330468061731699977744344817587788882990;
47+
uint256 constant IC0y = 7686063895143330261591855899880142399404728944441362517893141962995856727929;
4848

4949
uint256 constant IC1x = 14502254530076089964675033671517993862419783705089359180705605116873724842019;
5050
uint256 constant IC1y = 9049190990509151956509627927047158802465613185726643157556086701266946091568;
5151

5252
uint256 constant IC2x = 3455128039314231841012773119366413118715790719104028464745205146228319556246;
5353
uint256 constant IC2y = 13175890403996370630092498196483049850968580675778268285842736204668575597675;
5454

55-
uint256 constant IC3x = 21609063410160746920311288333521282110904871128213587386326528382033849936047;
56-
uint256 constant IC3y = 19053685498975284212451452487100951511472691870576100676350891466084386725324;
55+
uint256 constant IC3x = 13393887812211802083177209056510129401898394892926768888874562627657192399962;
56+
uint256 constant IC3y = 9042351346749284573092801161759462514076637268352518870596537996458419743091;
5757

58-
uint256 constant IC4x = 20839558467714218135816548507020277920013840149039689464195289045825016957066;
59-
uint256 constant IC4y = 18171040984983395519673410253443945069876908714083596530196234237277378369754;
58+
uint256 constant IC4x = 19203333608926332054415117565053561595496895142521866494460868409916811713957;
59+
uint256 constant IC4y = 4334310208006613584617716058867417381004655491738058483537403401767079516612;
6060

61-
uint256 constant IC5x = 10186020517678246646201919013132136611100376409259802036221169773081382803557;
62-
uint256 constant IC5y = 2024398128793281448742186646024870038510529605597905826731951443459182184482;
61+
uint256 constant IC5x = 8459703094760317168584339428426828704909860684147786556335328845261416934167;
62+
uint256 constant IC5y = 5466581123301380049065739652342512947564262375698860839217249516144678047196;
6363

64-
uint256 constant IC6x = 6817038550232615580081523910729732019328824723898271013459916846209181496148;
65-
uint256 constant IC6y = 5007540534237292740105202068038033915182587070518049525579057126474202747048;
64+
uint256 constant IC6x = 15924950080287000946685929883765297309673360990922044949928505866624182997859;
65+
uint256 constant IC6y = 5360581200037747345688259956951448973597185992056174685326726615654044407192;
6666

6767
uint256 constant IC7x = 9672280002529117458221100657711877410026000365131526255571070587277130104994;
6868
uint256 constant IC7y = 8600285172183660002776649258511861921290142756223662537727755349462907425056;

solidity/contracts/verifiers/verifier_anon_nullifier_kyc_batch.sol

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ contract Groth16Verifier_AnonNullifierKycBatch {
4343
uint256 constant deltay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;
4444

4545

46-
uint256 constant IC0x = 5903479180487694997279265064344131881874542681454350742852120100073440524296;
47-
uint256 constant IC0y = 9530657098554586749733666785385875949917582344806050500162894090355413522611;
46+
uint256 constant IC0x = 17956394547302156521165787305425039553395368579665815878321069616384660821974;
47+
uint256 constant IC0y = 6992882796389782419988913396487952889902510842290875072729183489463067562180;
4848

4949
uint256 constant IC1x = 20973102971231858407268823830547921302985922314772564832818590542439356456221;
5050
uint256 constant IC1y = 8755463976472172454997983726165070757321336399692622916062903478185835201876;
@@ -76,41 +76,41 @@ contract Groth16Verifier_AnonNullifierKycBatch {
7676
uint256 constant IC10x = 10027027914330943530569092473741094434086563269833520803780904295572828067751;
7777
uint256 constant IC10y = 421990751027288915733155885330259124989116330315517655643992915427432279442;
7878

79-
uint256 constant IC11x = 599244215281404141046456725437495318313391113948484631072822414812570716776;
80-
uint256 constant IC11y = 10068255294045654417350386146388876221615727778457099371804026702882247474491;
79+
uint256 constant IC11x = 11892755591860674046473115755992830180366136817328130148390945571128812998539;
80+
uint256 constant IC11y = 9268798073089241248606702568568173938283201894666754305960489893725720318606;
8181

82-
uint256 constant IC12x = 21556964792859825649107667215781058705147965296731829911281160087820610838533;
83-
uint256 constant IC12y = 13889886910952233505246502579980063028755614337122208662602852777579996569369;
82+
uint256 constant IC12x = 10152555671693387741890273303761544089843267797975508348153732359110012549852;
83+
uint256 constant IC12y = 6851215785130794843983404241253819330754997644123241414047997028799190421511;
8484

85-
uint256 constant IC13x = 20336517095597583565227873677117826914448174923218395440417472253759155911879;
86-
uint256 constant IC13y = 13787294756325562052369133551051867132268321423810906151242602397719118060605;
85+
uint256 constant IC13x = 15926389673646585067450607026615448882721273998707051750117711890545377843835;
86+
uint256 constant IC13y = 6092524264858685061882637835001794548781930013420575912363384400816087682216;
8787

88-
uint256 constant IC14x = 723470074228247172376833529746853811390760610497044842304414745837297007793;
89-
uint256 constant IC14y = 20473431670688220490381842545562296561006547604975254617604046916777297966342;
88+
uint256 constant IC14x = 13758282793278046562484444741285107092317198764383609568883044140011006548296;
89+
uint256 constant IC14y = 13297381771926142142906590533466958927079262003147219405302530238513936419715;
9090

91-
uint256 constant IC15x = 15002382818055737103129754932077118357634513012564080449864984893716211852169;
92-
uint256 constant IC15y = 20986355934261372161815389867821841925843222171872598595602774389117273842363;
91+
uint256 constant IC15x = 8974123089488822435414123220888650328624602168169290172017148632209729116247;
92+
uint256 constant IC15y = 7022946489738753214417591939848011153517681920411366193658001703205231678394;
9393

94-
uint256 constant IC16x = 12194141240267141280402887975844644072507435166373817904521349435520239196563;
95-
uint256 constant IC16y = 14593389642349486216409486354692535004279895256912795030101019816199908203510;
94+
uint256 constant IC16x = 20285092191624000431458767079646131768817472892775292620424272081037439332800;
95+
uint256 constant IC16y = 14677998525481291699643046995288705154622139789585886228695961572520744332931;
9696

97-
uint256 constant IC17x = 21015394223495022989411464000109008933122362273422924620851048926767533637678;
98-
uint256 constant IC17y = 19949217149297160174771427449019144865727740578144251352593703549274424714243;
97+
uint256 constant IC17x = 8653881030606523422653589889738043954964914655770505886480501697282389807422;
98+
uint256 constant IC17y = 17802396532844609366494957607232915674517758974199893104755207809450698359725;
9999

100-
uint256 constant IC18x = 3943681362690863707194051007800503356665352728683045015484432282818996793654;
101-
uint256 constant IC18y = 5926512517402465313700496622240148434683755798658418845914485987943511193577;
100+
uint256 constant IC18x = 14222398084106517583634417674989764066430290828203827716243250821844511251642;
101+
uint256 constant IC18y = 6595930713961692153773738963013914489592721577697364968088466912149388548163;
102102

103-
uint256 constant IC19x = 18521510625410973039043143625576116776310762869742273135122587764220766348395;
104-
uint256 constant IC19y = 7566293396936121921157226464680078121529744119588821801602132955535815373956;
103+
uint256 constant IC19x = 12301660154151583884980964450898433820033490381713715854436873218466423853515;
104+
uint256 constant IC19y = 4868266765264225304664047279128447863928184956669291516153146669883676129155;
105105

106-
uint256 constant IC20x = 6955777603382581542780895326909850846348823267515133043834193460373252526587;
107-
uint256 constant IC20y = 5404988211516657994220064031142977435521957627605222735616136075971916277477;
106+
uint256 constant IC20x = 5600239864290768624288046938500983244220814692930262847591352146343383885481;
107+
uint256 constant IC20y = 2725094490550109268734974010025210344524901385710087689968146552059031411979;
108108

109-
uint256 constant IC21x = 15342762311956869996626100728582941890438868605264297782193785457846632248470;
110-
uint256 constant IC21y = 20548254230250891011773309995179021079622280572238402743503817964378124498364;
109+
uint256 constant IC21x = 6506763475723656181886384700320184865762413529344881749723025499240876882623;
110+
uint256 constant IC21y = 10863601731071513803837079879724831979468910760425582740082420817744191562393;
111111

112-
uint256 constant IC22x = 13468425754230748688976754818188805414992261059993406476820218042607689692919;
113-
uint256 constant IC22y = 19259260110764955907957588951746942381445285741917061612123980235317042412735;
112+
uint256 constant IC22x = 11014910699225719219658528849253210342134261845924428798796231729535338732066;
113+
uint256 constant IC22y = 11833382714481648781585346617218200770199760228872321410398030590697079674233;
114114

115115
uint256 constant IC23x = 7617190663029341979667377709868897026767966101370820487323419742367227464607;
116116
uint256 constant IC23y = 5828305386936705254095338960335559624881719900670519001227372129217412593638;

zkp/circuits/basetokens/anon_base.circom

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,24 @@ template Zeto(nInputs, nOutputs) {
4343
var inputOwnerPubKeyAx, inputOwnerPubKeyAy;
4444
(inputOwnerPubKeyAx, inputOwnerPubKeyAy) = BabyPbk()(in <== inputOwnerPrivateKey);
4545

46-
var inputOwnerPublicKeys[nInputs][2];
46+
CheckPositive(nOutputs)(outputValues <== outputValues);
47+
48+
CommitmentInputs() inAuxInputs[nInputs];
4749
for (var i = 0; i < nInputs; i++) {
48-
inputOwnerPublicKeys[i]= [inputOwnerPubKeyAx, inputOwnerPubKeyAy];
50+
inAuxInputs[i].value <== inputValues[i];
51+
inAuxInputs[i].salt <== inputSalts[i];
52+
inAuxInputs[i].ownerPublicKey <== [inputOwnerPubKeyAx, inputOwnerPubKeyAy];
4953
}
50-
CheckPositive(nOutputs)(outputValues <== outputValues);
51-
CheckHashes(nInputs)(commitments <== inputCommitments, values <== inputValues, salts <== inputSalts, ownerPublicKeys <== inputOwnerPublicKeys);
52-
CheckHashes(nOutputs)(commitments <== outputCommitments, values <== outputValues, salts <== outputSalts, ownerPublicKeys <== outputOwnerPublicKeys);
54+
55+
CommitmentInputs() outAuxInputs[nOutputs];
56+
for (var i = 0; i < nOutputs; i++) {
57+
outAuxInputs[i].value <== outputValues[i];
58+
outAuxInputs[i].salt <== outputSalts[i];
59+
outAuxInputs[i].ownerPublicKey <== outputOwnerPublicKeys[i];
60+
}
61+
62+
CheckHashes(nInputs)(commitmentHashes <== inputCommitments, commitmentInputs <== inAuxInputs);
63+
CheckHashes(nOutputs)(commitmentHashes <== outputCommitments, commitmentInputs <== outAuxInputs);
64+
5365
CheckSum(nInputs, nOutputs)(inputValues <== inputValues, outputValues <== outputValues);
5466
}

zkp/circuits/basetokens/anon_enc_base.circom

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,26 @@ template Zeto(nInputs, nOutputs) {
5555
var inputOwnerPubKeyAx, inputOwnerPubKeyAy;
5656
(inputOwnerPubKeyAx, inputOwnerPubKeyAy) = BabyPbk()(in <== inputOwnerPrivateKey);
5757

58-
var inputOwnerPublicKeys[nInputs][2];
58+
CheckPositive(nOutputs)(outputValues <== outputValues);
59+
60+
CommitmentInputs() inAuxInputs[nInputs];
5961
for (var i = 0; i < nInputs; i++) {
60-
inputOwnerPublicKeys[i]= [inputOwnerPubKeyAx, inputOwnerPubKeyAy];
62+
inAuxInputs[i].value <== inputValues[i];
63+
inAuxInputs[i].salt <== inputSalts[i];
64+
inAuxInputs[i].ownerPublicKey <== [inputOwnerPubKeyAx, inputOwnerPubKeyAy];
6165
}
6266

63-
CheckPositive(nOutputs)(outputValues <== outputValues);
64-
65-
CheckHashes(nInputs)(commitments <== inputCommitments, values <== inputValues, salts <== inputSalts, ownerPublicKeys <== inputOwnerPublicKeys);
67+
CommitmentInputs() outAuxInputs[nOutputs];
68+
for (var i = 0; i < nOutputs; i++) {
69+
outAuxInputs[i].value <== outputValues[i];
70+
outAuxInputs[i].salt <== outputSalts[i];
71+
outAuxInputs[i].ownerPublicKey <== outputOwnerPublicKeys[i];
72+
}
6673

67-
CheckHashes(nOutputs)(commitments <== outputCommitments, values <== outputValues, salts <== outputSalts, ownerPublicKeys <== outputOwnerPublicKeys);
74+
CheckHashes(nInputs)(commitmentHashes <== inputCommitments, commitmentInputs <== inAuxInputs);
75+
CheckHashes(nOutputs)(commitmentHashes <== outputCommitments, commitmentInputs <== outAuxInputs);
6876

6977
CheckSum(nInputs, nOutputs)(inputValues <== inputValues, outputValues <== outputValues);
7078

71-
(ecdhPublicKey,cipherTexts ) <== EncryptOutputs(nOutputs)(ecdhPrivateKey <== ecdhPrivateKey, outputValues <== outputValues, outputSalts <== outputSalts, outputOwnerPublicKeys <== outputOwnerPublicKeys, encryptionNonce <== encryptionNonce);
79+
(ecdhPublicKey,cipherTexts ) <== EncryptOutputs(nOutputs)(ecdhPrivateKey <== ecdhPrivateKey, encryptionNonce <== encryptionNonce, commitmentInputs <== outAuxInputs);
7280
}

0 commit comments

Comments
 (0)