# US 2024/0205011 A1 · Zero knowledge proof of smart contract computation using private input

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0205011 A1
- Document ID: US20240205011A1
- Status: Published application
- Kind: A1
- Application number: 18/557,502
- Filed: 2021-05-04
- Published: 2024-06-20
- Earliest claimed: 2021-05-04
- Assignees: Telefonaktiebolaget LM Ericsson (publ)
- Applicants: Telefonaktiebolaget LM Ericsson (publ)
- Inventors: Rémi ROBERT
- Web page: https://patentgrep.com/patent/US20240205011A1

## CPC

- H04L 9/3221: {interactive zero-knowledge proofs}
- H04L 9/3239: {involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD}
- H04L 9/3218: {using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs}
- H04L 9/3236: {using cryptographic hash functions}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A method by a network device implementing a first peer of a distributed ledger to provide trusted execution of a smart contract that uses private data accessible to a second peer of the distributed ledger but not accessible to the first peer. The method includes detecting, during execution of the smart contract, a subroutine of the smart contract that uses the private data, providing an identifier of the subroutine and a proving key to the second peer, obtaining a zero-knowledge proof of computation of the subroutine and a public input to a program adapted for a zero-knowledge proving scheme, wherein the zero-knowledge proof was generated by the second peer, and determining whether the zero-knowledge proof is valid using the zero-knowledge proving scheme based on the public input and a verification key.

## Claims

### Claim 1

A method by a network device implementing a first peer of a distributed ledger to provide trusted execution of a smart contract that uses private data accessible to a second peer of the distributed ledger but not accessible to the first peer, the method comprising:
receiving a request to execute the smart contract;
beginning execution of the smart contract;
detecting, during the execution of the smart contract, a subroutine of the smart contract that uses the private data;
obtaining a program adapted for a zero-knowledge proving scheme that was generated based on the subroutine, wherein the program adapted for the zero-knowledge proving scheme includes logic to verify that the private data corresponds to manipulation detection codes of the private data;
obtaining a verification key that was generated based on the program adapted for the zero-knowledge proving scheme;
generating a partial execution result of the smart contract;
providing an identifier of the subroutine to the second peer;
obtaining a zero-knowledge proof of computation of the subroutine and a public input to the program adapted for the zero-knowledge proving scheme, wherein the zero-knowledge proof was generated by the second peer based on a proving key that was generated based on the program adapted for the zero-knowledge proving scheme;
determining whether the zero-knowledge proof is valid using the zero-knowledge proving scheme based on the public input and the verification key;
determining whether the public input is valid;
restoring an execution state of the smart contract using the partial execution result in response to a determination that the zero-knowledge proof and the public input are valid;
applying effects of the subroutine;
resuming the execution of the smart contract after the subroutine to generate a full execution result of the smart contract; and
providing the full execution result to a consensus mechanism of the distributed ledger.

### Claim 2 (depends on 1)

The method of claim 1, wherein the zero-knowledge proving scheme is zero-knowledge succinct non-interactive argument of knowledge and the program adapted for the zero-knowledge proving scheme is an arithmetic circuit.

### Claim 3 (depends on 1)

The method of claim 1, wherein the partial execution result includes a snapshot of a state of a virtual machine executing the smart contract.

### Claim 4 (depends on 1)

The method of claim 1, wherein the identifier of the subroutine and the proving key is provided to the second peer via a client component and the full execution result is provided to the consensus mechanism of the distributed ledger via the client component.

### Claim 5 (depends on 1)

The method of claim 1, wherein the public input includes values of inputs to the subroutine, public data used in the subroutine, the manipulation detection codes of the private data, and an output of the subroutine.

### Claim 6 (depends on 5)

The method of claim 5, wherein the effects of the subroutine are applied based on modifying the execution state of the smart contract and pending operations of the distributed ledger to reflect execution of the subroutine.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
providing data related to the request to execute the smart contract to the second peer.

### Claim 8

A method by a network device implementing a second peer of a distributed ledger to provide trusted execution of a smart contract that uses private data accessible to the second peer but not accessible to a first peer of the distributed ledger, the method comprising:
receiving a request to execute the smart contract, a proving key, and an identifier of a subroutine of the smart contract for which proof of computation is requested, wherein the subroutine uses the private data;
beginning execution of the smart contract;
detecting, during the execution of the smart contract, the subroutine;
obtaining a program adapted for a zero-knowledge proving scheme that was generated based on the subroutine, wherein the program adapted for the zero-knowledge proving scheme includes logic to verify that the private data corresponds to manipulation detection codes of the private data;
executing the subroutine;
generating a zero-knowledge proof of computation of the subroutine using the zero-knowledge proving scheme based on the program adapted for the zero-knowledge proving scheme, a public input to the program adapted for the zero-knowledge proving scheme, a private input to the program adapted for the zero-knowledge proving scheme, and the proving key;
resuming the execution of the smart contract after the subroutine to generate a full execution result of the smart contract;
providing, to the first peer, the zero-knowledge proof and the public input; and
providing the full execution result to a consensus mechanism of the distributed ledger.

