Ring Signature is a crypto operation that can obfuscate or hide the sender behind a group of similar senders. More specifically, all the senders attach their signatures to the same message, it is computationally challenging (if possible) to determine which one from the group actually created and signed the message. It has been used in some privacy focusing block chain projects, the most famous project is Monero , which applies Ring Signature to protect a user’s privacy in the input side of a transaction.
Ring Signature’s signing/verification operation can be built using the following crypto primitives:
Async Signature: ECDH (or RSA) sign/verify
Hash Operation: SHA
These crypto primitives can further be implemented using big number math operations (addition, multiplication, power) on ECDSA curves (e.g. BN128). In particular, Ethereum EVM provides support for some big number math operations through the so called pre-compiled contracts. Therefore, Ring Signature can be implemented at layer two level using dApps, for example heiswap.
Harmony ONE block chain is compatible with Ethereum EVM, it also provides pre-compiled contracts for the following hash and big number math operations sha256hash,bn256Add,bn256ScalarMul,BigModExp. So implementing Ring Signature on Harmony ONE block chain using dApp is can be done by porting heiswap implementation.
However, as these ECDSA math operations runs on EVM, they are time consuming and costly (in terms of gas). We can speed up / save cost by moving these implementation from layer two to layer one by introducing additional pre-compiled operations for Ring Signature at higher level:
Ring Signature Primitive: rign_sign/ring_verify: fastest but not flexible
ECDSA curve primitives: ecc_add, ecc_mul, ecc_pow, hash2curve, oncurve
The first approach is faster but not flexible for future algorithms and the second one is slower than the first but more flexible. Either approaches, if added to EVM, will create a faster and cheaper Ring Signature for Harmony ONE.