首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

如何向不懂技术的朋友解释闪电网络?

How to explain Lightning Network to your non-technical friends?

如何向不懂技术的朋友解释闪电网络?

The simplest explanation available on the internet.

互联网上能找到的最简单的解释。

Blockchains are slow. And therefore, expensive. If I had to send you some Bitcoins, you’d receive them in about a couple of hours and I’d have paid a heavy transaction fee too. With such a reputation, how will Blockchains take over the world?

区块链很慢,费用很高。假如我发送一些比特币给你,大约几小时后你才能收到,并且我要支付大量的交易费用。这样的话,区块链将如何在世界上成为主流?

Any idea that can solve the non-scalability of Blockchains is worth attention, time and effort. Lightning Network is one such idea. But before we understand the solution, we’ll need to understand the problem.

任何能够解决区块链非扩展性的想法都值得花费时间、精力以及关注它。闪电网络就是这样一种想法。在了解这个解决方法之前,我们需要明白问题所在。

If you’re already aware of the problem, you can directly jump to the next section.

如果你已经意识到区块链的这个问题,就可以直接跳到下一章。

1.Why Blockchains are slow?

1.为什么区块链很慢?

“I am a slow walker, but I never walk back.” — Abraham Lincoln

“我走得很慢,但我从不后退。” — 亚伯拉罕·林肯

Think of a Blockchain as a register. And this register contains several pages (blocks) where each page has several transactions. As soon as a page has been filled with transactions, it needs to be added to the register before starting to record transactions on the next page.

把区块链想象成一个记录本。并且这个记录本包含着几页(区块)内容,每页上记录着几笔交易。只要交易记录填满一页纸,就需要添加到记录本上,然后开始下一页的交易记录。

Before a page (block) can be added to the register (chain), there’s some processing that needs to be done to ensure that everyone agrees with the contents it contains. The process approximately takes 10 minutes (for Bitcoin Blockchain) for each block.

在一页纸(区块)添加到记录本(链)上之前,需要做一些处理以确保每个人都同意记录的内容。(比特币区块链)的每个区块大约需要10分钟完成这些处理。

Imagine, you send 1 BTC to your friend, Joe. The transaction will look something like this.

想象一下,你发送1个比特币给朋友Joe,这笔交易记录看起来就像这样。

Among other things, a transaction contains information about the sender, the recipient, the amount and the transaction fee.

一笔交易记录包含的信息有发送者、接受者、数量以及交易费用。

2.Wait a minute, transaction fee?

2.等一下,交易费用?

“A consultant is someone who saves his client almost enough to pay his fee.” — Arnold H. Glasow

“顾问是一个能让他的客户足够省钱,然后付给他费用的人”——Arnold H. Glasow

Yes, there’s an additional fee. You can pay it to incentivize miners to include your transaction in a block as soon as possible. There’s no set price and it’s entirely up to you how much you are willing to pay to speed up the process. The higher the fee, faster your transaction will go through.

没错,有额外费用。你可以付钱激励矿工尽快将你的交易记入区块上。这里没有固定价格,完全取决于你愿意花多少钱来加速这个过程。费用越高,交易记录越快。

At any given moment, there are several transactions available to be recorded on the current page.

在任何给定时间里,都可以在当前页面上记录一些可找到的交易。

The miners, i.e. computers working in the Blockchain network, have to decide which of the available transactions to include in the current block. To help them decide, they look at which transactions yield the most rewards — meaning that the transactions with the highest transaction fee will be included first.

在区块链网络上工作的矿工,也就是电脑,必须决定当前区块中包含哪些可记录的交易。他们观察哪些交易记录可以获得最大回报,以便做出决定——这就意味着费用最高的那笔交易会最先记录。

If there are enough transactions with a higher transaction fee than yours to fill up the block, your transaction will have to wait in queue. The wait can last from a few minutes to a few hours. And sometimes, even days. The more you pay in transaction fees, the quicker your transaction is processed.

如果一个区块填满了足够多的交易,而且这些交易费用都比你高,那么你的交易记录就会被延迟,需要排队等候。这样的等待可以持续几分钟到几小时,有时候甚至是几天。所以,你付的交易费用越高,记录进程就越快。

That’s why Blockchains are slow, and therefore, expensive for everybody to start using. Ideally, the adoption of Blockchain would mean more transactions happening but as the number of transactions goes up, the network will become slow, making a hurdle for adoption. What a paradox!

