BSV
$69.45
Vol 57.96m
-3.2%
BTC
$98192
Vol 58578.29m
0.01%
BCH
$513.41
Vol 795.06m
0.66%
LTC
$96.95
Vol 1202.79m
-3.32%
DOGE
$0.42
Vol 11038.67m
-1.7%
Getting your Trinity Audio player ready...

This post was first published on Medium.

Previously, we have used Zero-Knowledge Bounties (ZKB) to pay for a Sudoku solution on Bitcoin. In this series, we are going to use ZKB to solve a wide range of more practical problems.

In Part 1, we apply ZKB to pay for a decryption key. Suppose Alice encrypts her files with a symmetric key K. For safety, she contacts Bob, an online backup service, to keep a copy of K. She does not want Bob to know K, so Bob generates an elliptic curve private/public key pair (skpk) and gives pk to Alice. Alice encrypts K with pk with an asymmetric encryption algorithm, such as ElGamal or ECIES, and sends it to Bob.

In case Alice loses her local K, she asks Bob for the decryption key sk, and Bob only delivers sk if he gets paid. This is the classic fair exchange problem that ZKB solves, as it guarantees that payment will result in the disclosure of the right decryption key.

Implementation

Compared with pay for Sudoku, we only have to change the subcircuit C to verify the decryption key corresponds to the public key used to encrypt K instead of verifying the Sudoku solution. Other parts of the circuit remain the same and can be reused.

Note that the private key used for decryption is passed as a private input to the circuit and, thus, is never revealed to the public. The public key gets passed as a public input so that the verifier smart contract can ensure that the correct private key was used when producing the proof.

This is different from Pay for Private Key, which exposes the private key on chain publicly.

Ransomware

It is not inconceivable the same approach to pay for a decryption key can be used by a malicious hacker.

The hacker infects a victim’s computer with a malware and encrypts his files by, e.g., having the victim click on malicious content in a phishing email. The malware displays a ransom demand, to be paid in Bitcoin, with payment instructions on the victim’s computer.

ZK Bounty, Decryption Key
Ransomware

The victim and the hacker do not trust each other. The victim wants to be guaranteed that he will be able to decrypt his files after paying the ransom.

The same ZK bounty can be used in this case, with one major difference. In the backup case, the user can be certain of the public key used for the encryption since he performed the encryption himself. In the ransomware case, an additional proof is needed to convince the victim the public key used in the bounty smart contract is indeed the same one used to encrypt his files. A naive solution is to randomly select a few files for the hacker to decrypt.

How to alleviate this type of ransomware attacks is out of the scope of this article. Interested readers can find more information in, e.g.,1.

[1] The Ring of Gyges: Investigating the Future of Criminal Smart Contracts

Watch: The BSV Global Blockchain Convention presentation, Smart Contracts and Computation on BSV

Recommended for you

David Case gets technical with Bitcoin masterclass coding sessions
Whether you're a coding pro or a novice, David Case's livestream sessions on the X platform are not to be...
November 21, 2024
NY Supreme Court’s ruling saves BTC miner Greenidge from closing
However, the judge also ruled that Greenidge must reapply for the permit and that the Department of Environmental Conservation has...
November 20, 2024
Advertisement
Advertisement
Advertisement