公链相关调研

主流公链方案

BSC

Binance Chain (BC) 早期使用cosmos开发,主要实现了订单簿的DEX,发行其bep2 token/ pegged coin, 并具备跨链交易能力;

Binance Smart Chain (BSC) 19年开始重新folk eth代码开发,天然具备EVM的兼容性,修改POW共识为PoSA权威权益证明共识,提升TPS,降低Tx Fee。 验证人节点硬件要求极高,普通节点无法参与。

BSC的PoSA结合了权威证明(PoA)和委托权益证明(DPoS)。21位验证者轮流生产区块并以币安币交易费用作为回报奖励。成为验证者需要运行一个节点并至少质押1万枚币安币,然后方有资格成为当选的候选人

跨链:中心化的提币跨链 + 丰富的第三方跨链方案支持

https://docs.binance.org/smart-chain/guides/cross-chain.html

OEC

https://github.com/okex/exchain

坚持使用cosmos开发,通过集成EVM实现eth生态的兼容。在链上原生实现订单簿dex,amm dex,farm,链上治理。

更低的手续费,更大的自主性,可在链上直接实现更多功能,去中心化程度高。

两种跨链方案:提币到目标链的方式来自动跨链; 连接钱包后中心化跨链资产到目标链地址。

Polygon

把Cosmos的理念带到eth生态,ethereum's internet of blockchain。提供类似的快速搭建链的SDK,独立的matic链,提供plasma,侧链,Layer2等多种围绕eth生态的解决方案。代码是fork eth来修改的。

https://docs.polygon.technology/docs/develop/ethereum-polygon/pos/getting-started

Solana

Solana 扩展方案的核心是一个“历史证明(PoH)”的去中心化时钟,该时钟旨在解决缺乏单个可信赖时间源在分布式网络中的时间问题。免除了在节点网络中广播时间戳的需求,从而提高整个网络的效率。

Solana 放弃了分片策略,选择了时间和区块链状态的分离这一方法。它的网络具有一种被称为历史证明 (PoH) 的内嵌机制,可以实时同步交易的顺序。PoH 消除了在交易排序上达成共识的需要,也就免掉了相应的时间损耗,使节点能在收到交易时立刻处理它们。

PoH 是一个全局虚拟时钟,它使我们能够使用时间传递的加密证明,代替掉基于每个验证器中本地时间测量值的本地超时。 由于网络中的所有节点都具有一致的时间观,因此我们可以减少区块时间,减少共识信息传递开销,增加 TPS 并增加参与共识的节点数量。

There are 8 key innovations that make the Solana network possible:

Proof of History (POH) — a clock before consensus;

Tower BFT — a PoH-optimized version of PBFT;

Turbine — a block propagation protocol;

Gulf Stream — Mempool-less transaction forwarding protocol;

Sealevel — Parallel smart contracts run-time;

Pipelining — a Transaction Processing Unit for validation optimization

Cloudbreak — Horizontally-Scaled Accounts Database; and

Replicators — Distributed ledger store

With Proof of History, you can create a historical record that proves that an event has occurred at a specific moment in time.

历史证明 (PoH) 通过使用高频可验证延迟函数(VDF),随着时间的推移建立可通过密码验证的事件顺序(在本例中为交易)。 从本质上讲,这意味着 PoH 就像一个加密时钟,可以帮助网络就时间和事件顺序达成一致,而无需等待其他节点的消息。这允许并行处理有序事件来帮助提升网络的性能,而在传统的区块链场景中,单个进程验证并打包要包含在下一个块中的所有交易。

Solana中智能合约(或程序)是只读或无状态的,并且只包含程序逻辑。一旦部署后,智能合约就可以通过外部账户进行交互。Solana中与程序交互的账户会存储与程序交互相关的数据。这创建了状态(帐户)和合约逻辑(程序)的逻辑分离。这是Solana 和基于EVM的智能合约之间的关键区别。支持使用Rust,C++和C语言来编写智能合约。

Wormhole 虫洞协议,现已支持以太坊-Solana 双向跨链

https://www.wormholebridge.com/

Terra

针对去中心化稳定币的真实需求,使用cosmos开发的应用专有链的成功案例。反思算稳鼻祖AMPL失败的原因:单币种通胀通缩的稳定机制带来的投机需求造成ampl长期偏离1美元,使得该稳定币真实使用需求不被认可。

The protocol consists of two main tokens, Terra and Luna.

  • Terra: Stablecoins that track the price of fiat currencies. Users mint new Terra by burning Luna. Stablecoins are named for their fiat counterparts. For example, the base Terra stablecoin tracks the price of the IMF’s SDR, named TerraSDR, or SDT. Other stablecoin denominations include TerraUSD or UST, and TerraKRW or KRT. All Terra denominations exist in the same pool.

  • Luna: The Terra protocol’s native staking token that absorbs the price volatility of Terra. Luna is used for governance and in mining. Users stake Luna to validators who record and verify transactions on the blockchain in exchange for rewards from transaction fees. The more Terra is used, the more Luna is worth.

The protocol ensures the supply and demand of Terra is always balanced, leading to a stable price.

Users burn Luna to mint Terra and burn Terra to mint Luna, all incentivized by the protocol's algorithmic market module.

The Terra protocol's market module enables users to always trade 1 USD worth of Luna for 1 UST, and vice versa, incentivizing users to maintain the price of Terra.

套利空间与手续费摩擦

非兼容EVM的WASM智能合约,使用Rust编写

Smart contracts on Terra run on WebAssembly and take advantage of core modules, such as on-chain swaps, price oracle, and staking rewards, to power modern DeFi apps

