Bridges in Crypto-Space

1. 引言

Bridge跨链协议中,lock-and-mint/burn-and-release模式,可保证2条链之间的token amount和cost保持不变。

当前的Bridge跨链方案主要分为2类:

  • trusted bridge:通常有a federation of relayers communicating, bringing information and tokens from one chain to another。

  • trustless bridge:用户可开发者不需要信任a federation 或 任何中心化实体 来move data and tokens from one chain to the next。

相关视频资料有:

在这里插入图片描述

1.1 关键词解析

  • SPV(Simple Payment Verification):使得clients可verify a transaction on the blockchain without downloading the entire thing。用户仅需require the block’s header来确认交易在链上完整存在。
  • Relayed SPV:提交并验证来自于sending chain的区块头。接收链上的智能合约会存送发送链的区块头,通过SPV proof可证明某交易确实在发送链上发生。这种方式可无需中介,所有信息可relay到所有connected chains。
  • Stateless SPV:是指仅提交与特定交易相关的区块头。即意味着接收链无需存储a complete record of headers,可降低存储需求。该方法仅适于PoW系统。在Stateless模式下,其基本假设为:the amount of work required to produce a sequence of valid headers that prove a fraudulent transaction (one that did not occur on the origin chain) exceeds the value of the transaction itself。对于honest transactions,源链会生成sequences of headers for free as part of the PoW consensus。与Relayed SPV类似,也无需中介。通过智能合约完成。
  • Federation:A Federation是指a group of participants work together to verify and confirm transactions between chains。如根据安全需要,可为任意 n n n个signers。federation中的成员作为节点,控制the flow of information between chains。
  • Bonded Federation:signers需质押一定金额来verify transactions between chains。当malicious actors对作弊交易签名,其质押的金额将被Slash,以此来提升安全性。
  • Trusted Federation:无激励来commit或protect from fraud,仅保持transactions going。

2. 现有Bridge方案解析

2.1 tBTC

tBTC为a wrapped token,为a Bitcoin token that is usable on Ethereum。1 BTC = 1 tBTC。

2.1.1 tBTC 安全模型

tBTC具有minimized trusted features。其背后基础设施为Keep network,以保证交互中的privacy。
为了在以太坊上mint 1tBTC,Keep network会请求a bonded ECDSA (Elliptic Curve DIgital Signature Algorithm) keep来对1 BTC进行签名。智能合约使用an ECDSA keep来communicate with each other cross-chain。

在bounded ECDSA keep is requested之后,会从validators pool中随机选出a signer group,该signer group会在以太坊质押价值1 BTC的1.5倍的ETH。然后,该signer group将采用threshold ECDSA protocol来生成a bitcoin wallet。

  • 1)用户向该Bitcoin钱包发送1 BTC。
  • 2)用户为其存入1 BTC的交易生成SPV proof。
  • 3)用户将该SPV proof发送到以太坊链上。然后就可mint出等量的1 tBTC。

反之亦然。

Signer groups of three nodes, randomly selected from a large pool of validators, hold Bitcoin deposits。这些节点为从一个大的pool中随机选出,可reduce any negligence or manipulation。

2.1.2 tBTC 激励模型

过担保,签名者会将所存入bitcoin金额1.5倍的ETH进行质押,从而鼓励honest behavior。这种过担保意味着,若signers作弊,将受到严厉的惩罚,如slash掉其质押的金额。

2.1.3 tBTC 限制

一个限制因素在于,signers需质押较高的比率,当前,tBTC开发者在致力于减少所需质押的金额。

2.2 Cosmos IBC

Cosmos为 an internet of sovereign blockchains(名为Zones)centered around the “Hub” chain,Hub chain的主要功能为促进zones之间的通讯。由此,产生了Cosmos IBC。

2.2.1 Cosmos IBC 安全模型

Cosmos IBC使用relayed SPV来维护zones(Cosmos supported blockchains)之间的trustless connection。To communicate with another zone, the blockchain sending the data needs to commit some state to a defined path dedicated to a specific message type and destination. A relayer process then monitors for updates on these paths and relays messages by submitting the data stored under the path and proof of that data to the correlating chain.

通过IBC进行token transfer的流程为:

  • 1)链A 的token进行lock,会生成an outgoing packet containing the sender, receiver and amount。
    Relayer receives and transfers packet。
  • 2)链B收到了relayer发来的packet,若验证通过,则会在链B上为receiver mint等额的token。
  • 3)链B的IBC module会生成an outgoing packet to acknowledge the transfer of tokens。
    Relayer receives and transfers packet。
  • 4)链A收到relayer发来的packet,本次token transfer结束。

注意:If the packet included a code to identify that the transfer failed, the transfer would get undone on Chain A. Also, if Chain A did not receive the Acknowledgement within a timeout period, the transfer will get undone.

2.2.2 Cosmos IBC 激励模型

IBC的主要激励杂鱼链之间可完全trustless通讯,无任何摩擦。

2.2.3 Cosmos IBC 限制

唯一的限制在于:为了通过Cosmos IBC通讯,用户需要在Cosmos network之上构建其链(light client)。

2.3 Cosmos Gravity Bridge

