HSG88 / VickreyAuction

Succinct Verifiable Sealed-Bid Auction Smart Contract
5 stars 2 forks source link

on chain encryption problem #1

Open Mahsa-Bastankhah opened 5 years ago

Mahsa-Bastankhah commented 5 years ago

Hi.As what you has published as auction.sol isn't complete at all based on your "Succinctly Verifiable Sealed-Bid Auction Smart Contract" I have tried to complete it so it will be exactly what you has described in your paper.but to implement the following that I has copied from page 14 of mentioned paper I have problem: """When the auctioneer tries to claim that Bob’s ciphertext does not contain the valid openings of his commitment, then Bob is alerted to submit the opening values as plaintext to the smart contract. Subsequently, based on these values, the smart contract recomputes the commitment and the ciphertext, then it compares them against the commitment and ciphertext which are stored in the mapping bidders[Bob]. In the case, they are found to be equal, then the protocol terminates by penalizing the auctioneer and refunding the initial deposit to all bidders. Otherwise, Bob is penalized and his commitments and ciphertext are discarded from further processing steps.""" actually my problem is : how can we implement symmetric encryption in solidity to recompute the ciphertext? I searched a lot and couldn't find any library the supports on chain encryption. Do U have any idea that can help me?

HSG88 commented 5 years ago

I haven't added the part to check the ciphertext correctness. But a quick fix could be to utilize El-gamal encryption instead of hybrid-encryption, and this way the smart contract can do the verification by using the public key and the opening values. To utilize Elgamal encryption, you need to use EIP-196

Mahsa-Bastankhah commented 5 years ago

There are encryption implementation infrastructure in EIP-196 but I couldn't find a library or code that supports on chain encryption.Can U help me to find the right library so I can add this feature to your smart contract by a quick fix?