Giter VIP home page Giter VIP logo

zero-savvy / zk-remote-attestation Goto Github PK

View Code? Open in Web Editor NEW
11.0 0.0 1.0 25.09 MB

Implementation of zRA protocol, a non-interactive method for constructing a transparent remote attestation (RA) protocol based on zkSNARKs.

License: Other

Python 0.24% Circom 95.82% Solidity 1.27% JavaScript 2.61% Shell 0.05%
circom merkle-proof remote-attestation tornado-cash zksnarks attestation trustless groth16

zk-remote-attestation's Introduction

zRA: Proofs of Attestation based on zkSNARKs DOI

The image is made by Bing Image Creator (Powered by DALL·E 3)

This repository is an implementation of zRA protocol, a non-interactive method for constructing a transparent remote attestation (RA) protocol based on zkSNARKs.

This protocol eliminates the need for online and trusted services during attestation. The protocol provides a publicly verifiable attestation mechanism with generating ZK proofs for pre-image solutions for commitments within a specialized Merkle tree. In other words, zRA requires the device (prover) to demonstrate knowledge of specific values (challenge, response, and public_key) that when combined and hashed, result in a leaf within the Merkle tree. In practice, this approach can be viewed as an adaptation of the Tornado-cash protocol to enhance remote attestation.

Watch the following video presentation of the zRA protocol at NDSS-24:

Watch the video

References

The initial paper of this protocol has been accepted/published as part of the NDSS'24 Conference.
For more details on the building blocks, performance and security analysis of zRA, we advise you to check the manuscript, available at NDSS'24.

Title: From Interaction to Independence: zkSNARKs for Transparent and Non-Interactive Remote Attestation
Authors: Shahriar Ebrahimi, Parisa Hassanizadeh
Conference: NDSS 2024
PDF of the Camera-Ready Version: NDSS24.pdf

Benchmarking

All of the experiments are reproducible on commodity hardware using Linux-based operating systems. We have provided pre-built executable/binary files in the repository that can be used easily for benchmarking.

All of the benchmarks are also have been done successfully on the following tiny boards:

  1. ASUS TinkerBoard
  2. Raspberry Pi Zero 2W

Setup/Installation

The only preparation that is required to execute benchmarks is installing "node js and snarkjs package" that can be done in any OS easily as follows:

For Installing Node JS:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

source ~/.bashrc

nvm install v16.20.0

Note

in rare cases (miss-configured Linux distros), if you got an error stating that version "v16.20.0" was not found; following command might help: export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist

For installing snarkjs:

npm install -g snarkjs

Execution

  1. clone the repository with following command:
    git clone https://github.com/zero-savvy/zk-remote-attestation.git

  2. go to the benchmark directory:
    cd zk-remote-attestation/benchmarking

  3. We have prepared a script for benchmark. Simply give it execution permissions:
    chmod +x script.sh

  4. Run the benchmarks!
    The script takes two inputs: 1) number of tests, and 2) the test name [choose from ra10 , ra20, ra30, and ra40].

Example 1: running proofs of attestation tree with height of 30 for 10 times:
./script.sh 10 ra30

Example 2: running proofs of attestation tree with height of 20 for 5 times:
./script.sh 5 ra20

Sample output: The script reports the average time for generating witness and the proof. Below is a sample output:

Average witness generation time: 0.4152 seconds
Average proof generation time: 0.7881 seconds

Note

Please note that depending on the system, generating witnesses and proofs can take time. since the generation times are usually consistent, we suggest trying the benchmark with small number of tests (e.g. 5 or 10) before running higher number of tests.

Acknowledgements

Implementation of zRA could not be possible without the following open-source projects and we appreciate all the efforts done by the community. Especially, we have used following repositories to build zRA:

[1] Circom: For building and compiling ZK circuits.

[2] CircomLib: Used for globaly tested POSEIDON implementations on Circom.

[3] Tronado-Core: Used for audited implementations of MerkleTree proofs on Circom.

[4] Circom-compatible POSEIDON implementation in JavaScript: Shoutout to @BigWhaleLabs for the accurate implementation of POSEIDON that is compatible with CircomLib.

License

This work is licensed under Attribution-NonCommercial 4.0 International

zk-remote-attestation's People

Contributors

0x31 avatar 0xtsukino avatar 3q-coder avatar agonical avatar alrubio avatar arnaucube avatar bellesmarta avatar ed255 avatar gnidan avatar howjmay avatar jbaylina avatar judiciouscoder avatar kobigurk avatar krlosmata avatar lovely-necromancer avatar lucienest avatar mirru2532 avatar parizad1188 avatar pertsev avatar poma avatar rstormsf avatar tsunamidev avatar udibr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nelsonijih

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.