Cosmos Gravity bridge用于Cosmos与以太坊之间传输funds和data。在Cosmos Hub中质押了数百万Atom,Gravity bridge将具有高度安全性。
Gravity bridge,是专门为Cosmos Hub设计的,可从以太坊中获取尽可能多的交易和数据,包含4个部分:

  • 1)Gravity.sol:为在以太坊中的智能合约,存储了a checkpoint——对应为the active validator set on the Cosmos side at a given moment in time。
  • 2)Gravity module:在Cosmos链上实现的,随着Cosmos链的validators一起运行,负责mint tokens。
  • 3)orchestrator:随着Gravity module一起运行,Cosmos链的Validators需要运行以太坊全节点,使得orchestrator可监听到events from Gravity.sol,并将该event广播到Cosmos链上。
  • 4)Relayers:将Cosmos->Ethereum的交易批量提交,以节约gas费。batching of transactions is done by a set of relayers who submits the batch to Gravity.sol。

详细参看博客:Gravity bridge——IBC Bridge to Ethereum

当前Cosmos->Ethereum的交易手续费为1%。

2.4 NEAR Rainbow Bridge

Rainbow Bridge连接的是以太坊和NEAR。

2.4.1 NEAR Rainbow Bridge安全模型

Rainbow bridge在NEAR链上实现了一个以太坊light client,可在NEAR链上验证以太坊区块头。EthOnNear client使用DAGs which are precomputed to make the computation of Ethash (a space hard hashing algorithm) viable on-chain on NEAR。

假设25个区块确认之后的以太坊区块即已固化。
以太坊区块头和NEAR区块头可get relayed by any actor and rejected if invalid according to the previous headers and proofs。

为了避免在以太坊链上验证the costly Ed25519签名,Rainbow采用Optimistic fraud proofs。Relayers必须在其header proposal中bond一些ETH(当前设置为5 ETH),在challenge期间,若某actor提交了一个有效的proof,则一半会burnt,另一半归该actor所有。当challenge有效期过后,则认为相应的ed25519 signature是有效的。注意,只要EIP-665实现,在以太坊上支持Ed25519预编译,则不再需要这种Optimistic fraud proofs。

2.4.2 NEAR Rainbow Bridge激励模型

目前,暂无相应的激励模型。

2.4.3 NEAR Rainbow Bridge限制

在NEAR链上,仅存储7天的以太坊区块头(以防止unbounded state growth)。用户必须在7天内完成其由以太坊到NEAR的交易,否则可能会丢失资产。

EthOnNear client将在4年后过期,因为到时将reach the end of precomputed DAGs。

由于以太坊目前暂未支持Ed25519预编译合约,目前需要采用bond模型,设置有4小时的挑战窗口期。

2.5 Parity Bridges

light client适于Substrate的GRANDPA共识。

详细见:

2.6 Celo Optics

Celo Optics为Celo团队设计的跨链通讯协议。受以太坊Layer 2 Optimistic Rollups 启发。

Optimistic Rollups中包含了名为”aggreators“的actors,会编译大量的交易,将其卷入一个区块,这些”rollup blocks“将通过智能合约提交到主链上。这个流程被认为是optimistics的,是因为aggregators publish only the bare minimum of data needed with no proofs。若rollup state与主链state不一致,则aggregator可提交a fraud-proof来dispute a fraudulent transaction。若其确实是fraudulent的,则state会roll back to the previous valid state。

Celo Optics类似于rollups,其aggregates events on the origin chain where they are signed by a bonded actor called the updater and replicated to other chains。过了一定挑战期后,可认为目标链上的数据是有效的。在挑战期内,受信任的参与方可提交fraud proofs。

相比于common header relays,Celo希望Optics可砍掉90%的 gas 费。Optics协议适于所有支持智能合约的链和rollups。

2.6.1 Celo Optics 安全模型

Celo Optics可用于任何支持智能合约的链。V2升级后,其延迟时间由3小时缩短为了30分钟,优于Optimistic rollups所需的1周延迟。
Celo Optics仅需120,000 gas overhead on message senders。

详细见博客:

Optics支持fraud,参与者可prove fraud at any time to the home contract on the sending chain。因此,为了阻止updaters进行欺诈签名,updaters必须在home链上进行质押,作为接受欺诈性update的惩罚,该质押将被slash。欺诈性签名者的保证金不仅会被slash,还会将其暴露给网络上的所有其他参与者,这意味着用户可以避免恶意参与者。

2.6.2 Celo Optics 激励模型

Celo Optics的最主要激励在于,专注于fraud publication而不是fraud proof,从而可提升速度,降低send message的费用。这也使得Optics能够通过向所有合谋的updaters添加成本惩罚来处理Optics bridge中的任何欺诈行为。用户总是在伤害发生之前就知道任何潜在的攻击和欺诈交易。

2.6.3 Celo Optics 限制

Optics 一个有趣的方面是,它使用单一的消息发送机制与其他链进行通信,这意味着添加额外的链很容易,并且不需要对发送过程进行任何修改。

2.7 ChainSafe ChainBridge

ChainBridge最大两点在于,当需要增加新的transfer类型时,不需要重新部署整套工具,仅需要进行小的模块升级。

当前ChainBridge可连接所有Substrate和EVM-based chains。

当前ChainBridge采用trusted federation模式。Deposit events on one chain get detected by a trusted set of off-chain relayers who await finality, submit events to the other chain and vote on submissions to reach acceptance triggering the appropriate handler.

代码见:

参考资料

[1] Bridges in Crypto-Space

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值