At ZenGo we always explore new blockchains and how Threshold Signatures Scheme (TSS) can enhance their native capabilities. By using TSS, we remove the burden of a single atomic private key and split the responsibility between multiple parties. Today we share the details on adding TSS support for the Klaytn blockchain.
Klaytn is a high profile blockchain born in Korea. Klaytn is backed by Kakao, the company behind Korea’s leading Instant Messaging app with hundreds of millions registered users. Klaytn explicit goal is blockchain mass adoption. We believe that our TSS technology is pivotal for such goal.
In this blog post, we at ZenGo would like to share the details of our TSS for Klaytn project, executed by our blockchain research team.
Threshold Signatures Scheme (TSS)
Threshold Signatures Scheme (TSS) removes the burden of the single atomic private key and splits the responsibility between multiple parties.
Each of the parties generates its own secret and uses this secret to distributively sign a transaction without revealing the secret to the other parties. For a high-level overview of TSS please refer to our blog post.
We have invested a lot of resources in implementing TSS and making it compatible and reusable for different kinds of blockchains and digital signatures algorithms. This compatibility allows us to rapidly onboard and add TSS support to new blockchains.
At ZenGo, we have already implemented Threshold Signatures Scheme (TSS) support for Bitcoin, Ethereum, Binance Coin (BNB) , Zilliqa (ZIL) , Libra, Tezos and others and we are always looking to extend our TSS support to other coins.
We choose Klaytn for the following main reasons:
- Klaytn’s trust in our project: Klaytn partnered withr ZenGo to be one of the first official wallets to support its coin.
- Timing and mass distribution: Klaytn is Kakao’s global public blockchain project that aims to bring user-friendly blockchain experience to millions. Kakao is the company behind KakaoTalk, Korea’s leading Instant Messaging app with hundreds of millions registered users. We believe that our TSS technology, which enables a user-friendly experience by relieving the pressure associated with owning a private key, is a key to such mass adoption.
- Geography: The Southeast Asia region seems to be the most exciting geography for cryptocurrency right now, with both high adoption rate by consumers and advanced regulation by governments.
- Technical maturity: To implement a TSS wallet with a blockchain, we need a mature enough developer environment. Klaytn network had all the required ingredients in its testnet:
- a faucet ( https://baobab.wallet.klaytn.com/access?next=faucet ) so we could test everything without risking money
- a blockchain explorer (https://baobab.scope.klaytn.com//) so that we could confirm that our transactions were successfully recorded on the blockchain
- Access to testnet was provided via API and an Open source SDK (https://github.com/klaytn/caver-js) which was far more comfortable than setting up a full node
TSS is important even if Klaytn supports MultiSig
It’s worth noting that even though Klaytn supports smart contracts that allow users to add multi-signature security, TSS can provide further advantages to current smart contracts. One main advantage is that TSS transactions look exactly the same as regular transactions. Unlike with MultiSig transactions, the TSS “magic” is applied in the mathematical layer and not in the application layer.
- If MultiSig is realized through smart contracts it may incur additional fees for the smart contract execution. Additionally, MultiSig smart contract functionality might be difficult to verify, as shown by the multiple incidents suffered by some Ethereum-based MultiSig smart contracts.
- The control mechanism is not exposed to the world: With TSS, the signing parties are never exposed and therefore, adversaries cannot learn about the various parties or their control structure, nor can they monitor changes to them.
The Open-source SDK
Klaytn is an enterprise-grade, service-centric platform. Klaytn blockchain network design is innovative, as it combines the features of both public blockchains (decentralized data & control, distributed governance) and private blockchains (low latency, high scalability).
As mentioned above supports not only a native token (KLAY) but also smart contracts to enable Ethereum token standards, such as ERC20 and ERC721. It adds new features that Ethereum does not provide, such as role-based accounts and fee delegation.
However, because TSS is blockchain agnostic, it is able to easily integrate with this unique architecture and support all messages, related to both native and smart contracts based tokens. This compatibility is what allowed us to complete this SDK in a matter of days with no need for “integration” on the Klaytn side.
We modified Klaytn SDK by applying TSS generation and signing, using a client-server architecture. The server acts solely as the co-signer in the two-party protocol and holds no logic specific to Klaytn.
- Generation: We changed the code so that the public key is jointly generated by our client-server architecture and exported to the Klaytn client instead of being computed from a private key. Of course, this part does not prove anything as any random string can be successfully converted into an address. The real challenge now is to sign a transaction from this address.
- Signing: The main change was in the signing function. we changed how the message was exported so that it was jointly signed by our TSS client-server architecture.
The SDK can be accessed directly by using the command-line, as shown in the demo below, or by including the code in other Klaytn projects
Conclusions and Future plans
All in all, it was very rewarding for us to add TSS support to a relevant crypto asset. It was very straightforward to create a developer-ready Klaytn TSS version by leveraging our previous experience with generic TSS infrastructure.
Our work with TSS is not done yet. We plan to continue to extend this project in the future. We plan to work with Klaytn community to provide TSS support for the more advanced use cases enabled by Klaytn, such as smart contracts. We are open sourcing our SDK to encourage developers to incorporate it in their Klaytn projects. As always, we welcome feedback and peer review to make our code even better. For any request or feedback send us a message at [email protected]