Hey everyone! The past few months have been extremely busy for us, from the numerous community events and meetups to collaborations and integration with a very diverse group of projects. On top of the community and ecosystem expansions, a lot of work was also done on the technical side to improve Kyber’s reserve system, which we will cover in this technical update.

We will also share about developments made on the WBTC initiative, trading enhancements, and on other ecosystem efforts. Lastly, we’ve developed a number of tools to provide stronger support for both developers and end users.

List of Updates

Development of the Permissionless Orderbook Reserve

Designing the Automated Price Reserve (APR)

Reinforcing the Security of Reserves

Optimising Our Reserves

WBTC Progress

Trading Enhancements

ERC1257: Proof of Payments by Smart Contracts

DutchX by Gnosis Integrates Kyber

Creation of Libraries for Transaction Monitoring

Development of Software Plugins

Development of Sign-In Widget

The Reserve System

The classic reserve, the Fed Price Reserve, was designed to give more flexibility to the reserve manager. However, it came with a tradeoff — reserve managers are required to run their own server, set up their pricing algorithm and pay for transactions to be broadcasted on-chain in order to update their rates.

To make the reserves more accessible, 2 new types of reserves were developed and introduced recently to make both the deployment of new reserves and contribution of liquidity a lot easier and simpler. Moreover, the orderbook reserve will also be Kyber’s first permissionless reserve. We also made some improvements to our pricing and rebalancing algorithms to provide more competitive rates for our users.

Development Of The Permissionless Orderbook Reserve

As part of our plan to open up the reserves system and making it more accessible, we designed the permissionless orderbook reserve. This new reserve type is our first implementation of a permissionless reserve where users are able to do both deployment of reserves and contribution of liquidity in a permissionless manner. Unlike the existing Fed Price Reserve, no permissions are required to list the orderbook reserve on the network.

Moreover, the orderbook reserve also introduces a new order type — limit orders. Users can now create bid and ask limit orders without any permission. Users are required to procure and deposit KNC (Kyber Network Crystals) to create these orders on the reserve. Taking orders will remain unchanged as per the traditional seamless way of making a trade.

Safeguards such as minimum order size and requiring KNC deposits were put in place to prevent malicious actors from spamming the orderbook. Details on the permissionless orderbook reserves are close to being finalised and will be announced with the corresponding documentation and guide when it is ready.

Designing The Automated Price Reserve

The flexibility of managing a Fed Price Reserve came with a relatively steep learning curve and some financial and resource costs that arose from having to run and maintain a server and/or scripts to feed prices on-chain.

We have created the Automated Price Reserve (APR) with ease of maintenance as a top consideration. As such, the APR is capable of calculating the conversion rates entirely on-chain. This means that the reserve managers no longer need to incur the costs described above. Additionally, the APR can also help to discover the price of a newly created token.

Following the initial deployment of Bigbom’s APR reserve, we are continuing to rollout the APR to more projects. The 3 latest projects that we helped support in the deployment of their APR contracts are Midas Protocol, Distributed Credit Chain and Dether. More information regarding the APR will be published soon.

Reinforcing The Security Of Our Reserves

Ensuring the security of our reserves is a major focus at Kyber. One of the more notable solutions was the development of a new mutex algorithm, which will be used to secure the smart contracts of our reserves. Unlike traditional mutex implementations where 2 values are used (i.e. 2 SSTORE operations) to represent the current state of the lock, an incremental value was used as a flag instead. This trick allowed us to reduce gas costs by approximately half. We also made a pull request to share this optimisation with OpenZeppelin and it was subsequently merged with the main codebase.

Optimising Our Reserve

We’re always on the lookout for ways to improve our Kyber reserve. Over the past few months, several improvements were made in order to improve the robustness and competitiveness of the reserve:

