Introducing Keyper for cell management on Nervos

Matt Quinn
Nervos Network
Published in
2 min readMay 30, 2020

--

On smart contract platforms, it is common for users to have a single address they use consistently. However, the cell model of Nervos presents a different design paradigm, in which users will likely control many different cells that use different lock scripts.

This design gives powerful flexibility when interfacing with the blockchain. To control cell ownership, developers can specify conditions and make use of any number of cryptographic primitives to control cell ownership. An example of this flexibility can be seen in P wallet.

For security reasons however, usage and management of these lock scripts is in the hands of the users. This adds implementation details and complicates the user experience compared to usage of a single address that always functions the same way.

Keyper was created to addresses this challenge for users and application developers. It is a standard design for key management between wallets and dApps and a lock management SDK with plugin support.

Keyper simplifies application development and improves the user-friendliness of Nervos applications. Keyper implementations (called Keyper agencies) include a lock script container, which can generate appropriate lock script values and signatures based on a user’s private key and an application’s implementation.

Keyper Agency

A Keyper agency is an implementation of Keyper that runs on a user’s device.

Many different Keyper agencies can be built, in different formats such as a browser plugin, desktop application or library. The Keyper agency will store different lock script plugins, allowing users to conveniently manage cells secured by different lock scripts.

Here’s an example of a user interaction with a Keyper agency:

  1. User connects to the dApp
  2. dApp asks the Keyper agency (on the user’s device) for list of available cells
  3. Keyper agency communicates some of the user’s cells to the dApp
  4. dApp server checks if the cells are valid
  5. dApp server generates a transaction and requests the user’s signature
  6. User signs a transaction using the Keyper agency (on their device)

A Keyper agency is being implemented by the Rebase team, as part of the grant-funded Synapse wallet browser extension, follow the project’s progress on the grant RFC thread on Nervos Talk or join the Nervos Discord server today!

--

--