Attestation
An attestation is the truth value of a statement when all the variables are given a value.
For example, the statement "Over 18 years old" is true if the assigned value of the variable age
is 22
, and false if it is 14
(by using the logic rule age > 18
of the statement).
Formalisation
Jump to Implementation if you are only looking for the code.
Please refer to Statement for the formalisation of a statement before reading this section.
We note the attestation of a statement with the given values .
, with the set of all possible vectors of values of the variables of .
We say that an attestation is the truth value of for the values , and is either:
- valid if
- invalid otherwise (if )
In logic, an attestation is the realization/instantiation of a predicate (a statement).
Example:
Let consider the following statement again:
We have the following attestations:
Some observations:
- With no restriction on , there's an infinite number of attestations for a statement.
Zero-knowledge attestation
We declared the following statement function in Zero-knowledge Statement:
, with the set of all possible proofs of the statement .
We can define a function that acts as the verifier:
We can note that is nothing else than the set of all possible attestations , so we can represent an attestation as a zero-knowledge proof.
We then have:
In other word, to verify the validity of an attestation, we just need to have the attestation proof with its public variables.
Example:
We redefine the previous statement as a zero-knowledge statement with the age
variable as a private variable:
We can generate one valid proof .
Note that having don't reveal .
A prover can verify the validity with .
Similarly,
Combining attestations and statements together for modularity and scalability
We can combine multiple statements together to create more complex statements. For example, the statement "Over 18 years old and living in France" is the combination of the two statements "Over 18 years old" and "Living in France".
With two statements, the set of possible vectors of values of the variables of respectively, and two vectors such that and , we define the combination of and as the statement such that:
This is useful because if we have a statement that is composed of multiple statements, then we can use the partial attestation of these statements that compose the statement to determine the truth value of the statement without having to reverify the validity of the partial attestation as long as they are still valid.
In other words, with the attestations of respectively, and the attestation of , then we can determine the truth value of with just
Partial attestation
When only parts of the variables are given a value, then we call it a partial attestation.
If the statement is "Over 18 years old and living in France", then the assigned value 22
to the variable age
is not enough to determine the truth value of the statement, we also need to know the value of the variable country
(or isLivingInFrance
).
However, this gives us the partial attestation "living in France" knowing that the person is "age 22".