A digital signature is a cryptographic tool employed in fields such as cybersecurity, e-commerce, and software distribution. They provide a method for verifying the origin and integrity of digital messages or documents.
However, Blockchain technology popularized the use of digital signatures as an integral part of its decentralized and transaction verification process. This article closely examines how digital signature works, various algorithms used by blockchains, and their applications in the Web3 space.
Source: CoinGeek
A digital signature is a cryptographic technique used to verify the authenticity and integrity of digital messages, documents, or transactions. Digital signatures are considered more secure than electronic signatures.
Traditionally, signatures ensure agreements are legally binding, validate the identities of the involved parties, and have definite acceptance of the terms of the contract. Digital signatures go a step further to solve the problem of alteration and forgery, which makes it a more secure form of signature.
The main features of a digital signature are:
Source: WikiBooks
Asymmetric cryptography is a method of encrypting and decrypting data with two different keys, thus making one of the keys, (that’s the public key) openly shared with anyone. The other key, known as the private key, is a confidential and securely stored key known only to the signer. The data encrypted with one can only be decrypted with the other.
In cryptography, a key is often a string of numbers and letters, used for scrambling data so that it appears random. However, anyone with the right key for decrypting the data can unscramble it back to its original form.
For example, suppose we take an image and encrypt it with a key; let’s say the key is 28j932d8kd8. Encrypted with this key, our image is seen as “X5CSycg14=xJ”. However, by decrypting it with the right key, we can get our image back.
Hashing is the process of converting data (texts, files), an input of variable size into an output of fixed-length of letters and numbers, by using hash functions. It is a one-way process, where hash values cannot be reverted to the original input, but the same piece of input will always generate the same hash value.
Source: CyberHoot
In the image above, a piece of text (a riddle) passes through a hash function (SHA-256) and is converted to a hash (a fixed length of numbers and letters).
An algorithm that processes the data to be signed, producing a fixed-size hash value. The hash function ensures that the signature remains a fixed length, regardless of the size of the original data.
The final output of the hash function is the hash value, also known as digest, which is unique to each input. The size of the hash value ranges from 32-bit to 256-bit, depending on the hash function used. Hash values are only required for a single use in processes such as data authentication or the creation of digital signatures. Therefore, a digital signature is unique per transaction.
To execute a digital signature, you would need the following:
A Key Pair: The key pair consists of a public/private key pair. The private key is used to create a signature, and the corresponding public key is used to verify the signature.
The Data to be Signed: The content or message that you want to sign. This could be a document, a transaction, or any digital data.
Hash Function: A hash function is applied to the data to create a fixed-size hash value. This hash value is then encrypted with the private key to generate the digital signature.
Digital Signature Algorithm: An algorithm that combines the private key with the data to be signed, typically involving a hash function. This algorithm generates the digital signature.
Verification Mechanism: Anyone who wants to verify the digital signature needs access to the public key and the same digital signature algorithm. The public key is used to decrypt the digital signature and reveal the hash value, which is then compared with the hash value calculated from the original data.
Source: CamCert — The sender signs (encrypts) the hash value with their private key, and the receiver verifies the authenticity of the message by comparing hash values
Step 1: Create a digest/hash value by passing the original data through a hash function
Step 2: Sign the digest with the private key of the sender to create an encryption.
Step 3: Send the encrypted file to the recipient, who can decrypt it using the public key of the sender to generate a digest.
Step 4: Following decryption, run the data through the same hash function to generate an equivalent digest.
Step 5: Validate data integrity by comparing the newly generated hash with the hash value received alongside the data. A match confirms the integrity of the data.
Let’s use this illustration of a transfer of a document between Mark the sender and Karen the recipient.
The choice of Digital Signature algorithms depends on factors such as security requirements, key size, and performance considerations. Each algorithm has its strengths and weaknesses, and its usage may evolve based on advancements in cryptography and emerging security challenges.
This section discusses the most commonly used digital signature algorithms in blockchain technology.
ECDSA (Elliptic Curve Digital Signature Algorithm): This uses shorter keys and demands fewer computational resources and utilizes “elliptic curve cryptography keys” which are finite groups of points on a curve where certain operations are easily executed in one direction but challenging in the reverse direction. For security, ECDSA relies on the discrete log problem. It is the most popular signature algorithm used in blockchain technology.
EdDSA (Edwards-curve Digital Signature Algorithm): This is a modern and efficient digital signature algorithm based on elliptic curve cryptography. It was introduced to address certain concerns and improve performance compared to other signature schemes like ECDSA. The algorithm is designed to provide strong security with relatively small key sizes, making it well-suited for various applications, including blockchain technology e.g. Cardano, and Solana.
The Schnorr Algorithm: A Schnorr signature is a type of digital signature algorithm that enables aggregation, that’s. multiple signatures on the same message can be bundled into one signature. This signature is not only more space-efficient but also facilitates a more efficient verification process.
It proves effective in scenarios involving multiple parties signing a common message, like authorizing a transaction from a multi-signature (multisig) address. In such cases, each participant must provide their public key and signature. Consequently, if three parties intend to sign the same message, the proof will encompass three public keys and three signatures. This appears to be inefficient in computation and storage since each node is required to execute the signature verification function three times and store three distinct sets of signatures and public keys.
The Schnorr algorithm simply produces a signature that is valid for the sum of their public keys. Key aggregation can reduce gas fees and improve base-layer scalability as signatures coming from a multi-signature transaction take up the same amount of space in a block as signatures coming from a single-party transaction.
The BLS Signature: The BLS (Boneh-Lynn-Shacham) cryptographic algorithm is based on bilinear pairings over elliptic curve groups. It was introduced by Dan Boneh, Ben Lynn, and Hovav Shacham in 2001. The primary focus of BLS cryptography is on efficient and secure signature schemes that support unique properties like aggregation. Additionally, the BLS Signature is used on Ethereum 2.0 and Chia.
Bitcoin (BTC):
Hashing Algorithm: SHA-256
Digital Signature Algorithm: ECDSA, Schnoor (TapRoot Soft Fork)
Ethereum (ETH):
Hashing Algorithm: Keccak
Digital Signature Algorithm: ECDSA
Litecoin (LTC):
Hashing Algorithm: Scrypt
Digital Signature Algorithm: ECDSA
Ripple (XRP):
Hashing Algorithm: SHA-256
Digital Signature Algorithm: ECDSA
Cardano (ADA):
Hashing Algorithm: Keccak
Digital Signature Algorithm: EdDSA (Edwards-curve Digital Signature Algorithm)
Polkadot (DOT):
Hashing Algorithm: Blake2
Digital Signature Algorithm: EdDSA
Tezos (XTZ):
Hashing Algorithm:Blake2b
Digital Signature Algorithm: EdDSA
BNB Chain (BNB):
Hashing Algorithm: Keccak (used for BEP-2 tokens)
Digital Signature Algorithm: ECDSA
Bitcoin utilizes the Elliptic Curve Digital Signature Algorithm (ECDSA) to generate a unique signature for each transaction. However, with recent advancements, the Schnorr algorithm has been introduced through the TapRoot soft fork. This algorithm, known for its efficiency in terms of storage efficiency and verification speed, can enhance Bitcoin’s scalability by up to 30%, with its transaction aggregation feature.
)
Source: TimesofIndia — Only signed transactions can be propagated and validated by the network nodes
The basic mechanism of Bitcoin transactions involves a series of steps which includes the use of digital signature.
Here’s an overview:
Now that we understand the workings and importance of signatures. Let’s highlight the practical applications of digital signatures in securing transactions, authenticating identities, and ensuring the integrity of data in the Web3 ecosystem.
Take, for instance, Alice wants to transfer Ethereum to Bob. She signs the transaction with her private key, generating a digital signature. The Ethereum network verifies the signature using Alice’s public key, ensuring the transaction is authorized by her. This is also applicable to the transfer of ownership of an NFT, as it is recorded on the blockchain with a signed transaction, ensuring the legitimacy of the ownership change.
Smart contracts are built to interact with the signatures and can execute transactions upon verification. For example, in a decentralized lending platform, a user initiates a loan request. The request triggers a smart contract execution. The user signs the transaction with their private key, and the smart contract verifies the signature to execute the loan agreement.
A user logs into a decentralized application (dApp) using their blockchain identity, e.g. Ethereum address. The dApp requests a signed message from the user (private key), serving as proof of ownership. The digital signature authenticates the user’s identity.
This can also be an easy way to onboard new Web3 users, as they don’t need to create an account and store yet another password, users can hide their identity and don’t have to necessarily reveal private details like their email address.
An artist signs a digital art file with their private key before minting it as an NFT. The digital signature ensures the integrity of the artwork, and the artist cannot later deny authorship.
In a decentralized voting platform, voters cast their ballots by signing their choices with their private keys. The digital signatures authenticate the votes and ensure each voter can verify their contribution. This application is seen in governance voting and consensus protocol voting.
A user transfers a token from one blockchain to another using a bridge protocol. The user signs a transaction on the source chain, and the destination chain verifies the signature, allowing the cross-chain transfer.
Digital signatures remain one of the foolproof ways of authentication on the blockchain. However, the development of large-scale quantum computers will pose a threat to the security of blockchains, because cryptographic algorithms can be swiftly deciphered by quantum computers.
Quantum computers can process tasks at incredible speeds, accomplishing in seconds what would take traditional computers hours, bad actors can use a quantum computer to lead quantum attacks that could compromise a whole blockchain.
Nevertheless, they can be prevented by post-quantum signatures, which are already in development, although they would take up a larger storage space on the blockchain.
Digital Signatures verify the authenticity and integrity of data, based on the principles of asymmetric cryptography and hashing. It works by using the sender’s private key to authenticate the hashed form of the data, and the receiver verifying with the sender’s public key. The most commonly used cryptographic algorithms by blockchains are the ECDSA, EdDSA, Schnoor, and BLS signatures.
Additionally, the use of digital signatures is mostly applicable in transaction authentication, smart contract execution, governance voting, cross-chain transfers, and data integrity of NFTs.
A digital signature is a cryptographic tool employed in fields such as cybersecurity, e-commerce, and software distribution. They provide a method for verifying the origin and integrity of digital messages or documents.
However, Blockchain technology popularized the use of digital signatures as an integral part of its decentralized and transaction verification process. This article closely examines how digital signature works, various algorithms used by blockchains, and their applications in the Web3 space.
Source: CoinGeek
A digital signature is a cryptographic technique used to verify the authenticity and integrity of digital messages, documents, or transactions. Digital signatures are considered more secure than electronic signatures.
Traditionally, signatures ensure agreements are legally binding, validate the identities of the involved parties, and have definite acceptance of the terms of the contract. Digital signatures go a step further to solve the problem of alteration and forgery, which makes it a more secure form of signature.
The main features of a digital signature are:
Source: WikiBooks
Asymmetric cryptography is a method of encrypting and decrypting data with two different keys, thus making one of the keys, (that’s the public key) openly shared with anyone. The other key, known as the private key, is a confidential and securely stored key known only to the signer. The data encrypted with one can only be decrypted with the other.
In cryptography, a key is often a string of numbers and letters, used for scrambling data so that it appears random. However, anyone with the right key for decrypting the data can unscramble it back to its original form.
For example, suppose we take an image and encrypt it with a key; let’s say the key is 28j932d8kd8. Encrypted with this key, our image is seen as “X5CSycg14=xJ”. However, by decrypting it with the right key, we can get our image back.
Hashing is the process of converting data (texts, files), an input of variable size into an output of fixed-length of letters and numbers, by using hash functions. It is a one-way process, where hash values cannot be reverted to the original input, but the same piece of input will always generate the same hash value.
Source: CyberHoot
In the image above, a piece of text (a riddle) passes through a hash function (SHA-256) and is converted to a hash (a fixed length of numbers and letters).
An algorithm that processes the data to be signed, producing a fixed-size hash value. The hash function ensures that the signature remains a fixed length, regardless of the size of the original data.
The final output of the hash function is the hash value, also known as digest, which is unique to each input. The size of the hash value ranges from 32-bit to 256-bit, depending on the hash function used. Hash values are only required for a single use in processes such as data authentication or the creation of digital signatures. Therefore, a digital signature is unique per transaction.
To execute a digital signature, you would need the following:
A Key Pair: The key pair consists of a public/private key pair. The private key is used to create a signature, and the corresponding public key is used to verify the signature.
The Data to be Signed: The content or message that you want to sign. This could be a document, a transaction, or any digital data.
Hash Function: A hash function is applied to the data to create a fixed-size hash value. This hash value is then encrypted with the private key to generate the digital signature.
Digital Signature Algorithm: An algorithm that combines the private key with the data to be signed, typically involving a hash function. This algorithm generates the digital signature.
Verification Mechanism: Anyone who wants to verify the digital signature needs access to the public key and the same digital signature algorithm. The public key is used to decrypt the digital signature and reveal the hash value, which is then compared with the hash value calculated from the original data.
Source: CamCert — The sender signs (encrypts) the hash value with their private key, and the receiver verifies the authenticity of the message by comparing hash values
Step 1: Create a digest/hash value by passing the original data through a hash function
Step 2: Sign the digest with the private key of the sender to create an encryption.
Step 3: Send the encrypted file to the recipient, who can decrypt it using the public key of the sender to generate a digest.
Step 4: Following decryption, run the data through the same hash function to generate an equivalent digest.
Step 5: Validate data integrity by comparing the newly generated hash with the hash value received alongside the data. A match confirms the integrity of the data.
Let’s use this illustration of a transfer of a document between Mark the sender and Karen the recipient.
The choice of Digital Signature algorithms depends on factors such as security requirements, key size, and performance considerations. Each algorithm has its strengths and weaknesses, and its usage may evolve based on advancements in cryptography and emerging security challenges.
This section discusses the most commonly used digital signature algorithms in blockchain technology.
ECDSA (Elliptic Curve Digital Signature Algorithm): This uses shorter keys and demands fewer computational resources and utilizes “elliptic curve cryptography keys” which are finite groups of points on a curve where certain operations are easily executed in one direction but challenging in the reverse direction. For security, ECDSA relies on the discrete log problem. It is the most popular signature algorithm used in blockchain technology.
EdDSA (Edwards-curve Digital Signature Algorithm): This is a modern and efficient digital signature algorithm based on elliptic curve cryptography. It was introduced to address certain concerns and improve performance compared to other signature schemes like ECDSA. The algorithm is designed to provide strong security with relatively small key sizes, making it well-suited for various applications, including blockchain technology e.g. Cardano, and Solana.
The Schnorr Algorithm: A Schnorr signature is a type of digital signature algorithm that enables aggregation, that’s. multiple signatures on the same message can be bundled into one signature. This signature is not only more space-efficient but also facilitates a more efficient verification process.
It proves effective in scenarios involving multiple parties signing a common message, like authorizing a transaction from a multi-signature (multisig) address. In such cases, each participant must provide their public key and signature. Consequently, if three parties intend to sign the same message, the proof will encompass three public keys and three signatures. This appears to be inefficient in computation and storage since each node is required to execute the signature verification function three times and store three distinct sets of signatures and public keys.
The Schnorr algorithm simply produces a signature that is valid for the sum of their public keys. Key aggregation can reduce gas fees and improve base-layer scalability as signatures coming from a multi-signature transaction take up the same amount of space in a block as signatures coming from a single-party transaction.
The BLS Signature: The BLS (Boneh-Lynn-Shacham) cryptographic algorithm is based on bilinear pairings over elliptic curve groups. It was introduced by Dan Boneh, Ben Lynn, and Hovav Shacham in 2001. The primary focus of BLS cryptography is on efficient and secure signature schemes that support unique properties like aggregation. Additionally, the BLS Signature is used on Ethereum 2.0 and Chia.
Bitcoin (BTC):
Hashing Algorithm: SHA-256
Digital Signature Algorithm: ECDSA, Schnoor (TapRoot Soft Fork)
Ethereum (ETH):
Hashing Algorithm: Keccak
Digital Signature Algorithm: ECDSA
Litecoin (LTC):
Hashing Algorithm: Scrypt
Digital Signature Algorithm: ECDSA
Ripple (XRP):
Hashing Algorithm: SHA-256
Digital Signature Algorithm: ECDSA
Cardano (ADA):
Hashing Algorithm: Keccak
Digital Signature Algorithm: EdDSA (Edwards-curve Digital Signature Algorithm)
Polkadot (DOT):
Hashing Algorithm: Blake2
Digital Signature Algorithm: EdDSA
Tezos (XTZ):
Hashing Algorithm:Blake2b
Digital Signature Algorithm: EdDSA
BNB Chain (BNB):
Hashing Algorithm: Keccak (used for BEP-2 tokens)
Digital Signature Algorithm: ECDSA
Bitcoin utilizes the Elliptic Curve Digital Signature Algorithm (ECDSA) to generate a unique signature for each transaction. However, with recent advancements, the Schnorr algorithm has been introduced through the TapRoot soft fork. This algorithm, known for its efficiency in terms of storage efficiency and verification speed, can enhance Bitcoin’s scalability by up to 30%, with its transaction aggregation feature.
)
Source: TimesofIndia — Only signed transactions can be propagated and validated by the network nodes
The basic mechanism of Bitcoin transactions involves a series of steps which includes the use of digital signature.
Here’s an overview:
Now that we understand the workings and importance of signatures. Let’s highlight the practical applications of digital signatures in securing transactions, authenticating identities, and ensuring the integrity of data in the Web3 ecosystem.
Take, for instance, Alice wants to transfer Ethereum to Bob. She signs the transaction with her private key, generating a digital signature. The Ethereum network verifies the signature using Alice’s public key, ensuring the transaction is authorized by her. This is also applicable to the transfer of ownership of an NFT, as it is recorded on the blockchain with a signed transaction, ensuring the legitimacy of the ownership change.
Smart contracts are built to interact with the signatures and can execute transactions upon verification. For example, in a decentralized lending platform, a user initiates a loan request. The request triggers a smart contract execution. The user signs the transaction with their private key, and the smart contract verifies the signature to execute the loan agreement.
A user logs into a decentralized application (dApp) using their blockchain identity, e.g. Ethereum address. The dApp requests a signed message from the user (private key), serving as proof of ownership. The digital signature authenticates the user’s identity.
This can also be an easy way to onboard new Web3 users, as they don’t need to create an account and store yet another password, users can hide their identity and don’t have to necessarily reveal private details like their email address.
An artist signs a digital art file with their private key before minting it as an NFT. The digital signature ensures the integrity of the artwork, and the artist cannot later deny authorship.
In a decentralized voting platform, voters cast their ballots by signing their choices with their private keys. The digital signatures authenticate the votes and ensure each voter can verify their contribution. This application is seen in governance voting and consensus protocol voting.
A user transfers a token from one blockchain to another using a bridge protocol. The user signs a transaction on the source chain, and the destination chain verifies the signature, allowing the cross-chain transfer.
Digital signatures remain one of the foolproof ways of authentication on the blockchain. However, the development of large-scale quantum computers will pose a threat to the security of blockchains, because cryptographic algorithms can be swiftly deciphered by quantum computers.
Quantum computers can process tasks at incredible speeds, accomplishing in seconds what would take traditional computers hours, bad actors can use a quantum computer to lead quantum attacks that could compromise a whole blockchain.
Nevertheless, they can be prevented by post-quantum signatures, which are already in development, although they would take up a larger storage space on the blockchain.
Digital Signatures verify the authenticity and integrity of data, based on the principles of asymmetric cryptography and hashing. It works by using the sender’s private key to authenticate the hashed form of the data, and the receiver verifying with the sender’s public key. The most commonly used cryptographic algorithms by blockchains are the ECDSA, EdDSA, Schnoor, and BLS signatures.
Additionally, the use of digital signatures is mostly applicable in transaction authentication, smart contract execution, governance voting, cross-chain transfers, and data integrity of NFTs.