Skip to content

The Difference Between Zero knowledge Proofs and Digital Signatures

Posted on:December 9, 2023 at 10:22 AM

Zero knowledge proofs and digital signatures are advanced cryptographic concepts. Zero knowledge proofs are used for privacy preservation and secure authentication and digital signatures ensures the integrity, security and authenticity of transactions.

Digital signatures such as ECDSA and EdDSA are cryptographic algorithms used for creating digital signatures. In ECDSA, the secp256k1 curve refers to specific parameters of the elliptic curve used in the algorithm. A private key, generated as a random 256-bit number, which is then used along with the secp256k1 curve to calculate and create a public key. Similarly, EdDSA using the ed25519 curve also generates a public key from a private key. However, EdDSA has a different curve and algorithm than ECDSA. Both ECDSA and EdDSA are used for both signing and verifying messages.

To create a signature, a hash value is generated for the message, so then the private key, the hash of a message, and the domain parameters are used in the algorithms, a signature is generated and consists of two integers (r and s).

To verify the signature, the signer’s public key, the domain parameters, the signature (both r and s), and the hash of the original message are used with the same algorithm (either ECDSA or EdDSA) confirming the message’s authenticity so the output is a value v that is matches the r part of the signature. The signature is verified if v = r.

Zero knowledge proofs allow one party (the prover) to convince another party (the verifier) that they possess specific knowledge without disclosing any information.

In blockchain network, Zero knowledge proofs enables private transactions where details like the sender, receiver, and amount are hidden using a type of zero knowledge proofs called zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) or zk-STARKs (Zero-Knowledge Scalable Transparent ARguments of Knowledge).

When a private transaction is created using zk-SNARKs or zk-STARKs, it proves that the conditions for a valid transaction are met without revealing transaction’s details. This includes proving that the sender has enough funds, the transaction doesn’t create new funds, and the funds are sent to a valid address. Even with the transaction details being hidden, the sender still signs the transaction using their private key. Validators (or miners) network verify the transaction by checking the zk-SNARK or zk-STARKs proof and the digital signature. While the public key for signature verification is technically visible, but based on the platform’s overall designs and architectures, it is not always tied to a type of address. Thus, there are different type of addresses such as transparent addresses (t-addresses) and shielded addresses (z-addresses). The use of shielded addresses and a zero knowledge proof ensures that the transaction details remain private. This proof allows them to verify that the transaction is valid and follows that like no double-spending, valid amounts being transferred without seeing the transaction’s details.

The integration of zero knowledge proofs and digital signatures enables the chain to maintain both the privacy of transactions and the security/integrity of a blockchain. Zero knowledge proofs focus on saying the truth of a statement without revealing any information while digital signatures focus on verifying the integrity of transactions and ensuring authentic and unaltered.