Initialization


Introduction

Zero-knowledge proofs (zk-Proofs) are communication protocols by which a prover can demonstrate to a verifier that it possesses a solution to a given public problem without revealing the content of the solution.
Any computation can be transformed into an interactive zk-Proof so a prover can convince a verifier that a computation was executed correctly without the verifier having to
execute the computation itself and without knowledge of the inputs .
This has several applications:
◼
  • Decentralized consensus
  • ◼
  • Digital currency and crypto
  • ◼
  • Code review
  • ◼
  • Authentication
  • Interactive proofs

    In[]:=
    PetersenGraph[]
    Out[]=
    In[]:=
    PacletInstall["ArmandoCruz/ZeroKnowledgeProofs"]
    Out[]=
    PacletObject
    Name: ArmandoCruz/ZeroKnowledgeProofs
    Version: 1.1.0
    
    In[]:=
    Needs["ArmandoCruz`ZeroKnowledgeProofs`"]
    In[]:=
    {graphHomomorphism,cipherSolution}
    
    t
    ,​​
    t
    

    Disclaimers and considerations

    Notes on security

    Disclaimer of Warranty . Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON - INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE . You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License .

    ZeroKnowledgeAuthentication

    Classical authentication vs ZeroKnowledge authentication

    https://resources.wolframcloud.com/PacletRepository/resources/ArmandoCruz/ZeroKnowledgeProofs/tutorial/ZeroKnowledgeAuthentication.html

    Classical client demonstration

    Register a new user in the server.
    In[]:=
    URLExecute["localhost:18000/classical_authentication/register.wl",​​{"Username"->"Galois","Password"->"Evariste"}​​]
    Out[]=
    Successfully created new user Galois in the authentication server.
    In[]:=
    URLExecute["localhost:18000/classical_authentication/register.wl",​​{"Username"->"Wolfie","Password"->"Spikey"}​​];​​URLExecute["localhost:18000/classical_authentication/register.wl",​​{"Username"->"Ada","Password"->"Lovelace"}​​];
    Authenticate to the server using the username and password.
    In[]:=
    URLExecute["localhost:18000/classical_authentication/login.wl",​​{"Username"->"Ada","Password"->"Lovelace"}​​]
    Out[]=
    Welcome back, Ada

    ZeroKnowledge client demonstration

    In[]:=
    PacletInstall["ArmandoCruz/ZeroKnowledgeProofs"]
    Out[]=
    PacletObject
    Name: ArmandoCruz/ZeroKnowledgeProofs
    Version: 1.1.0
    
    In[]:=
    Needs["ArmandoCruz`ZeroKnowledgeProofs`"]
    Generate a new Zero Knowledge Proof.
    In[]:=
    zkProof=GenerateZeroKnowledgeProof["Isomorphism","Seed"->"SecretSeed"]
    Out[]=
    ZeroKnowledgePublicProblemZeroKnowledgePublicProblem
    Protocol: Isomorphism
    Public problem shape: A pair of isomorphic graphs.
    Public problem size: {64,256}
    ,ZeroKnowledgePrivateSolutionZeroKnowledgePrivateSolution
    Protocol: Isomorphism
    Private solution shape: Isomorphism betweeen two graphs.
    Private solution size: 64
    
    In[]:=
    zkProof["ZeroKnowledgePublicProblem"]["PublicProblem"]
    Out[]=
    
    ,
    
    The first element of the returned collection is the answer or “proof” to the given public problem that must remain private, the public problem can be shared with anyone.
    Register a new user in the server.

    Login into the server

    Generate a witness for the ZeroKnowledgeProof that will cipher the public problem and private solution into a list of 5 homomorphic cipher problems:
    Compress the cipher problem and split it in packages for the server:
    Send the homomorphic cipher problem to the verifier server and get a query:
    Answer the query using the knowledge og the cipher solution:
    Send the answer to the server for the final verification:

    CITE THIS NOTEBOOK

    Wolfram R&D LIVE: application of ZeroKnowledgeProofs paclet for web authentication​
    by Armando Benjamín Cruz Hinojosa​
    Wolfram Community, STAFF PICKS, April 24, 2024
    ​https://community.wolfram.com/groups/-/m/t/3164204