[email protected]:~$

  • Rust no-std FAQ

    Tags: Rust English

    Why write this? Sometimes, we need to deploy our code to bare-metal environments. Without the POSIX OS support, we can not use the Rust battery-included std library. The no-std Rust usually scared and confused people, so I write this article to clear the most misunderstanding...

  • Nightshade - Near 协议分片设计

    Tags: 区块链 论文

    这篇文章是对 Nightshade 论文的摘要及总结。 分片是区块链扩容的一个重要方向。 传统的区块链如以太坊每秒仅能处理 20 个左右的交易。主要原因是以太坊中每个交易都要在每个节点上执行一遍, 单台机器的处理能力限制了以太坊的最大 TPS。 分片的思路是把所有节点进行分组,每个节点不再参与全部交易的验证,而是仅验证一部分的交易,因此可以突破单台机器处理能力的限制。 这篇文章介绍的夜影协议(Nightshade) 是 Near protocol 提出的分片方案。 分片的基本设计 区块链依靠在所有节点 Replica 所有交易来...

  • Break the liquidity limitation of NervosDAO

    Tags: CKB English

    I always wonder about breaking the liquidity limitation of NervosDAO since I first learned it from the CKB economic paper. NervosDAO’s liquidity limitation For readers who do not know what the NervosDAO is: NervosDAO is a builtin contract that allows people to deposit CKB i...

  • Introducing Godwoken - A missing piece of the cell model

    Tags: CKB English

    For developers, the cell programming model certainly is the most interesting part of Nervos CKB. There is a short description of the cell model: Cell is generalized UTXO. A cell is a UTXO contains arbitrary data and customizable scripts. When tx consume or create a ce...

  • An optimized compacted sparse merkle tree

    Tags: Merkletree Cryptography English

    Recently, I have designed and implemented a sparse merkle tree which has the following advantages: No pre-calculated hash set Support both exist proof and non-exists proof Efficient storage and key updating I write this article to explain the construction and optimiz...

  • Rust contract, part 2 - Write contract with ckb-std

    Tags: Rust CKB English

    Edited at 2020-03-27 Update ckb-std and ckb-tool This article introduces the ckb-std library; and shows how to rewrite our minimal contract with ckb-std, to enables syscalls and Vec, String. The previous contract: #![no_std] #![no_main] #![feature(asm)] #![fe...

  • Rust contract, part 1 - Build CKB contract with Rust

    Tags: Rust CKB English

    Edited at 2020-03-27 Update ckg-std link Remove the linker script section since I found its unnecessary to customize linker Refactor the main function interface AFAIK, the most popular contracts that deployed on CKB is writing in C. There are 3 default ...

  • Merkle Mountain Range

    Tags: Merkletree Cryptography

    Merkle Tree Merkle Tree 是区块链中经常(或者说必须?)会用到结构。 // 比特币交易列表的 Merkle Tree A / \ B C / \ / \ D E F G / \ / \ / \ / \ 1 2 3 4 5 6 7 8 树的叶子节点(图中的 1,2,3,4,5,6,7,8)是插入的元素,在图例中是比特币的 txid。 非叶子节点是对左右子节点的 hash 摘要如 ...

  • layer 2 友好的原生代币

    Tags: 区块链 CKB

    矿工奖励 矿工奖励是个很有意思的话题,目前大部分公链如 Bitcoin 的出块奖励主要由增发构成。 矿工出块奖励 = 交易手续费 + 增发奖励 Bitcoin 以及其他大多数加密货币都有总发行量, 增发奖励会逐年减少,直到货币供应达到总发行量, 这时矿工奖励完全由交易费构成。 完全以交易费维护矿工的想法招致了质疑, 很多人担心增发奖励变少后, 交易费无法满足矿工的收益, 矿工会流失导致网络失去安全性, 毕竟在现实中 Bitcoin 和 Ethereum 的矿工收入主要来自增发部分。 完全用手续费作为矿工奖励是否合理?能否满足加密...

  • 用 Ruby 体验快速开发 P2P 网络程序

    Tags: Ruby

    很多开发者很熟悉 Server-Client 这一套网络结构,Server-Client 是构建互联网应用的基础。 但在区块链技术这里就有点过时了,区块链的世界普遍采用 P2P 网络。 P2P network 是什么呢? 对等式网络(peer-to-peer, 简称P2P),又称点对点技术,是无中心服务器、依靠用户群(peers)交换信息的互联网体系,它的作用在于,减低以往网路传输中的节点,以降低资料遗失的风险。与有中心服务器的中央网络系统不同,对等网络的每个用户端既是一个节点,也有服务器的功能,任何一个节点无法直接找到其他节点,必须依靠...