Oracle Bridge – 甲骨文桥区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Oracle Bridge – 甲骨文桥区块链毕设代写 是一篇很好的国外资料

Oracle Bridge

A proof of concept EVM to EVM cross-chain communication protocol using EVM Storage Proofs and Oracles, for a custody-free token bridge.

Oracle Bridge - 甲骨文桥

Overview

EVM Storage Proofs enable a contract to prove the presence of a specific peice of data within another EVM environment. Attempts have been made to use this to enable chain-to-chain communication, but one limitation is that Ethereum’s Proof of Work cannot be verified within a contract due to the gas limit.

Most other approaches use a fedaration of validators or custodians that micro-manage the minting and burning of wrapped contracts, whilst holding assets and ultimately having the ability collude and ‘alleviate’ the funds if they wish. They need to be online all the time and you trust them to not disappear one day.

Instead of verifying proof of work trustlessly within a contract, or relying on a specific validator set, the Oracle Bridge approach uses a generalised oracle (or collection of oracles, such as ChainLink) to simply periodically report the block number and block hash of remote chains.

As these oracles are generalised data oracles and have strong disincentive to collude with each other (they have their own rhobust systems in place to ensure data integrity and are potentially reporting the same data for many different dapps), the Oracle Bridge appraoch presents a novel and improved security model for token bridges and chain-to-chain communication in general.

In combination with a storage proof, the block hash can be used to validate the state of a remote chain and contracts can implement cross chain systems such as the example in this repository.

The following token bridge example issues “wrapped” tokens that can be redeemed back to the original asset with strong guaruntees.

Let’s imagine we want to ‘send’ ETC to ETH mainnet – really we are just locking it up on ETC and issuing an IOU ‘wrapped token’ on ETH that can be redeemed for ETC. A basic implementaiton of the system is as follows (the numbers provided are flexible and are for illustrative purposes only):

  1. User deposits 1 ETC into the ETC-OracleBridge contract (on the Ethereum Classic chain)
  2. The user creates a Storage Proof proving the ETC has been deposited on this block
  3. Every 100 blocks, an oracle (or group of oracles) reports the block hash of ETC to ETH-OracleBridge on Ethereum Mainnet
  4. After 1000 confirmation blocks have pased on ETC, the user passes the Storage Proof created earlier to the the ETH-OracleBridge contract (on the Etheruem Mainnet chain)
  5. The contract verifies that the Storage Proof is part of a black that matches the block header reported by the oracle and issues the amount of Wrapped ETC on ETH Mainnet
  6. The Wrapped ETC can be traded freely as a regular ERC20 token; it remains locked on the ETC chain
  7. When the time comes to redeem the Wrapped ETC to ETC, the process happens in reverse;
  8. The ‘deposits’ (burns) the Wrapped ETC to the ETH-OracleBridge contract
  9. The user creates a Storage Proof of the deposit at this particular block
  10. Every 100 blocks, an oracle reports the block hash of ETH to ETC-OracleBridge (on Etheruem Classic)
  11. After 1000 confimations, the user can relay the Storage Proof to the ETC-OracleBridge contract, which is verified by the contract and ETC can be redeemed by the user

A basic contract set, test suite and TODO: Web UI is included in this repository to demonstrate the above system.

Again, this is the most basic example and there is room for many improvements and optimisations, such as:

  • Work out the best scheme for Oracle selection
  • Support ERC20 deposits
  • One contract for multiple assets and chains
  • Implementaiton of metatransactions to eliminate the need of users to spend gas
  • A swap market to remove the need for users to wait for the confirmation blocks
  • Archive node services to allow users to access old proofs
  • Dynamic confirmation times based on various metrics (including amount)
  • Etc.

Testing

Check out ./test/oracle-bridge.js for an example test run through. Run it with npm run test.

Because we use eth_getProof, we need to run a real node (not a virtual hardhat node) when testing. You can set this environment up by running Geth in dev mode and creating a second account:

# run geth geth --datadir ~/geth-dev --rpc --dev --allow-insecure-unlock # attach geth attach ~/geth-dev/geth.ipc # create account personal.newAccount() # fund it eth.sendTransaction({from:eth.coinbase, to:eth.accounts[1],value:1e18}) # unlock it personal.unlockAccount(eth.accounts[1],'',0)

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.

