onflow / developer-grants

Grants for developers that contribute to the broader developer ecosystem
Apache License 2.0
50 stars 18 forks source link

Proposal: Dual-Key Stealth Address Protocol #58

Closed wuyahuang closed 2 years ago

wuyahuang commented 2 years ago

Dual-Key Stealth Address Protocol

Grant category

Description

The first full working implementation of DKSAP(Dual-Key Stealth Address Protocol) was announced by a developer known as rynomster/sdcoin in 2014 for ShadowSend, a capable, efficient and decentralized anonymous wallet solution. The DKSAP has been implemented in a number of cryptocurrency systems since then, including Monero, Samourai Wallet, and TokenPay, just to name a few. The protocol takes advantage of two pairs of cryptographic keys, namely a ‘scan key’ pair and a ‘spend key’ pair, and computes a one-time payment address per transaction, as detailed below:

In DKSAP, if an auditor or a proxy server exists in the system, the receiver can share the ‘scan private key’ s and the ‘spend public key’ B with the auditor/proxy server so that those entities can scan the blockchain transaction on behalf of the receiver. However, they are not able the compute the ephemeral private key c + b and spend the payment.

Problem statement

Public ledgers are generally seen as “pseudo-anonymous” as addresses can be linked to one person although that person’s identity is unknown to the public. However, by combining this info with other data it is possible to discover the real-world identity behind the address. Many individuals and companies prefer to have an additional layer of security in order to keep their privacy. That’s where DKSAP comes to play.

Proposed solution

I want to develop an anonymous NFT contract based on DKSAP, and all NFT owner's public keys are encrypted by the receiver's scan public key. At the same time, users send the transaction through a relayer to ensure the anonymity of the transaction. The relayer will create a new account in which the public key is the recipient's encrypted address.

Impact

Milestones and funding

Milestone 1 — Implement DKSAP for Flow

Number Deliverable Specification
0. License Apache 2.0
1. Documentation I will provide both inline documentation of the code and a basic tutorial that explains how a user can send test transactions, which will show how the new functionality works.
2. Testing Guide Core functions will be fully covered by unit tests to ensure functionality and robustness. In the guide, I will describe how to run these tests.
3. (Node.js)SDK: Client Tool Development and testing of the basic abilities of the client tool, including computing a shared secret by ECDH, computing encrypted public key of the receiver, computing ephemeral private key(adding points in elliptic curve cryptography), and pushing transactions to relayer through HTTPS.
4. (Candence)Smart contracts: Anonymous NFT Development and testing of the core functions of the Anonymous NFT smart contract, including minting new NFT, transferring NFT, and burning NFT. In particular, it is important to note that the address of the owner stored in the contract is encrypted by the scan public key of the receiver. At the same time, when users need to perform the transfer or burn operations, the smart contract needs to verify the signature of the private key corresponding to this address on-chain.
5. HTTPS Service: Node.js Relayer Build an early-stage HTTPS service relayer including accepting requests from users and pushing transactions to NFT smart contract, and creating a new account if needed.

Team

Yahuang Wu

Future Plans

alxflw commented 2 years ago

Thanks for the submission @wuyahuang. We'll review and get back to you soon!

alxflw commented 2 years ago

Hi @wuyahuang - we reviewed your proposal in detail and decided to pass because it is unclear if the impact on the developer ecosystem will be high enough.

Thanks for taking the time to submit your proposal and feel free to reach me directly on Discord in case you have further questions: alx-flw.find#6198.