这就是为什么区块链非常慢,而且对于刚开始使用的人也非常昂贵。理论上,区块链的普及将意味着更多的交易发生。而随着交易数量的上升,网络变得缓慢,阻碍了应用。多么矛盾!

Lightning Network (LN) is a potential solution to the problem.

闪电网络(LN)是一个潜在的解决方案。

3.So what is Lightning Network again?

3.那么,什么是闪电网络呢?

“Thunder is good, thunder is impressive; but it is lightning that does the work.” — Mark Twain

“打雷很好,雷声让人印象深刻,但却是闪电在做正事”——马克·吐温。

The idea behind LN is that not all transactions are required to be recorded on the Blockchain.

闪电网络背后的概念是,不需要所有的交易都记录在区块链上。

Imagine you and I transact quite a few times among ourselves. In such a case, we can bypass recording the transactions on the Blockchain and carry them off the chain.

想象一下,我和你之间已经交易过几次。这种情况下,我们可以绕过在区块链上记录,在链下执行。

In the simplest terms, how it’ll work is — we’ll open something called a payment channel between us and record its opening on the Blockchain. Now, you and I can transact any number of times through this payment channel and it can stay open for any number of hours, days, weeks or decades. The only time we would touch the Blockchain ever again will be when we would want to close the channel. Then, we’ll write the final status of the transactions that occurred through the channel on the Blockchain.

用最通俗的方式解释它是怎么工作的——我们之间开设一个支付通道,然后记录在区块链上。现在,我和你之间可以通过这个支付通道交易任意次数,而且这个通道可以存在任意长时间,几小时,几天,几周或者几十年。我们唯一一次需要用到区块链的时候就是我们想关闭这个通道的时候。接着,我们在区块链上的通道写下最终的交易情况。

Using this idea of payment channel, we can create a network of payment channels such that it would be only rarely required to transaction on the Blockchain. Imagine there are three characters — Xan, Yelena and Zeke.

有了这个概念,我们可以创建出一个支付通道网络,这样就可以很少在区块链上交易。假设现在有三个人——Xan、Yelena和 Zeke。

If Xan and Yelena have a payment channel opened between them and Yelena and Zeke have a payment channel opened between them, then Xan can send money to Zeke via Yelena.

Suppose Xan wants to send 2 BTC to Zeke, Yelena will send 2 BTC to Zeke and Xan will reimburse Yelena with 2 BTC.

如果Xan和Yelena之间有一个支付通道,Yelena和 Zeke之间有一个支付通道,那么Xan就可以通过Yelena给Zeke付钱。

That’s what the idea of Lightning Network is. Because you won’t be touching the Blockchain often, the transactions will be happening at lightning speed. As you might have guessed by now, all the magic happens in the payment channels. Let’s learn the magic trick then.

这就是闪电网络的概念。因为不会经常用到区块链,交易就会想闪电一样快速。可能你已经猜到了,所有神奇的事都发生在支付通道上。接下来,就让我们来了解它。

4.And what are those payment channels?

4.这些支付通道究竟是什么?

“Individually, we are one drop. Together, we are an ocean.” — Ryunosuke Satoro

“作为个体,我们就像一滴水。聚集起来,我们就是海洋。”——Ryunosuke Satoro

It’s like a safety deposit box where two people deposit equal amounts of money and each put a lock on it.

它就像一个保险箱,两个人将等量的资金存入保险箱,然后上锁。

This action of depositing equal amounts of money in a common box is recorded on the Blockchain in the form of an ‘Opening Transaction’ and thereafter a payment channel is open between those two people.

在一个普通的保险箱里存入等量的资金,然后以“开放交易”的形式记录在区块链上,之后两个人之间就有了支付通道。

The idea behind locking money in such a box is that no one person can spend the money in the box without the other. The money in this box is then used to transact between each other.

把钱锁在保险箱里,这么做的逻辑是如果没有一个人的允许,另一个人不能乱动箱子里的钱。这样,保险箱里的钱就能被用于两个人直接的交易。

Imagine, Xan and Yelena pool in 10 BTC each in the common box. And now, if Xan wants to send 2 BTC to Yelena, how would he do that?

想象一下,Xan 和Yelena 每人个人在保险箱里放入10个比特币。现在,如果Xan想要发送2个比特币给Yelena,他该怎么做?

To do that, he would transfer a promise of ownership for two of his Bitcoins in the common box to Yelena. After this transfer of promise, if the box is unlocked, Xan will be able to take 8 BTC from it and Yelena will be able to claim 12 BTC.

