Examining the CKB programming model
Nervos implements the "cell model" for flexibility and scalability
Sparkling
A few days ago, a community member wrote up a post on the Nervos Talk forum, asking whether the model of "off-chain calculation, on-chain verification” might affect the diversity of smart contracts, and whether it would affect the nature of "decentralization" of contracts. He also pointed out that Ethereum's smart contracts are decentralized and generate state through on-chain calculation.
As could be imagined, this question immediately sparked discussion. Xuejie, researcher and architect of CKB VM emphasized that the choice to implement off-chain calculation and on-chain verification doesn’t restrict CKB. This is evidenced in Polyjuice, which supports creation of an account model on top of CKB’s cell model.
Xuejie also pointed out that "blake2b on EVM has been proposed since 2016, but it is not until 2019 that it is introduced through a hard fork”. Due to performance concerns blake2b was introduced through a precompile (requiring a hard fork) and not implemented using Solidity in a contract that executes in the EVM.
CKB however, supports on-chain implementation of new crypto primitives. The power of this functionality can be seen in Lay2’s ckb.pw wallet, which now supports use of Ethereum-enabled browsers/wallets and will soon support EOS and TRON browsers/wallets as well.
We saw this week, Illia Polosukhin, co-founder of NEAR Protocol, highlighting that NEAR can similarly be used with MetaMask through deployment of a smart contract that facilitates meta-transactions.
The Nervos design however still has an upper hand here, as NEAR requires a contract and a relayer, while a Nervos user can simply switch the Lock Script securing their cell (similar to transferring to another address).
HTLCs on CKB: an important building block of a payment channel network
An HTLC is a smart contract for payment that includes both a time lock and a hash lock. HTLC’s already play an important role in Bitcoin’s Lightning network, as well as other payment channel networks and it is also an important part of building a payment channel network on CKB.
The biggest difference between Lightning and a payment channel network on Nervos CKB is the seamless support of user-defined assets in addition to the native CKByte.
In this post, Zhichunlu explains that an HTLC contract can be unlocked by a payer after a certain block height (like a timeout), or unlocked by a payee using the preimage to agreed hash. The proposed design also enables a single Cell to be utilized in different possible transactions at different block heights, which enables use cases such as streaming or multi-hop payments.
RFCs
Nervos applies the RFC (Request for Comments) process for implementing every building block of the protocol. There were 27 Previous RFCs that can be found here.
If you are curious about why a design in CKB is what it is now, please post your questions in this repository.
Dev Updates
Core
CKB
Dev Tools
Layer 2
Muta [layer2 framework on CKB]
SECBIT Labs [Zero knowledge proof toolkit for CKB]
(#32) add asvc, clinkv2, marlin, merkletree, poseidon, rescue, spartan examples.
CrossChain
force-bridge-btc [maps BTC on Bitcoin to cBTC on CKB in a trustless way]
force-bridge-eth [maps ETH on Ethereum to cETH on CKB in a trustless way]
Ecosystem
Hxro [Gamified Crypto Trading Platform]
Tocial [cosplayers’ photo sharing app]
Lay2 [pw-sdk, build dApp on CKB and run them everywhere]
Obsidian Labs [developer IDE]
Synapse [browser wallet and keyper agency]
BlockABC [onechain CKB and web auth]
GrowFi [token swap functionality]
Obsidian Systems [CKB integration with ledger wallets]
Summa One [BTC/CKB interoperability] (completed)
LeapDAO [Sidechain Framework]
( #74) Bridge client events
The Nervos Foundation currently runs a grants program for builders, check out the scope and how to apply.
CKB Weekly is curated by a group of people who witnessed Lina’s birth and started this to record her growth. Any views expressed are personal and do not represent an official position of the Nervos project. Got updates or articles you would like to include? Any feedback or other suggestions? Let us know by replying to the email.
If you are interested in contributing, we welcome you to join the review group on Telegram.
Meanwhile, check out the links below if you want to learn more about the project and community.