More wording about security / trust assumptions


Oracle Bridge

一种概念验证EVM到EVM跨链通信协议,使用EVM存储证明和Oracles,用于免托管令牌网桥。

Oracle Bridge - 甲骨文桥

Overview

<Oracle Bridge>

EVM存储证明使合同能够证明在另一个EVM环境中存在特定的数据peice。有人试图利用这一点来实现链到链的通信,但一个限制是,由于气体限制,以太坊eth的工作证明无法在合同中得到验证。

大多数其他方法使用验证人或托管人的联盟,他们对包装合同的铸造和焚烧进行微观管理,同时持有资产,并最终有能力串通和“减轻”资金(如果他们愿意的话)。他们需要一直在线,你相信他们不会消失的一天。

Oracle Bridge方法使用通用Oracle(或Oracle集合,如ChainLink)简单地定期报告远程链的块号和块散列,而不是在契约中不受信任地验证工作证明,或者依赖于特定的验证器集。

由于这些oracle都是通用的数据存储库,对相互串通有很强的抑制作用(它们有自己的rhoblast系统,以确保数据的完整性,并且可能为许多不同的dapp报告相同的数据),Oracle Bridge appraoch为令牌桥和链到链通信提出了一种新的改进的安全模型。

结合存储证明,块散列可用于验证远程链的状态,契约可以实现跨链系统,如本存储库中的示例。

以下代币桥示例发行“包装”代币,这些代币可以通过强有力的担保人赎回回原始资产。

  1. 每隔100个块,一个甲骨文(或一组预言)向以太坊eth主网上的ETH OracleBridge报告ETC的块散列值
  2. 在1000个确认块通过ETC之后,用户将先前创建的存储证明传递给ETH OracleBridge合同(在Etheruem主网链上)
  3. 该合同验证了存储证明是与oracle报告的块头相匹配的黑色部分,并在ETH Mainnet上发布包裹ETC的金额
  4. 包装好的ETC可以作为常规ERC20代币自由交易;当需要将包装好的ETC兑换到ETC时,它仍被锁定在ETC链上
  5. 过程以相反的方式进行;
  6. ETH OracleBridge合同中的“存款”(烧掉)包裹的ETC
  7. 用户在这个特定的区块创建一个存款的存储凭证
  8. 每隔100个区块,一个甲骨文将ETH的区块散列报告给ETC OracleBridge(在Etheruem Classic上)
  9. 在1000次确认之后用户可以将存储证明转发到ETC OracleBridge合同,一个
  10. 存档节点服务,以允许用户访问旧证明
  11. 基于各种度量(包括金额)的动态确认时间

让我们设想一下,我们想要将ETC“发送”到ETH mainnet-实际上,我们只是将其锁定在ETC上,并在ETH上发布一个IOU“包装令牌”,可用于兑换ETC。系统的基本实现如下(提供的数字是灵活的,仅用于说明目的):

一个基本的合同集、测试套件和TODO:WebUI包含在这个存储库中以演示上述系统。

  • Support ERC20 deposits
  • One contract for multiple assets and chains
  • Implementaiton of metatransactions to eliminate the need of users to spend gas
  • A swap market to remove the need for users to wait for the confirmation blocks
  • Archive node services to allow users to access old proofs
  • Dynamic confirmation times based on various metrics (including amount)
  • Etc.

Testing

同样,这是最基本的示例,还有许多改进和优化的空间,例如:

签出。/test/oracle-桥.js作为一个示例测试运行通过。用npm运行测试。

# run geth geth --datadir ~/geth-dev --rpc --dev --allow-insecure-unlock # attach geth attach ~/geth-dev/geth.ipc # create account personal.newAccount() # fund it eth.sendTransaction({from:eth.coinbase, to:eth.accounts[1],value:1e18}) # unlock it personal.unlockAccount(eth.accounts[1],'',0)

因为我们使用eth-getProof,所以在测试时需要运行一个真实的节点(而不是虚拟的hardhat节点)。您可以通过在dev模式下运行Geth并创建第二个帐户来设置此环境:

More wording about security / trust assumptions

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/18978.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Oracle Bridge – 甲骨文桥区块链毕设代写

提供最优质的资源集合

立即查看 了解详情