2- Commitment Phase

In this section, we will review the commitment phase of the protocol. This phase contains two parts; AHP commitment and PFR commitment. We also provide an example to clarify the method.

2-1- PFR Commitment

CommitmentID= Lower4Bytes(SHA256(Manufacturer_Name, Device_Type, Device_Hardware_Version, Firmware_Version, Lines Vec<u64>))

2-2- PFR Commitment JSON File Format

{
    "CommitmentID":  64-bit,
    "m": 64-bit Integer,
    "n": 64-bit Integer,
    "ComRowA": 64-bit Integer,
    "ComColA": 64-bit Integer,
    "ComValA": 64-bit Integer,
    "ComRowB": 64-bit Integer,
    "ComColB": 64-bit Integer,
    "ComValB": 64-bit Integer,
    "ComRowC": 64-bit Integer,
    "ComColC": 64-bit Integer,
    "ComValC": 64-bit Integer,
    "RowA": 64-bit Integer,
    "ColA": 64-bit Integer,
    "ValA": 64-bit Integer,
    "RowB": 64-bit Integer,
    "ColB": 64-bit Integer,
    "ValB": 64-bit Integer,
    "RowC": 64-bit Integer,
    "ColC": 64-bit Integer,
    "ValC": 64-bit Integer,
    "Curve": String,
    "PolynomialCommitment": String
}

2-3- AHP Commitment

2-4- AHP Commitment JSON File Format

{
    "CommitmentID":  64-bit,
    "m": 64-bit Integer,
    "n": 64-bit Integer,
    "ComRow'A": 64-bit Integer,
    "ComCol'A": 64-bit Integer,
    "ComVal'A": 64-bit Integer,
    "ComRow'B": 64-bit Integer,
    "ComCol'B": 64-bit Integer,
    "ComVal'B": 64-bit Integer,
    "ComRow'C": 64-bit Integer,
    "ComCol'C": 64-bit Integer,
    "ComVal'C": 64-bit Integer,
    "Row'A": 64-bit Integer,
    "Col'A": 64-bit Integer,
    "Val'A": 64-bit Integer,
    "Row'B": 64-bit Integer,
    "Col'B": 64-bit Integer,
    "Val'B": 64-bit Integer,
    "Row'C": 64-bit Integer,
    "Col'C": 64-bit Integer,
    "Val'C": 64-bit Integer,
    "Curve": String,
    "PolynomialCommitment": String
}

2-5- Example

Assume the following sample code: SaveRegsitersState() mul R1, R1, 5 => Gate 1, p=181 add R1, R1, 11 => Gate 2, p=181 mul R1, R1, 26 => Gate 3, p=181 nop nop nop nop nop SaveRegsitersState()

Example with 32 registers of RISC-V:

2-5-1- PFR Commitment

3- The Prover calculates commitment by using of KZG commitment scheme as following:

Therefore

and similarly

2-5-2- AHP Commitment

4- The Prover sends

and similarly

2-6- AHP Commitment JSON File Example

IoT_Manufacturer_Name = "zkIoT" IoT_Device_Name = "MultiSensor" Device_Hardware_Version = "1.0" Firmware_Version = "1.0" Device Picture= <> Lines = [200, 350, 4000-4010]

{
    "Class": 
    "CommitmentID": 
    "m":9,
    "n":5,
    "ComRow'A":
    "ComCol'A": 
    "ComVal'A":
    "ComRow'B":
    "ComCol'B":
    "ComVal'B":
    "ComRow'C":
    "ComCol'C":
    "ComVal'C":
    "Row'A":[94,66,63,101,29,27,20,2,2],
    "Col'A":[166,119,172,97,158,83,114,31,24],
    "Val'A":[56,33,41,74,2,48,113,27,154],
    "Row'B":[20,74,40,139,98,141,95,119,40],
    "Col'B":[5,17,5,126,38,123,32,119,79],
    "Val'B":[50,140,128,97,120,74,156,56,20],
    "Row'C":[94,13,103,100,87,38,62,155,114],
    "Col'C":[166,122,168,150,80,56,102,79,24],
    "Val'C":[143,114,36,156,159,139,101,127,44],
    "Curve": "bn128",
    "PolynomialCommitment": "KZG"
}

Last updated