Adjusted spread parameters to offer a more competitive rate compared to global prices. Fine-tuned our sanity rates algorithm to ensure that it more accurately reflects the reserve’s limits of the current token price. Optimised our rebalancing algorithm for the ETH orderbook. Exploring how BTC can be incorporated into the various algorithms.

WBTC Progress

Since the announcement of WBTC (Wrapped Bitcoin) last month, we’ve secured a number of key partners and projects to be part of the initiative to bring Bitcoin’s value and liquidity to Ethereum. A subsequent follow-up blog post will released in December to describe in detail all of the developments to date. In the meantime, here are some technical updates on WBTC.

Smart Contracts Completed And Audited

The WBTC smart contract implementations are completed and have been successfully audited by several audit firms. Some of the security recommendations were also incorporated into the latest version of the smart contracts. You can read up on the audit reports and view the WBTC smart contract in the Github repo.

WBTC DAO Workflow Finalised

Governance of the WBTC token is through a decentralised autonomous organisation (DAO). DAO members are responsible for the following areas:

Adding or removing merchants and custodians in the network Changing DAO members or how the DAO works Pausing or resuming transfers on the token contract Changing logic to Mint or Burn tokens (if needed)

They are also expected to ensure that the BTC balances of custodians match the amount of minted WBTC tokens. Otherwise, the WBTC token contract will be paused, with appropriate actions taken.

Technical Workflow

DAO members will hold the keys to a multisig wallet, which owns a set of smart contracts. These smart contracts control the minting and burning of the WBTC token, as well as the addition and removal of merchants and custodians. ‘M’ of ’N’ signatures will be required to send transactions from the multisig wallet where M and N will be determined once the launch partners are ascertained.

Preparation Of The Kyber Protocol To Handle WBTC

As we approach the release of WBTC, we are making preparations to ensure that WBTC is well-supported for launch:

Developed the implementation of a new trading algorithm to support WBTC on the Kyber reserve. An initial inventory of WBTC tokens are being procured. WBTC will be listed on KyberSwap once it is released.

Trading Enhancements

A major area for enhancement is to allow a wider range of programs to interact with our protocol. We created the Trading API to give users access to our on-chain liquidity without much smart contract experience. The user is required to know basic Web3 knowledge like signing and broadcasting transactions. Applications written in a variety of programming languages can now integrate in a much simpler way than before.

The Trading API allows users to perform trading operations like getting supported tokens, conversion rates and the trade function in their applications. The APIs return a JSON formatted transaction payload which the user can serialize, encode and broadcast to the Ethereum blockchain using web3. The payload is configured such that no further modification from the user is necessary.

If you’d like to run through an example tutorial using the Trading API, please refer to our blog. More details of the Trading API can also be found on our Developer portal.

Ecosystem Collaboration

ERC1257: Proof Of Payments By Smart Contracts

At the moment, tracking payments made directly by smart contracts is difficult, as it is recorded as “internal transactions”. In addition, the lack of a unified standard to track and log payments makes it hard for tools that utilise these payment records (Eg. accounting applications, payment libraries), thereby hampering the adoption of decentralised token payments in the ecosystem.

Therefore, we created an Ethereum Improvement Proposal (EIP) for ERC1257 that proposes a Proof Of Payment standard to record payments made by both humans and smart contracts. ERC1257 standardises a set of basic parameters to log payments through a EVM log. The parameters are as follows:

event ProofOfPayment(address indexed _payer, address indexed _payee, address _token, uint _amount, bytes _data)

where

_payer denotes the entity which made the payment _payee denotes the entity which received the payment _token denotes the token the payment was made in _amount denotes the amount paid in basic token units _data denotes application specific auxiliary data

Our first implementation of the Proof of Payment recently went live on the mainnet. The deployed smart contract will be used in our payment tools like the KyberWidget, WooCommerce plugin and future payment tools. You can read our blog to learn more about the motivations behind it and the benefits it can bring to the ecosystem.

DutchX By Gnosis Integrates Kyber

