2019 年 6 月 18 日 20:00,小 G 学院“区块链布道 100 人”分享课第五期准时开课,第五期分享嘉宾是来自法国 Auctionity 区块链拍卖行的产品经理 Etienne Roudeix,他的分享主题是《如何将以太坊网络延展至拍卖领域》。
Good evening everyone. I am Etienne, the CTO of Domraider. I am in charge of the Auctionity project. And I am going to talk to you about how we used the Ethereum blockchain on this project.
大家晚上好。我是 Etienne,Domraider 的 CTO。我负责 Auctionity 项目。我将和你们谈谈我们如何在这个项目中使用以太坊。
Auctionity is a product of the Domraider company. Domraider was founded in 2013. It's main activity is selling domainnames into auction. Since 2013 we have sold over 15,000 domain names. So westarted to think about how we could use this experience to bring people a new auction experience. And in 2017 we figured out that blockchain could help. So we started thinking about what those people involved in auctions world expect. What does the seller expect ?What does the bidder expect ?
Auctionity 是 Domraider 公司推出的项目。Domraider 成立于 2013 年。它主要经营域名的拍卖。自 2013 年以来,已经成交超过 15000 个域名。现在我们正在思考如何给人们带来新的拍卖体验。2017 年,我们发现区块链可能会有所帮助。所以我们开始思考那些参与拍卖的人士,卖方期望什么? 买方期望什么?于是我们开启了项目。
We determined 4 main expectations :
The first is the cost. When someone wants to bid on an auction he does not want to have to pay. When the seller wants to sell something, he does not want to have to pay. If you are the seller you don’t want to pay a commission at the end of the auction. And if you are a bidder maybe you are going to bid several times on an auction, maybe you are going to win it or maybe you are not... Anyway you don’t want to pay some extra fees but the price of the product.
The second expectation is SPEED. When you bid on an auction you want your bid to be taken into account immediately. You don’t want that someone who bids exactly the same amount of you could win the bid if he placed exactly the same amount but after you. When an auction ends at 1 pm you don’t want the auction to end at 1 pm and 12 minutes, you really need fast behaviors into your auction ecosystem.
The 2 over expectations are delivery and payment guarantees. This means that as a seller you want to be sure to be paid at the end of the auction.
and as bidder, as a winner of the auction,you want to be sure to get your asset at the end of the auction. Concerning these two last points, we figured out that blockchain can help.
我们确定了4个主要期望:
第一是成本。当有人在拍卖会上参与拍卖时,不管是卖方还是买方,都只想交易商品的费用,没有人想为此而支付手续费。
第二是速度。当你在拍卖会上出价时,你希望你的出价立即生效。你不希望有人出一样的金额或者他出价比你慢,但可以赢得拍卖。当拍卖原定时间在下午 1 点结束时,你不希望因为交易速度原因而不得不延长拍卖时间,你想要快速的完成你的拍卖。
第三和第四,是关于交货和付款。作为卖家,你希望在拍卖结束时确实能拿到钱。作为买家,你想要在拍卖结束时确实能得到你的商品,二者之间没有信用问题。关于最后的这两点,我们发现区块链是有很大帮助的。
So, on the Ethereum blockchain, you have ETH, which is money. You have the smart contract system, and under that you can have a logical code who guarantees. that the seller will be paid. On Ethereum blockchain you also have all the Non fungible tokens. These tokens are meant to represent something unique in the blockchain. So, we can guaranteee this kind of asset delivery, to the winner, And then, the Auctionity project was born.
所以,我们使用了以太区块链,在以太区块链上有 ETH 作为价值媒介。你会有一个智能合约系统保证本次交易顺利完成(有逻辑的代码)。卖方将很快得到货款。在以太区块链上,你还拥有不可替换的币。以太区块链保证了这些币的唯一性。因此,我们可以保证资产交付,然后,Auctionity 项目诞生了。
However, concerning the freeness and the speed, Ethereum is not really friendly. because on Ethereum blockchain, each transaction costs gas. It means, for example, that if I want to bid on an auction which takes place on the Ethereum blockchain. I have to pay some gas into this transaction. And imagine an auctions where there are something like 100 bidders and each bidder has bid 3 times. 300 transactions which all cost gas. And above all, 299 of those transactions was actually useless. Bidders did not win. Thay just would lose some gas? It is not acceptable for any user .
About speed, it's another big problem. Ethereum is one block every 14 seconds. Meaning that an auction which is suppose to endat 10:00:00 possible can end at 10:00:10 ... That’s not fair.
And here come the main question :How to scale ? How we can use Ethereum blockchain and make it faster and cheaper ?
然而,就自由拍卖和拍卖速度而言,ETH 并不友好。因为在以太区块链上,每笔交易都要消耗 Gas。例如,我想在一个拍卖会上出价,基于以太区块链。我必须在这笔交易中支付一些 Gas。想象一下,有 100 个竞标者,每个竞标者出价 3 次。300 笔交易都需要支付 Gas。但是这其中 299 笔交易实际上毫无用处的,因为竞标者不是最终拍下的人。未竞拍成功的竞拍者会失去他们的 Gas,这是任何用户都不能接受的。
关于速度,这是另一个大问题。以太每 14 秒生成一个区块。这意味着一个拍卖可能在 10:00:00 结束,也可能在 10:00:10 结束。这是不公平的。
接下来的问题是: 如何进行规模化? 我们如何使用以太坊区块链,使它更快更省钱?
So, in order to scale, we decided to use asidechain. What is a sidechain? It is another blockchain, based on Ethereum technology wich run besides the main Ethereum network. Both chains will share the same crypto logical methods. the main chain can understand a message signed on the sidechain and vice versa. However, we made some adjustment to this sidechain. we made it faster ! It’s being one block every second on this chain. and when we configured the gas cost of each transaction. we said : ok, it’s being free, zero, no need to pay to put a transaction on this sidechain.
为了扩大规模,我们决定使用侧链。什么是侧链? 是基于以太技术,运行在以太网络上的另一条区块链。这两条链将共享相同的秘钥。主链可以识别侧链上数据信息,反之亦可。但是,我们对这个侧链做了一些调整。使它变得更快! 这条链上每 1 秒钟有一个区块。当我们配置每笔交易的 Gas 成本时。我们让它是免费的,在这个侧链上不需要支付交易的 Gas。
Here is our architecture. On the left of the picture you have the Ethereum main network. which is slow and expensive. but on which you have ETH. and on the right, you have the Auctioniy sidechain, which is 1 block/second and free. Auctionity sidechain is an Ethereum blockchain running the proof of authority protocol(Clique) on Geth nodes. We put all the miners of those nodes close to each other in order to reduce network latency and have a very fast consensus. At this point we have 2 blockchains but the can't communicate between each other. As a reminder : each blockchain is meant to be replayable. And it cannot depend on an external call otherwise this security property would not be guaranteed.
上图是我们的架构。左边是现有的以太主网络。它很慢且需要 Gas。在右边,是Auctioniy 的侧链。它是每秒产生一个区块,并且是免费的。Auctioniy 的侧链是一个在 Geth 节点上运行权威协议证明的以太区块链。我们将这些节点的所有挖矿者彼此靠近,以减少网络延迟,并达成非常快的共识。我们虽然有两个区块链,但不能相互通信。也就是说:每个区块链都是可复制的。它不能依赖于外部调用,否则这个安全属性将得不到保证。
In 2014, Vitalik Buterin, the founder of Ethereum, introduced the concept of Oracle. What is an Oracle? It’s something out of the chain which is made to set an information in a blockchain which came from the outside. Something which happened outside of the chain and will be written on this chain. This is very critical. and an oracle must have the less reponsibility as possible,because it’s not decentralized,it’s not on chain. So we degined a simple Oracle whose job is to send anything happening on the main network to the sidechain.
2014 年,ETH 创始人引入了 Oracle 的概念。什么是 Oracle?它是主链以外的东西,用来记录来自外部的区块链信息。在主链外发生的事情会写在这条链上。这是非常关键的。而 Oracle 必须尽可能地少承担责任。因为它不是分散管理的,它不在链上。所以我们设计了一个简单的 Oracle。它的工作是将主网上发生的事情发送到侧链。
Let's talk of Smart Contracts. We deployeda "Deposit" smart contract on the main network. This deposit is made to receive all the ETH and all the NFT that the seller and the bidders will deposit. And the oracle job is to mirror all those assets on a "Deposit"contract on the sidechain.
让我们谈谈 ETH 智能合约系统。我们在 ETH 主网上部署了一个“存款”智能合约。这个“存款”系统用于收取买卖双方所有 ETH 和 NFT。而 Ooracle 的工作是将用户所有资产镜像到一个侧链的“存款”合约上。
For example: The seller deposits a NFT and the bidder deposits some ETH on the main network. This costs gas. This is slow.But its necessary because ETH and NFT only exist on the main network. Then the oracle mirror those deposits on the sidechain. You can see in my example that the deposit of the sidechain is aware that the seller owns the NFT; and the bidder 1 owns 1 Ether and the bidder 2 owns 0.5 ETH, etc.
例如: 卖方在主网上存入 NFT,买方在主网上存入 ETH。这个在主网存款是有成本 Gas 的,而且会有些慢,但这是必须有的。因为 ETH 和 NFT 只存在于主网上。然后 Oracle 把数据映射在侧链上。你可以在上面图片中例子看到,“存款”系统是知道卖方拥有多少 NFT 的; 比如投标人 1 拥有 1 个 ETH,投标人 2 拥有 0.5 ETH 等。
Now that the sidechain is aware of everything, everything will take place on the sidechain. everything will befast and free . The seller will create the auction on a new smart contract,on which he can determine all the parameters he wants for this auction :
- start date
- end date
- start amount
- bidding step
etc.
Then all the bidders can bid on the auction.The bidder can bid as far as he does not exceed his deposit of course (payment guarantee). he can bid as many times as he wants on the auction, on any auction and that will be fast and free.
一切也都将发生在侧链上。且都是快速和自由的。卖家可以创建一个新的智能合约来进行拍卖。他可以决定此次拍卖的所有参数: 开始日期、结束日期、起拍价、竞拍加价额等。
然后所有的竞拍者都可以在拍卖会上出价。只要不超过他的保证金,他可以出价多次。他可以在任何他想要拍的时间进行出价,且是快速和免费的。
Finally auction ends. Now, it is the winner(bidder 2) who owns the NFT. and the seller now owns the ETH !
still on the sidechain. What do you expect now?
最后,拍卖结束。最终出价赢家将持有 NFT。卖家获得 ETH !
但是这一切都是在侧链上的,那么我们需要做什么?
You expect that the Oracle gets the information. and mirror it back on the main network.And that's what we wanted to do. But here came a major problem .In order to write on the main network,the oracle would need to pay some gas. The single oracle would have to pay for all the auction happening on the sidechain. And that's not what we wanted. So we found a work around . Instead of writing directly on the main network.
我们需要 Oracle 读取信息。并将其映射到主网上。但是这里出现了一个问题,为了在主网上记录数据,Oracle 需要支付一些 Gas作为需要支付侧链上拍卖发生的手续费,这不是我们想要的。所以我们找到了解决方法:不直接在主网上记录拍卖信息。
The Oracle is just going to sign a voucher which will contain anything what happened. It will be something like acertificate that auction actually happened like it happened. and that the actual ETH and NFT can be traded safely at the end on the main network. This voucher is public. because it contains all the security guarantees and can becashed-in by anybody. The seller can cash it in. Or the winner can cash it in. Or anybody. And the single cash-in transaction will send the ETH to the seller and the NFT to the winner.
Oracle 将签署一份凭证,里面包含了所发生的一切。它就像一种拍卖证明,证明拍卖过程中发生的信息。而实际的 ETH 和 NFT 可以在主网的终端安全地进行交易。这个证明是公开的。因为它包含所有的安全保证,任何人都可以兑现。卖家可以兑现。买家可以兑现。这笔交易将会把 ETH 发送给卖家,NFT 发送给买家。
And this is how we split the cost. The oracle has nothing to pay and it's only sellers and winners which will have to pay gas fee. but at this point they have the guarantee to get far more ! Now, I know you are wondering ... Why I cannot steal your ETH ?
这就是我们分摊成本的方法。Oracle 无需支付任何费用,只有卖家和买家才需要支付 Gas费。在这一点上,他们有担保,且得到很多体验上的优化! 我知道你在想…为什么我无法偷走你的 ETH?
That’s taking part in two parts of the infrastructure. The first it is the main network deposit itself. The code is public. Since it was written on the blockchain you have the guarantee that it will never change. And so the code gurantees that there is no way to get ETH without a valid voucher. There is no "trade" function,no backdoor. The code also guarantees that a bidder cannot use more ETH than the deposited. If bidder A deposited 0.5 ETH, it's not possible for him to withdraw more than 0.5 ETH and it's not possible for him to pay an auction over 0.5 ETH.The second part of integrity is guaranteed by the voucher itself. Indeed, the voucher must contain 3 key points :
1. The signed winning bid
So if the voucher did not contain a signed bid it couldn’t be applied because you have no proof that the bidder approved the transfer of his money.
2. The signed auction creation transaction
This is the guarantee that the seller actually created the auction and which was its auction parameters. This contract is signed with private keys, he signed all the parameters he decidedfor the token to be in sale. So if there is not a bid signed transaction, the voucher cash-in will not be valid.
3. Oracle signature
The Oracle signature is just the mirroring proof. The Oracle is just saying that this actually happened on the sidechain.This is the single responsability of this Oracle signature.
If you missed one of these 3 signatures : the voucher is not valid. So as a winner if you never signed a bid for the given NFT your money is safe. As a seller if you never signed the auction creation your token is safe. As an user of the sidechain if the Oracle does not validthis with his signature you are sure that it is not a forged voucher by some malicious bidders and sellers. And that’s how we guarantee to you that we can’t steal your ETH.
因为真正的“存款”是发生在主网上的,代码是公开的,写入区块链的。所以它永远不会被篡改。你如果没有有效凭证就没有办法获得 ETH。且竞拍人所使用的 ETH 也不能多于他存入的数量。如果竞标人存入 0.5 ETH,他不可能提取超过 0.5 ETH 的存款,他也不可能支付超额的 ETH 进行拍卖。事实上,凭证必须包含三个要点:
1.已签署的中标书。如果凭证中没有包含已签署的中标书,就不能应用,因为没有证据证明竞拍人批准了他的资金转移。
2.已签署的拍卖创建协议。这是卖家实际创建拍卖的保证。是它的拍卖参数。这个合同是用私钥签署的,他签署了他决定出售的价格参数。因此,没有签署的交易,将是无效的。
3.Oracle 签名。Oracle 签名是映射的证明。它实际发生在侧链上。
如果你没能集齐上述三种凭证,那么你的交易是无效的。作为一个买家,如果你从来没有签这个中标书,就不会扣掉你的钱。作为一个卖家,如果你从来没有签署拍卖创建协议,那么你的代币不会被转移。作为用户,你需要知道,如果 Oracle 表示一个人的签名是无效的,那么它大概率是某些恶意投标人和卖家制造的伪造凭证。这就是我们为什么不能偷走你的 ETH 的原因。
Thank you everyone for reading me . And here is a link to our first auctionity saleroom : https://app.auctionity.com/
谢谢大家参与我们的分享。这是我们第一家拍卖会的链接:
https://app.auctionity.com/