他会转让保险箱里2个比特币所有权的凭证给Yelena。转让之后,如果盒子被解锁,Xan就可以取出8个比特币,而Yelena就有12个比特币。

But they will not open the box because they want to continue transacting between themselves. That’s the beauty of this arrangement.

但是他们不会解锁盒子,因为他们之间还会继续交易。这就是闪电网络协议的美妙之处。

Now, if the next day, Yelena has to send 1 BTC to Xan, she would do the same — transfer a promise of ownership for one of her Bitcoins to Xan. After these two transactions, if the box is opened, Xan can claim 9 BTC and Yelena can get 11 BTC.

如果第二天Yelena给Xan发送1个比特币,她将做同样的事——转让保险箱里的1个比特币所有权凭证给Xan。这两笔交易之后,如果箱子被解锁,Xan就有9个比特币,而Yelena有11个比特币。

To imagine how off-chain transactions look like, consider this:

想象链下交易是怎么进行的,思考一下:

To sum it up, payment channel is nothing but a combination of pooling some money together and then transferring the promise of ownership of the pooled-in money in the agreed upon manner. If ever either of Xan or Yelena wants to close the channel, they can.

总之,支付通道只不过是聚集了一些资金的密码锁,然后在约定的情况下,将已放入的资金所有权凭证转让给他人。如果Xan或Yelena有一人想关闭通道,就可以关闭。

Closing a channel would simply mean opening up the box and taking the money inside. This opening of the box happens on the Blockchain and the who owns how much from the box is recorded forever.

关闭通道就意味着打开保险箱,取出里面的钱。打开保险箱的举动发生在区块链上,并且箱子内谁拥有多少钱会永远地记录下来。

That’s how payment channels work. But that doesn’t even come close to defining their true potential. Their true power is unleashed when two or more payment channels work together to form a network — The Lightning Network.

这就是支付通道的工作方式,但这并没有定义它们真正的潜力。当两个或多个支付通道协同工作形成一个网络,即闪电网络,真正能力就会释放出来。

5.Got it, so how does it actually work?

5.明白了,那它实际是怎么工作的呢?

“Great things are done by a series of small things brought together.” — Vincent Van Gogh

“伟大的事业是由一系列的小事积累而成的。”——文森特·梵高

LN works by moving the value from the ownership of the Bitcoins to the promise of ownership of the Bitcoins.

闪电网络的工作是从比特币所有权的转移变成了比特币所有权凭证的转移。

This shift is huge. Like always, we will use an example to understand this. Imagine there are three people — Xan, Yelena and Zeke — such that there’s a payment channel open between Xan and Yelena, and there’s another channel open between Yelena and Zeke. Note that Xan and Zeke have no payment channel between them.

这种变化是巨大的,和前面一样,我们可以用一个例子来理解这一点。假如有3个人—— Xan、Yelena 和Zeke,Xan和Yelena之间有一个支付通道,Yelena和 Zeke之间有一个支付通道,而Xan和Zeke之间没有支付通道。

In such a situation, if Xan wants to transfer 2 BTC to Zeke, he can use the payment channel between Yelena and Zeke to do that. How does that look like?

这样的话,如果Xan想要转2个比特币给Zeke,他可以通过Yelena和Zeke之间的支付通道完成。那应该怎么做呢?

Xan asks Yelena to transfer a promise of 2 BTC to Zeke on Yelena-Zeke payment channel and then he reimburses Yelena with 2 BTC on Xan-Yelena channel.

Xan让Yelena通过Yelena-Zeke的支付通道转2个比特币所有权凭证给Zeke,接着自己在Xan-Yelena 通道上偿还2个比特币所有权凭证。

With such network of payment channels, a huge chunk of transactions can be off-loaded from the Blockchain to be carried out off the chain, therefore, freeing up the chain’s bandwidth. Using a network of payment channels, millions of transactions can happen, and that too without a hefty transaction fee.

通过这样的支付通道网络,大量的交易可以从区块链上移除,在链下进行,也就可以释放链上带宽。使用支付通道网络,可以产生数百万的交易,并且没有高额的交易费用。

That’s the Lightning Network. And, now you know how to explain it to your friends. Or if you’re feeling lazy, simply send them to this article.

这就是闪电网络,现在你知道该如何向朋友解释了。如果觉得麻烦,就转发这篇文章给他们吧。

  • 发表于:
  • 原文链接http://kuaibao.qq.com/s/20171211G0X2UB00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券