DutchX is a decentralised exchange for ERC20 tokens created by Gnosis and based on the Dutch auction principle. It is one of the many projects that we’ve recently integrated with. We’ve created several tools to better facilitate liquidity and pricing for the users of DutchX for the ETH/KNC pair.

The first is a proof of concept smart contract that will arbitrage between DutchX and Kyber. This will ensure that the auctions will always finish and to ensure fair pricing (even if the market maker bots fail). Additionally, we’re in the midst of designing our market maker bots to ensure liquidity on DutchX.

Tools for Developers, Traders And Vendors

Creation Of Libraries For Transaction Monitoring

Vendors can implement the KyberWidget to allow their users to pay in tokens. When a transaction is made through the KyberWidget, it is sent to a wallet address that is controlled by the vendor. The transaction will contain information such as the order ID and the amount paid.

However, the vendor needs to ensure that the transaction is successful before they can process the order. To help them with this, we created the Transaction Monitoring libraries to monitor transactions coming out of the KyberWidget.

Our Transaction Monitoring library is currently supported on 2 languages; javascript and PHP. Their exact implementations differ from one another but the general purpose served is still the same. The Transaction Monitoring widget will periodically query the Ethereum blockchain to check the confirmation status of these transactions; transactions which were added into a database by the vendor’s server. The choice of database to be used is up to the vendor. With our monitor widget, vendors will no longer need to worry about the underlying logic behind querying transaction status or about node glitches as our widget leverages multiple node sources.

Development Of Software Plugins

Popular content management systems like WordPress offer plugins to help their users extend the functionalities of their website. The most popular of these plugins are often customisable to allow their users to tailor it to their requirements. On top of that, these plugins may also be further extended through support from the developer community.

A very popular plugin for creating e-commerce websites is WooCommerce, which is estimated to power over 28% of all online stores. We created an extension of the WooCommerce plugin to allow for token payments in e-commerce stores. By using our extension, vendors can now accept token payments in a similar fashion to the KyberWidget.

We are also currently researching on another popular platform called Shopify. Unlike WooCommerce, Shopify is a subscription based e-commerce platform that aspiring entrepreneurs (without much technical knowledge) can utilise to create their own e-commerce store. Shopify powers over 600,000 online businesses and has over 1 million active users.

Development Of The Sign-In Widget

Traditionally, online applications operated as silos, where users are required to make multiple accounts native to the platforms of the services they wish to access. This is a hassle both for the users and service providers because they need to manage multiple credentials and ensure that it is securely stored.

In order to help our community simplify this process, we created a Sign-In widget that utilises the Open Authorisation (OAuth) standard. OAuth is an open standard for access delegation, allowing websites to request for an attestation of the identity of an individual. While the vendor has to trust that the attestation came from a legitimate source, they’re not required to maintain and secure their own database of personal user information. Users who have been KYC-ed on our KyberSwap platform can reuse their credentials to log into any website that has been integrated with the Sign-In widget.

Furthermore, our Sign-In widget conforms with the latest OAuth 2.0 specifications so developers will be able to use it with any of their existing OAuth 2.0 supported libraries and frameworks. You can learn about how to integrate the Sign-In widget from our developer portal.

Join the Kyber Developer Telegram Group

If you have feedback on our technical updates, or have in-depth questions regarding our protocol, or wondering how to integrate with Kyber and tap into our liquidity protocol, please speak to our developers in our developer telegram group.

About Kyber Network

Kyber’s on-chain liquidity protocol allows decentralized token swaps to be integrated into any application, enabling value exchange to be performed seamlessly between all parties in the ecosystem. Using this protocol, developers can build innovative payment flows and applications, including instant token swap services, ERC20 payments, and financial DApps — helping to build a world where any token is usable anywhere.

Learn more about building with Kyber:

Telegram group: https://telegram.me/kybernetwork

Developer group: https://telegram.me/KyberDeveloper/

Developer portal: https://developer.kyber.network/

Website: https://kyber.network/