PoS 概览
本文是介绍 Conflux PoS 最终性的概念,而不涉及具体的细节。 它是帮助读者一般地理解 PoS 的,也是阅读其他技术文档的基础。
在 PoW 链的早期阶段,当算力较低时,可能会存在 51%
攻击的问题。 随着公链的发展,算力租赁平台的出现使这个问题更加严重。 Ethereum Classic, Grin, and Verge have all been the victims of the 51% attack last year.
为了应对 51% 攻击带来的威胁,Conflux 将引入一条独立的 PoS 链。 PoS 链上的共识参与者将定期对树图结构的枢轴区块进行签名。 所有 PoW 矿工应该选择有足够签名的枢轴区块进入主链,即使它的兄弟区块有更高的权重。 简单来说,PoS 链指定了一个枢轴区块,所有 PoW 矿工都应该遵循这个区块。
这意味着只要 PoS 共识对一个枢轴区块进行了投票,即使 51% 的攻击者试图回滚这个区块,它也不会被 PoW 节点所认可。
Conflux 要求 PoS 共识有限制地指定枢轴区块。 一个区块必须在 PoW 规则下被确认几分钟后,诚实的 PoS 节点才会对它进行签名。 这意味着树图结构中的区块排序和确认仍然是由 PoW 矿工完成的。
- PoS 链只用于应对 51% 的攻击。 因此,它只包含基本的功能,如枢轴区块投票和投票委员会选举。 它不包含一般区块链的功能,如交易和合约执行。
- PoS 链的功能是 Conflux 节点中内置的功能。 从外部来看,仍然只有一个程序:conflux-rust。
- 在本文中,Conflux 链指的是运行中的区块链,PoS 链指的是新引入的链。
- There is approximately 1 PoS block generated per minute. All the times stated below are corresponding to the number of blocks.
PoS Account
地址
Generally speaking, the account model on a blockchain is: a private key creates a public key, and a public key produces an address. The accounts on the PoS chain are similar, but there are two private keys called the BLS private key and the VRF private key, corresponding to the BLS public key and the VRF public key respectively. The two public keys are hashed to obtain the PoS address, which is currently 256-bit long.
0xd731d7633dd38c47769c2a62926b9a54d288a5e664f4d2108ac5bb6601bb30f5
钱包
The primary responsibility of a PoS account is to maintain the Conflux consensus protocol. Each PoS account should run an independent Conflux node. Thus, the Conflux core code has the built-in wallet functionality for PoS accounts, including: When the Conflux node is launched for the first time and is running in the PoS account mode, it will automatically generate the PoS private key and require users to provide the password. The private key that is encrypted by the supplied password is stored locally.
- When the Conflux node restarts, the user is required to enter the password to unlock the private key file if the encrypted private key file is detected.
- The transactions are automatically processed under the consensus protocol of PoS during operation, without user intervention.
- Since the wallet is implemented by a full node, the interaction with the wallet is primitive, which may involve copying files manually, etc.
Become a consensus node
After a PoS account is created, it can only become a legal consensus node by staking and registering on the PoW chain.
- Staking: no difference from the current staking process.
- Registration: interact with specific internal contact on the Conflux chain; submit relevant information provided by the full node; lock the staked amount, one vote per
1000
locked CFX.
After completing the registration, the PoW account that staked and the PoS account form a one-to-one binding relationship. The PoS account cannot change its bound PoW account. The PoW account can bind to another PoS account as long as it releases the previous binding relationship.