-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement Zero-Knowlde circuits and logic for attaching metadat…
… to exact geopoint proof
- Loading branch information
1 parent
f20718e
commit d6cb8c0
Showing
4 changed files
with
58 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ZkProgram } from "o1js"; | ||
import { MetadataGeoPointCommitment } from "../../model/public/Commitment"; | ||
import { GeoPointProviderCircuitProof } from "../private/Geography"; | ||
import { attachMetadataToGeoPoint} from "../../logic/public/ExactGeoPoint"; | ||
import { SHA3_512 } from "../../model/public/SHA3"; | ||
|
||
// TODO | IMPORTANT // | ||
// Add a method to ExactGeolocationMetadataCircuit that takes two recursive proofs as inputs: | ||
// 1. GeoPointProviderCircuitProof | ||
// 2. A proof that returns SHA3_512.provable as its public output. This way, it's possible to attached authenticated metadata. | ||
// This is much better than passing metadata as magic value, since the circuit that produces the metadata itself can | ||
// perform verifiable association of the metadata to the GeoPoint in question. For example, the circuit that produced the proof, can | ||
// commit the metadata to a particular GeoPoint, and verify that that metadata is indeed associated to that GeoPont. | ||
|
||
/* | ||
* Set of Zero-Knowledge Circuits for associating arbitrary metadata to an exact GeoPoint proof. | ||
* | ||
* Visibility: Public | ||
*/ | ||
export const ExactGeolocationMetadataCircuit = ZkProgram({ | ||
name: "ExactGeoPointMetadataCircuit", | ||
publicOutput: MetadataGeoPointCommitment, | ||
methods: { | ||
attachMetadataToGeoPoint: { | ||
privateInputs: [GeoPointProviderCircuitProof, SHA3_512.provable], | ||
method: attachMetadataToGeoPoint, | ||
} | ||
} | ||
}); | ||
|
||
export class ExactGeolocationMetadataCircuitProof extends ZkProgram.Proof(ExactGeolocationMetadataCircuit) { } |