Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BAZK] Onchain ceremony contracts #12

Open
33 tasks done
veigajoao opened this issue Dec 11, 2023 · 3 comments
Open
33 tasks done

[BAZK] Onchain ceremony contracts #12

veigajoao opened this issue Dec 11, 2023 · 3 comments
Assignees

Comments

@veigajoao
Copy link
Contributor

veigajoao commented Dec 11, 2023

Build contracts to perform ceremony and save data on chain

  • Add new add_ceremony_hash method to the contract
  • Add get_ceremony_hashes to the contract
  • Add is_last_hash to the contract
  • Add get_ceremony_hashes_count to the contract
  • Save last hash in the contract
  • Get last hash from the contract, and continue the ceremony from there.
  • Get last hash from the provided file and compare it with the last hash from the contract.
  • Generate the id of the ceremony, when it is not continuing an already existing one.
  • Create method add_ceremony_metadata in the contract, to add the metadata of the ceremony.
  • Create method get_ceremony_metadata in the contract, to get the metadata of the ceremony.
  • Add the metadata of the ceremony, such as the power, the batch, and the circuit data
    (constraints, private inputs, public inputs, wires).
  • Add PINATA_API_KEY and PINATA_API_SECRET to .env
  • Add add_ceremony_hashes (to add in batch)
  • Add add_ceremony_metadatas (to add in batch)
  • Replace add_ceremony_hash by add_ceremony_hashes in index.ts
  • Replace add_ceremony_metadata by add_ceremony_metadatas in index.ts
  • Add get_ceremony method to the contract
  • Add timestamp on new_ceremony and remove power and batch
  • Validate metadata to avoid adding the same key twice, and replace it instead of duplicating
  • Move power and batch ceremony properties to metadata
  • Add name, description and deadline to the ceremony.
  • Add get_ceremony_deadline to the contract.
  • Validate deadline when making a contribution.
  • Need to pass power and bash in the metadata when phase 2 is created.
  • Restrict the access to the contract method, so that only the enclave can call it.
  • Provide pre-generated phase one outputs according to each power.
  • Add total ceremonies in the method get_ceremony
  • Add hashes and metadatas in the return of the method get_ceremony.
  • Some transactions still fail randomly, we need to investigate (uncomment waitFinalized).
  • Update Gramine files to reflect the lastest changes made
  • Connecting to validator contract... Unexpected Response Status: 502
  • Adapt the project structure to monorepo
  • Error on uploading files to IPFS using curl
@veigajoao
Copy link
Contributor Author

@davibauer
Copy link
Contributor

davibauer commented Dec 13, 2023

Storage Benchmark

Phase 1

*all contributions - means every single one of them has that size

Size: 10

Challenge: 385 KB (all contributions)
Response: 193 KB (all contributions)

Size: 11

Challenge: 769 KB (all contributions)
Response: 385 KB (all contributions)

Size: 12

Challenge: 1.5 MB (all contributions)
Response: 769 KB (all contributions)

Size: 13

Challenge: 3 MB (all contributions)
Response: 1.5 MB (all contributions)

Size: 14

Challenge: 6 MB (all contributions)
Response: 3 MB (all contributions)

Phase 2

Circuit: Simple

nVars: 507
nOutputs: 253
nPubInputs: 0
nPrvInputs: 1
nLabels: 508
nConstraints: 506

Size: 10

Contribution 1: 224 KB
Contribution 2: 224 KB
Contribution 3: 225 KB
Contribution 4: 225 KB

Each two contributions, it adds 1 KB to the file.

Size: 11

Contribution 1: 224 KB
Contribution 2: 224 KB
Contribution 3: 225 KB
Contribution 4: 225 KB

Each two contributions, it adds 1 KB to the file.

Size: 12

Contribution 1: 224 KB
Contribution 2: 224 KB
Contribution 3: 225 KB
Contribution 4: 225 KB

Each two contributions, it adds 1 KB to the file.

Size: 13

Contribution 1: 224 KB
Contribution 2: 224 KB
Contribution 3: 225 KB
Contribution 4: 225 KB

Each two contributions, it adds 1 KB to the file.

Size: 14

Contribution 1: 224 KB
Contribution 2: 224 KB
Contribution 3: 225 KB
Contribution 4: 225 KB

Each two contributions, it adds 1 KB to the file.

Circuit: Opact - Transaction 1x2

Circuit size: 20,163 KB
Power: 15

nVars: 18540
nOutputs: 0
nPubInputs: 8
nPrvInputs: 73
nLabels: 88709
nConstraints: 18471

