Schnorr Signature and Tendermint

Park Juhyung
CodeChain
Published in
3 min readMay 10, 2019
Claus Schnorr (Image from Konrad Jacobs — https://opc.mfo.de/detail?photoID=3722)

Digital Signature Algorithms of Blockchains

The asymmetric key signature algorithm, which consists of a public key and a private key, is the underlying technology of the blockchain. The address of the wallet is created from the public key, and the ownership of the goods in the wallet is verified using the private key. In blockchain networks, user-created transactions always contain signatures and these signatures should be used to validate transactions.

Many blockchain projects use the ECDSA signature algorithm. This is because ECDSA can achieve similar safety with fewer bits compared to RSA. If RSA needs 1024 bits to offer a certain level of safety, ECDSA offers equal results with just 192 bits. Similarly, 2048 bits in RSA can be achieved with 256 bits in ECDSA. Since most of the block is composed of public keys and signatures, small signatures and keys ultimately result in low network and storage costs.

The Schnorr signature scheme is the emerging signature scheme for ECDSA in the blockchain industry. Its signing method is simpler, has a smaller signature size, and offers the ability to combine multiple signatures as well. For more information, please check this post written by Jeong Hyunsik, a software engineer of KodeBox.

CodeChain and Tendermint Consensus Algorithms

CodeChain’s mainnet uses the Tendermint consensus algorithm. Tendermint is a BFT consensus algorithm where appointed nodes (called committees) send and receive messages amongst each other and agree on blocks. In this process, the types of messages that are sent and received are known as Propose, Prevote, and Precommit. These messages include the signature of the node that created the message. A block determined as a result of consensus contains a Precommit signature of the nodes that agreed on the block.

The larger the size of a committee, the more resilient it is against abnormally behaving nodes, so the size of the committee is important for BFT consensus algorithms. However, as the size of the committee grows, the amount of messages sent and received, the messages to be stored, and the messages to be verified all increase, which slows down the processing of blocks and increases the load on the network and disk.

Currently, CodeChain’s mainnet is composed of 30 nodes, which work together to create a block. Each block contains 29–30 Precommits, and 30 signatures add up to approximately 2 KB. Whether the number of transactions is large or small, a load of 2KB is always added to the block, and since it the network is still in the beginning stages, Precommit messages occupy most of the data currently being exchanged.

Plans to Adopt the Schnorr Signature and the Expected Effects

As mentioned above, Schnorr signatures allow you to combine multiple signatures into a single signature. The CodeChain team plans to combine the Precommits stored in the blocks into a single signature. With this feature enabled, disk usage can be reduced by up to a factor of 10, and network usage can be significantly reduced. You can also increase the size of the committee at a lower cost since the sum of three signatures, the sum of 30 signatures, and the sum of 300 signatures are all the same.

The Difficulty of Adopting a New Signature Algorithm

Even a small bug in the cryptographic library can be a fatal security issue, so make sure you carefully check that the library is heavily used and that the implementation is stable enough. Since the Schnorr signature is a method that is not yet widely used, there is a big risk to adopt it before other projects. However, as long as the benefits of its adoption is attractive enough, it is worth looking into and utilizing it in your own project.

Conclusion

Signature algorithms are one of the underlying techniques of blockchains. Since all actions involve signatures, the processing speed of the network as a whole is proportional to the processing speed of signatures, and the network and disk load is proportional to the size of the keys and signatures. The CodeChain team is hard at work to come up with ways to save money and improve network safety, and one of them is testing the function that collects Schnorr signatures.

--

--