https://github.com/terra-money/core

Cosmos

公链之母 + 区块链互联网

代币缺乏价值捕获

pos 质押机制,低手续费(非高手续费优先),terndermint BFT确定性共识,DAO治理机制,IBC通用跨链协议

Ronin

https://github.com/axieinfinity/ronin-smart-contracts

https://whitepaper.axieinfinity.com/technology/ronin-ethereum-sidechain

代码未开源,类以太坊链,公开了Deposit、Withdrawal的相关合约,开发了定制的区块链浏览器。

「It is our great pleasure to announce that the AxieChat Community has been selected by the existing group of Ronin validators to run the very first Ronin “Community Validator” Node.」 => 猜测为DPoS共识

The mechanics of Play to Earn do not require a fully decentralized public blockchain. We believe that part of the ethos of web 3 is the idea of users being rewarded for the value that they bring to applications and this is what we choose to focus on with Axie.

Katana, the Ronin decentralized exchange. Katana allows anyone to easily swap between the various assets within the Axie Infinity ecosystem.

you can now trade between AXS, SLP, USDC, and WETH. You can also deposit these assets into liquidity pools and be rewarded both a share of the trading fees and RON tokens.

Ronin is our scaling solution for NFT games starting with Axie. It’s the most used Ethereum sidechain for NFTs.

RON is the ecosystem token for the Ronin chain. It will eventually be used to pay gas fees and secure the network for both Axie Infinity and future games/products hosted on the chain.

To incentivize Katana liquidity, 10% of the total RON supply will be rewarded to liquidity providers who stake their deposits in both SLP/ETH and AXS/ETH over the next 90 days.

跨链合约

侧链mint wrap token,需要侧链validator验证主链上deposit成功;

主链赎回token,需要侧链用户先发起赎回,进入pending状态,侧链validator对pending 的withdraw提交签名,用户拿到所有的签名去主链赎回eth原生token,侧链validator验证主链上withdraw成功,结束侧链pending withdraw的 pending 状态。

跨链桥调研

Anyswap

仅针对代币的跨链互换

https://anyswap-faq.readthedocs.io/en/latest/index.html

Anyswap uses Fusion’s DCRM technology as a cross-chain solution. Anyswap users can deposit any coin to the protocol, mint wrapped tokens in a fully decentralized way and swap assets from different blockchains.

DCRM uses the latest cryptography technologies in Threshold Signature Scheme (TSS) for Elliptic Curve Digital Signature Algorithm (ECDSA) to provide a distributed key generation and transaction signing algorithm. Threshold Signature Scheme (TSS) is a type of Multi-Party Computation (MPC), allowing multiple parties to jointly generate a key and a signature. None of the parties by themselves ever have a full key and none of the parties can sign without consent of the others. TSS can be configured for m-of-n setups as well.

一种多方安全计算的实现方案

Since Anyswap uses DCRM it does not require any code chnages to be made on any of the blockchains. In this respect it is superior to COSMOS or Polkadot, which we regard as being a ‘compatibility’ standard. DCRM is truly an ‘inter-operability’ standard.

https://github.com/fsn-dev/dcrm-sdk/wiki

the Bridge is controlled by 5 DCRM nodes run by either Anyswap (at different locations)

Polygon

Polygon使用和Ronin类似的主链、侧链上的质押+赎回机制来进行代币跨链。

Polygon bridge provides a scaling solution which is near-instant, low-cost, and quite flexible. Polygon uses a dual-consensus architecture(Plasma + Proof-of-Stake (PoS) platform) to optimise for speed and decentralisation

  • tokens that leave ethereum network are locked and the same number of tokens are minted on Polygon as a pegged token (1:1).

  • To move the tokens back to the ethereum network, tokens are burned on Polygon network and unlocked on ethereum network during the process

A bridge is basically a set of contracts that help in moving assets from the root chain to the child chain. There are primarily two bridges to move assets between Ethereum and Polygon. First one is the Plasma bridge and the second one is called the PoS Bridge

提供工具页面进行 eth —— polygon 代币跨链mapping。 https://docs.polygon.technology/docs/develop/ethereum-polygon/submit-mapping-request/

The first step to using the PoS bridge is mapping the Root Token and Child Token. Don't worry, this isn't anything complex. It just means that the token contract on the root chain and the token contract on the child chain have to maintain a connection (called mapping) to transfer assets between themselves.

Deposit#

  • The owner of the asset token approves the Predicate Contract to lock down the amount of tokens to be deposited. Once this approval transaction has confirmed, the owner of the asset token interacts with the RootChainManager contract to complete the deposit.

  • Next up, the asset is deposited with the State Sync Mechanism. if you didn't get a run-through of what the State Sync Mechanism is, it's in its simplest form the native mechanism to send data from Ethereum Network to the Polygon Network. The inner workings of the mechanism itself comprises of a function call that is made of the RootChainManager which triggers the ChildChainManager contract.

Withdrawals#

  • Withdrawing assets is a breeze with the PoS bridge. It's as simple as burning the asset tokens on the Polygon chain, collecting the transaction hash of this burn transaction, and submitting it to the RootChainManager. The RootChainManager then calls for the predicate contract to release the funds that were locked on the Ethereum chain.

提供SDK进行相应操作

IBC

由Cosmos实现的一种通用跨链通信协议,代币的跨链仅仅是其中一种跨链场景。该协议支持任意复杂消息的跨链通信,并保证跨链事务的一致性和原子性。可以除了代币的跨链流转,还可以实现不同链之间的DApp/智能合约的协同调用。