Contribution 1: 7,843 KB
Contribution 2: 7,843 KB
Contribution 3: 7,844 KB
Contribution 4: 7,844 KB
Contribution 5: 7,844 KB
Contribution 6: 7,845 KB
Contribution 7: 7,845 KB
Contribution 8: 7,845 KB
Contribution 9: 7,846 KB
Contribution 10: 7,846 KB

Circuit: Opact - Transaction 2x2

Circuit size: 38,222 KB
Power: 18

nVars: 35043
nOutputs: 0
nPubInputs: 9
nPrvInputs: 140
nLabels: 163638
nConstraints: 34911

Contribution 1: 15,048 KB
Contribution 2: 15,048 KB
Contribution 3: 15,049 KB
Contribution 4: 15,049 KB
Contribution 5: 15,050 KB
Contribution 6: 15,050 KB
Contribution 7: 15,050 KB
Contribution 8: 15,051 KB
Contribution 9: 15,051 KB
Contribution 10: 15,051 KB

Circuit: Opact - Transaction 3x2

Circuit size: 56,288 KB
Power: 18

nVars: 51547
nOutputs: 0
nPubInputs: 10
nPrvInputs: 207
nLabels: 238570
nConstraints: 51352

Contribution 1: 20,206 KB
Contribution 2: 20,206 KB
Contribution 3: 20,206 KB
Contribution 4: 20,207 KB
Contribution 5: 20,207 KB
Contribution 6: 20,207 KB
Contribution 7: 20,208 KB
Contribution 8: 20,208 KB
Contribution 9: 20,208 KB
Contribution 10: 20,209 KB

Circuit: Opact - Transaction 4x2

Circuit size: 74,357 KB
Power: 18

nVars: 68052
nOutputs: 0
nPubInputs: 11
nPrvInputs: 274
nLabels: 313505
nConstraints: 67794

Contribution 1: 29,459 KB
Contribution 2: 29,460 KB
Contribution 3: 29,460 KB
Contribution 4: 29,460 KB
Contribution 5: 29,461 KB
Contribution 6: 29,461 KB
Contribution 7: 29,462 KB
Contribution 8: 29,462 KB
Contribution 9: 29,462 KB
Contribution 10: 29,463 KB

Circuit: Opact - Transaction 5x2

Circuit size: 92,424 KB
Power: 18

nVars: 84558
nOutputs: 0
nPubInputs: 12
nPrvInputs: 341
nLabels: 388443
nConstraints: 84237

Contribution 1: 34,618 KB
Contribution 2: 34,618 KB
Contribution 3: 34,618 KB
Contribution 4: 34,619 KB
Contribution 5: 34,619 KB
Contribution 6: 34,619 KB
Contribution 7: 34,620 KB
Contribution 8: 34,620 KB
Contribution 9: 34,620 KB
Contribution 10: 34,621 KB

Circuit: Opact - Transaction 6x2

Circuit size: 110,508 KB

Power: 18

nVars: 101065
nOutputs: 0
nPubInputs: 13
nPrvInputs: 408
nLabels: 463384
nConstraints: 100681

Contribution 1: 39,776 KB
Contribution 2: 39,776 KB
Contribution 3: 39,777 KB
Contribution 4: 39,777 KB
Contribution 5: 39,777 KB
Contribution 6: 39,778 KB
Contribution 7: 39,778 KB
Contribution 8: 39,778 KB
Contribution 9: 39,779 KB
Contribution 10: 39,779 KB

Circuit: Opact - Transaction 7x2

Circuit size: 128,786 KB

nVars: 117573
nOutputs: 0
nPubInputs: 14
nPrvInputs: 475
nLabels: 538328
nConstraints: 117126

Power: 18

Contribution 1: 44,935 KB
Contribution 2: 44,935 KB
Contribution 3: 44,935 KB
Contribution 4: 44,936 KB
Contribution 5: 44,936 KB
Contribution 6: 44,936 KB
Contribution 7: 44,937 KB
Contribution 8: 44,937 KB
Contribution 9: 44,937 KB
Contribution 10: 44,938 KB

Circuit: Opact - Transaction 8x2

Circuit size: 147,047 KB

nVars: 134082
nOutputs: 0
nPubInputs: 15
nPrvInputs: 542
nLabels: 613275
nConstraints: 133572

Power: 18

Contribution 1: 58,286 KB
Contribution 2: 58,286 KB
Contribution 3: 58,286 KB
Contribution 4: 58,287 KB
Contribution 5: 58,287 KB
Contribution 6: 58,287 KB
Contribution 7: 58,288 KB
Contribution 8: 58,288 KB
Contribution 9: 58,288 KB
Contribution 10: 58,289 KB

@veigajoao
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants