JSON Extraction
The final cog in the circuit machine is to provably parse and extract some value from the JSON item that was received back from the server. Inside this JSON is presumably what the user would like the Web Proof to make a statement about; for instance, the user may want to prove that their balance is greater than $100 USD, so the JSON parser and extractor has to find this balance
and return it as the program’s output.
If the JSON appeared as follows:
{
"user": {
"id": "web_proof_demo_user",
"date created": "10/22/2024",
"balance": 350.00
}
}
then we would intend to tell the JSON prover to extract user.balance
so that the program would output 350.00
. If user.balance
was not there at the exact location, then the proof would fail. This, alongside the other provers, prevents malicious editing of the data that is to be used in a Web Proof.