https://github.com/dedis/calypso_zkp
Example smart contract which verifies a NIZKP
https://github.com/dedis/calypso_zkp
Last synced: 22 days ago
JSON representation
Example smart contract which verifies a NIZKP
- Host: GitHub
- URL: https://github.com/dedis/calypso_zkp
- Owner: dedis
- Created: 2021-07-07T16:40:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-16T09:37:08.000Z (almost 5 years ago)
- Last Synced: 2025-03-03T08:22:47.373Z (about 1 year ago)
- Language: C
- Size: 69.3 KB
- Stars: 3
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Smart Contract Example
Calypso [1] offers a mean to store secrets on the blockchain.
It uses a distributed keypair, where anyone can fetch and use the public key to
encrypt a secret, but the private key is owned by the group of participating nodes.
An encrypted secret is only revealed to the owner, or someone the owner authorized.
When Alice wants to store her secret, she encrypts it with the distributed
public key and stores it by executing a smart contract.
Upon execution, the smart contract storing the encrypted secret must check that
Alice knows the secret, based solely on the encrypted secret it receives.
Otherwise, an adversary Eve could perform a replay attack by copying over the
ciphertext and faking a new access control policy.
For more information, please refer to the appendix of
https://eprint.iacr.org/2018/209.pdf, the sections on Write Transaction Protocol
for Long Term Secrets and D.1 Replay attack.
Go implementation is available at: https://github.com/dedis/cothority/blob/b80515bba800ad738ff79686bd2abfd2822e77d1/calypso/struct.go#L73