### Claim 9 (depends on 8)

The method of claim 8, wherein the zero-knowledge proving scheme is zero-knowledge succinct non-interactive argument of knowledge and the program adapted for the zero-knowledge proving scheme is an arithmetic circuit.

### Claim 10 (depends on 8)

The method of claim 8, wherein the public input includes values of inputs to the subroutine, public data used in the subroutine, the manipulation detection codes of the private data, and an output of the subroutine.

### Claim 11 (depends on 10)

The method of claim 10, wherein the private input includes the private data.

### Claim 12 (depends on 8)

The method of claim 8, wherein the proving key is generated by the first peer and provided to the second peer via a client component, wherein the zero-knowledge proof is provided to the first peer via the client component and the full execution result is provided to the consensus mechanism of the distributed ledger via the client component.

### Claim 13

A set of non-transitory machine-readable media having computer code stored therein, which when executed by a set of one or more processors of a network device implementing a first peer of a distributed ledger, causes the first peer to perform operations for providing trusted execution of a smart contract that uses private data accessible to a second peer of the distributed ledger but not accessible to the first peer, the operations comprising:
receiving a request to execute the smart contract;
beginning execution of the smart contract;
detecting, during the execution of the smart contract, a subroutine of the smart contract that uses the private data;
obtaining a program adapted for a zero-knowledge proving scheme that was generated based on the subroutine, wherein the program adapted for the zero-knowledge proving scheme includes logic to verify that the private data corresponds to manipulation detection codes of the private data;
obtaining a verification key that was generated based on the program adapted for the zero-knowledge proving scheme;
generating a partial execution result of the smart contract;
providing an identifier of the subroutine to the second peer;
obtaining a zero-knowledge proof of computation of the subroutine and a public input to the program adapted for the zero-knowledge proving scheme, wherein the zero-knowledge proof was generated by the second peer based on a proving key that was generated based on the program adapted for the zero-knowledge proving scheme;
determining whether the zero-knowledge proof is valid using the zero-knowledge proving scheme based on the public input and the verification key;
determining whether the public input is valid;
restoring an execution state of the smart contract using the partial execution result in response to a determination that the zero-knowledge proof and the public input are valid;
applying effects of the subroutine;
resuming the execution of the smart contract after the subroutine to generate a full execution result of the smart contract; and
providing the full execution result to a consensus mechanism of the distributed ledger.

### Claim 14 (depends on 13)

The set of non-transitory machine-readable media of claim 13, wherein the zero-knowledge proving scheme is zero-knowledge succinct non-interactive argument of knowledge and the program adapted for the zero-knowledge proving scheme is an arithmetic circuit.

### Claim 15 (depends on 13)

The set of non-transitory machine-readable media of claim 13, wherein the public input includes values of inputs to the subroutine, public data used in the subroutine, the manipulation detection codes of the private data, and an output of the subroutine.

### Claim 16 (depends on 15)

The set of non-transitory machine-readable media of claim 15, wherein the effects of the subroutine are applied based on modifying the execution state of the smart contract and pending operations of the distributed ledger to reflect execution of the subroutine.

### Claim 17

A set of non-transitory machine-readable media having computer code stored therein, which when executed by a set of one or more processors of a network device implementing a second peer of a distributed ledger, causes the second peer to perform operations for providing trusted execution of a smart contract that uses private data accessible to the second peer but not accessible to a first peer of the distributed ledger, the operations comprising:
receiving a request to execute the smart contract, a proving key, and an identifier of a subroutine of the smart contract for which proof of computation is requested, wherein the subroutine uses the private data;
beginning execution of the smart contract;
detecting, during the execution of the smart contract, the subroutine;
obtaining a program adapted for a zero-knowledge proving scheme that was generated based on the subroutine, wherein the program adapted for the zero-knowledge proving scheme includes logic to verify that the private data corresponds to manipulation detection codes of the private data;
executing the subroutine;
generating a zero-knowledge proof of computation of the subroutine using the zero-knowledge proving scheme based on the program adapted for the zero-knowledge proving scheme, a public input to the program adapted for the zero-knowledge proving scheme, a private input to the program adapted for the zero-knowledge proving scheme, and the proving key;
resuming the execution of the smart contract after the subroutine to generate a full execution result of the smart contract;
providing, to the first peer, the zero-knowledge proof and the public input; and
providing the full execution result to a consensus mechanism of the distributed ledger.

### Claim 18 (depends on 17)

The set of non-transitory machine-readable media of claim 17, wherein the zero-knowledge proving scheme is zero-knowledge succinct non-interactive argument of knowledge and the program adapted for the zero-knowledge proving scheme is an arithmetic circuit.

### Claim 19 (depends on 17)

The set of non-transitory machine-readable media of claim 17, wherein the public input includes values of inputs to the subroutine, public data used in the subroutine, the manipulation detection codes of the private data, and an output of the subroutine.

### Claim 20 (depends on 17)

The set of non-transitory machine-readable media of claim 17, wherein the private input includes the private data.
