用酒吧蹦迪的例子,解释为什么比特币需要闪电网络

资讯 2024-07-03 阅读:43 评论:0
来源:橙皮书Source: Orange paper 上周在Reddit热度最高的帖子之一,它用很通俗的例子解释了为什么比特币需要闪电网络,以及比特币支付是怎么逐渐进步的。Last week at Reddit, one of the hi...
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

来源:橙皮书

Source: Orange paper

上周在Reddit热度最高的帖子之一,它用很通俗的例子解释了为什么比特币需要闪电网络,以及比特币支付是怎么逐渐进步的。

Last week at Reddit, one of the highest-heated posts, explained why bitcoin needed a lightning network, and how bitcoin payments progressed.

用酒吧蹦迪的例子,解释为什么比特币需要闪电网络

The example of bar pruning to explain why Bitcoin needs a lightning network

从川普发推到孙哥道歉,最近圈子里出现很多"吸引眼球"的事件,但他们会对整个生态真的产生什么重大影响么?

From Trump to Sun's apology, there's been a lot of "blow-and-eye" events in the world lately, but are they really going to have a big impact on the whole ecology?

我觉得未必,把时间维度拉长,技术的进步才是关键的影响因素。

I don't think so. By stretching the time dimension, technological progress is the key factor.

今天的文章是上周在Reddit热度最高的帖子之一,它用很通俗的例子解释了为什么比特币需要闪电网络,以及比特币支付是怎么逐渐进步的。

Today's article, one of the highest-heated posts in Reddit last week, explains why bitcoin needs a lightning network and how bitcoin payments have progressed.

文章很长,建议先码后看,enjoy~

It's a long article. It's recommended first, enjoy
.

1

初代:中本聪残破的nSequence 通道

Original generation: neSequience channel with stunned neSegence

中本聪虽然把产品做出来了,但中本聪的版本(包括支付通道)完成的实在太糟糕。我们不得不自己动手修复它,顺带增加了RBF(译者注:replace?by-fee,允许用支付更高交易手续费的方式,来替换未经确认的同一笔交易)作为附带功能。

While Nakamoto made the product, the Chinese version (including the payment channel) was too bad to complete. We had to fix it by ourselves, adding RBF (translator: replace?by-fee, allowing the replacement of the same unconfirmed transaction by paying higher transaction fees) as ancillary function.

最开始的规则是如果A交易的输入与B交易相同,且A的nSequence更大,那么内存池会将会用A替换B。

The first rule is that if transaction A is entered in the same way as transaction B and if transaction A is larger, the memory pool will be replaced with transaction A.

0xFFFFFFFF是nSequence能够取到的最大值,这会导致该笔交易被标记为"最终交易",且不能在内存池中被替换掉。

This is the maximum value that nSequience can take, which will result in the transaction being marked as a "final transaction" and not being replaced in the memory pool.

nLockTime和nSequence正是"nSequence通道"有着如此奇怪规则的原因。nLockTime只能在nSequence小于0xFFFFFFFF时才能起作用。如果nSequence是0xFFFFFFFF,nLocktime就不会起作用。

NLockTime and nSequience are the reasons why the NSequience Pass has such strange rules. nLockTime can only work if the nSequience is less than 0x12. nLocktime won't work if the nSequience is 0x12.

举一个简单的例子:

To give a simple example:

1.你去一个酒吧,对酒保说你会在酒吧关门的时候结账。因为我们是在比特币宇宙,时间是以区块高度的形式被测量的,所以酒吧关门的时间是未来的某个区块高度。

You go to a bar and tell the bartender that you'll close the bar when it closes. Because we're in the Bitcoin universe, when time is measured at the height of a block, the bar closes at the height of a future block.

2.当你喝第一杯酒时,你会从你的资金里拿出一笔钱,进行一笔交易付给酒保。这笔交易有一个起始为0的nSequence和一个nLocktime(相当于酒吧的关门时间)。你创建这笔交易然后酒保给你酒。

When you drink your first drink, you will take out a sum of money from your money and make a deal to the bartender.

3.如果你想多喝几杯,你需要重新创建类似的交易,把要多付的钱加到给酒保的交易中(所以随着酒钱的增加,交易的输出也不断变大),但是这笔交易的nSequence要比原来的那个增加1。

3. If you want to drink a few more drinks, you need to recreate a similar transaction by adding the extra money to the barman's transaction (so the volume of the transaction is growing as the amount of money goes up), but the nSequience of the transaction is one more than the original one.

4.不管怎样,最终你可能还是会因为两个原因离开酒吧:

In any case, you may eventually leave the bar for two reasons:

(1) 酒吧关门了,nLockTime标记的关门时间一到,酒保就可以广播最新的交易,然后让保安不客气把你踢出门。

(1) As soon as the nLockTime mark is closed, the bartender will be able to broadcast the latest deal and then let the security guard kick you out of the house.

(2)你不想再喝酒伤肝了,所以你把最新交易的nSequence重签成0xFFFFFFFF,也就是它能到的最大值。这让酒保能够立即拿到他的钱(如果nSequence为0xFFFFFFFF,nLocktine就不再起作用了),所以他就可以让保安客气的把你送出门。

(2) You don't want to drink any more liver injuries, so you resign the latest deal of nSequience to 0x#, which is the maximum value it can get. This allows the bartender to get his money immediately (if nSequience is 0x12, nLocktine is no longer working), so he can get the security guard to send you out politely.

这就是支付通道,它是通过创造一笔"最终"交易来关闭的,这笔交易包含此前的交易。这里当然不存在rounting,因为通道是单向的而且有最大生命周期的限制。但是还是放过中本聪吧,他需要休息,那时他也正忙着发明比特币呢。

This is the payment channel, which is closed by creating a "final" deal, which includes the previous one. There is no running here, of course, because it is one-way and has the maximum life cycle limit. But let it go, he needs a break, and he was busy in inventing bitcoin.

还记得我说这种支付通道是残破的么?

Remember when I said this payment route was broken?

这是因为内存池规则不是共识规则,而且不能被验证(在内存池中任何东西都不能在链上验证,每当我听到有人提出"让我们根据内存池的大小确定区块大小吧!"我都要叹气,内存池的状态不能被链上的数据验证)。全节点并不能看到你签名的 所有交易,只有带有最大的nSequence的那笔交易才是真正在链上使用的。

This is because the memory pool rule is not a consensus rule and cannot be verified (nothing in the memory pool can be verified on the chain, whenever I hear a suggestion that "let's determine the size of a block according to the size of the memory pool!" I'm going to sigh, and the memory pool's state cannot be verified by the data on the chain. The whole node does not see all the transactions you sign, and only the one with the largest nSequience is actually used in the chain.

所以你可以像下面这样做:

So you can do it like the following:

1.成为吴忌寒的朋友,因为他拥有51%以上的算力。

1. Become a friend of Wu Xin Xin because he has more than 51% of the calculus.

2.给吴忌寒一些你定的酒作为与你合作的奖励。比如说你定了一百杯酒,你和吴忌寒把酒分了,给他了50杯。

Give Wu and Hsien some of your prescribed wine as a reward for working with you. For example, you ordered a hundred wines, you split them with Wu and gave him 50.

3.当酒吧关门时,吴忌寒让他的矿机挖nSequence为0的那笔交易。就是那笔你只付了一杯酒钱的那笔交易。

When the bar was closed, Wu Xiaochen had his miner dig up the transaction of nSequience. That's the one you paid for only a glass of wine.

4.因为全节点没有办法验证nSequence,它们会接受nSequence=0的版本然后确认,傻傻地把仅付了一杯酒的钱写进区块链。

4. Because there is no way to verify nSequience, they will accept the nSequience=0 version and then confirm that stupidly writing in the chain of blocks is paid only for a glass of wine.

5.这个酒保被激怒了,从吧台下面拿出一把枪,想把你和吴忌寒打死。

The bartender got pissed off, pulled a gun from under the bar and tried to kill you and Wu Tsing.

6.吴忌寒用他的魔法力量(其实是矿机的蒸汽)来让子弹减速,结果子弹只是像风吹花瓣一样轻轻接触了你一下。

Wu Xiaoqin used his magic power (the steam of the mine machine) to slow down the bullet, and the bullet only touched you as lightly as the wind blew its petals.

7.酒保嘴里嘟囔着听不清的话,突然他的衣服被撕开了,他真的变成了一头熊!

He was a bear when his clothes were torn open!

8. 你盯着它,心里想着莱昂纳多能从熊的爪子下活下来, 那你也能活下来,况且他只是一个有钱的演员而已,然后你摆好了姿势,嘴里喊着"吃我一招!"

You stare at it, and you think Leonardo can survive from the claws of a bear, and you can survive, and he's just a rich actor, and then you pose and you say, "Eat me!"

9.有人能继续帮我编下去么?

Can someone please keep making this up for me?

下面是知识点:

The following is the knowledge point:

1.遇到熊人非常糟糕。

1. The encounter with bears is very bad.

2.你不能仅仅因为闪电网络不是链上的,就马上否定它,然后启用所谓的"中本聪版本"。

2. You cannot deny the lightning network simply because it is not on the chain and then activate the so-called "medium-bone version".

中本聪版本是一个带有nSequence支付通道的半成品,在这个方案中链上交易代表着多个逻辑上交易款项的和,这几乎和现代版本的链下技术做的一样(先不管现代的链下技术到底是如何工作的)。nSequence(单指这个字段,不是指它现代意义上的意思)早在windows Alpha 0.1.0版本就存在了。

The Chinese version is a semi-finished product with a nSequience payment channel, where transactions represent the sum of several logical transactions, almost the same as the modern version of the chain technology (nSequience (not to mention this field, not in its modern sense) as it does in the Windows Alpha 0.1.0 version.

3.矿工完全能够绕过内存池规则。实际上,nSequence能够变成一个可选的功能(RBF)是因为矿工被nSequence系统激励着一直遵守RBF规则罢了。

The miners are perfectly capable of bypassing the memory pool rules. In fact, nSequience can become an optional function (RBF) because the miners are inspired by the nSequience system to remain compliant with the RBF rules.

我的意思是,你给吴忌寒的酒,除了能是你给矿工挖特定版本的交易的手续费,还能是什么其他东西呢?

I mean, what else can you give Wu Xianxian wine other than your fee for digging up a particular version of the deal for the miners?

4.中本聪也会犯错,最初的nSequence的设计就是其中之一。今天,我们不再这样使用nSequence了。

We don't use nSequience anymore today.

改进中本聪最初的版本是比特币开发的一部分,因为随着时间的发展,我们学到了一些中本聪永远不会不知道的东西中本聪是这项科技的一个里程碑。但是他永远不会是最后一个,也不会是最重要的一个,他会被历史牢记,但也只是作为一个先行者的身份。

The original version of the improvement was part of the development of Bitcoin, because as time went by, we learned something that he would never know about . is a milestone in this technology. > but he will never be the last, nor the most important one, he will be remembered by history, but he will also be the identity of a pioneer.

2

Spilman通道

Spilman Pass

Spilman通道是激励兼容-限时型单向通道,实际上就是一种改进版的中本聪通道。

The Spilman Pass is an incentive compatible-time-limited one-way channel, which is in fact an improved version of the medium-to-hear Passage.

现在,我们知道如果你想在交易通道上作弊,酒保会变成一头熊咬你。而且我们知道你是吴忌寒的好朋友,酒保再也不会接受一个能够让顾客和矿工联合起来骗人的支付通道方案。

Now, we know that if you want to cheat on the trade route, the bartender will turn into a bear biting you. And we know that you're a good friend of Wu, and the bartender will no longer accept a payment route that allows customers and miners to join together and cheat people.

好消息来了, Jeremy Spilman提出了一个新方案能够让顾客再也骗不到酒保了。首先,你和酒保进行一个这样的仪式:

Here's the good news: Jeremy Spilman proposed a new plan that would make it impossible for customers to fool bartenders. First of all, you and bartenders to do a ceremony like this:

1.你拿出一些资金,然后创造一笔注资交易付给一个你和酒保之间的2/2多重签名地址。你现在不会广播这笔交易:你只是进行了签名,得到了交易ID。

You make some money and then you create a two-thirds multiple signature address between you and the bartender. You won't broadcast the deal now: you just signed and got the ID.

2.你再创造另一笔交易用来返还的上面资金。这笔交易有一个nLocktime,它的值是酒吧的关门时间再加上一个区块高度。你给它签名然后把这笔退款交易(但不是上面提到的那笔注资交易)给酒保。

You create another transaction for the return of the above funds. There's an nLocktime. It's worth the bar's closing hours plus a block height. Sign it and then give it to the bartender.

3.酒保给退款交易签名,然后又还给你。现在它就是合法的了,因为你和酒保都签名了。

The bartender signed the refund transaction and returned it to you. Now it's legal because you and the bartender signed it.

4.现在你把第一笔交易广播到链上。你和酒保等待这笔交易深度确认,然后你再开始消费。

Now you broadcast the first deal on the chain. You and the bartender wait for the depth of the deal to be confirmed and then you start spending.

上面的步骤也许对闪电网络用户来说依稀有些熟悉。这是支付通道的资金创建过程!第一笔付给2/2多重签名地址的交易是用来给通道提供资金的。

The steps above may be somewhat familiar to the users of the lightning network. This is the process of creating funds to pay for the channel. The first transaction to pay two or two multiple signatures was used to finance the channel.

然后你开始像这样买酒:

And then you start buying wine like this:

1.第一杯酒,你创建一个花费注资交易(也就是第一笔交易)的输出,把酒品的花费发送给酒保,然后剩余的返还给你。

1. The first drink, you create an output of an expensive transaction (that is, the first one) and send it to the bartender and then return the rest to you.

2.你给这笔交易签名然后把它交给酒保,酒保就给你第一杯酒。

2. You sign the deal and hand it over to the bartender, who gives you the first drink.

3.为了能再拿一杯酒,你要再创建一笔类似的交易,先新酒的钱加到之前给酒保的钱上,然后再把剩余的钱返回给你。你给这笔交易签名又发给酒保,酒保就再给你一杯。

In order to be able to get another drink, you have to create a similar deal by adding the money for the new wine to the money previously given to the bartender and then returning the rest of the money to you.

4. 到最后:

4. At the end of the day:

(1)如果酒店关门的时间到了,酒保就给最新的交易签名,将需要的双重签名补全然后向比特币网络广播这笔交易。因为退款交易的是广播的时间是关门时间+1,所以在关门以前它不能使用。

(1) If the hotel closes, the bartender signs the latest transaction, and the required double signatures are completed and the transaction is broadcast to the Bitcoin network.

(2)如果你的肝受不了所以你想早走,你只需要告诉酒保关闭通道就好了(酒保可以在任何时候广播最新版本的交易来关闭通道,酒保不这样做是因为希望你能够多待一会,多喝两杯)。

(2) If your liver can't stand it so you want to leave early, you just have to tell the bartender to close the passage.

(3)如果你仅仅是在酒吧里闲逛但是从来没有买东西,这样的话当到了关门时间+1的时候你就广播你的退款交易,拿回你全部的资金。

(3) If you just hang out in a bar and never buy anything, then when you close the door +1, you broadcast your refunds and get your entire money back.

现在,即使你给吴忌寒50杯酒,你也不能让他挖最开始的那笔交易(那笔交易只支付了一杯酒的钱),因为这是一笔2/2的多签名地址但是它只有你自己的签名。

Now, even if you give Wu Hsien 50 cups of wine, you can't let him dig the first deal (the deal paid for only one drink) because it's a two-thirds multi-signature address, but it's only your own signature.

你需要酒保的签名让这笔交易合法,但是他当然不会这么傻,酒保不会给出自己的签名让旧版本的交易合法,自己得到更少的钱。

You need a bartender's signature to make the deal legal, but he certainly won't be so stupid that the bartender won't give his own signature to make the old version legal and get less money for himself.

所以,问题被解决了是吧?解决了吗?让我们来试试吧。你拿到了你的资金,把他们放入一个注资交易中,弄好退款交易,确认注资交易… …

So, the problem is solved, right? OK? Let's try it. You got your money, put them in a funded deal, make a refund deal, confirm a funded transaction...

一旦注资交易深度确认完成,酒保意味深长的笑了。他叫来了保安,气势汹汹的盯着你。

Once the money deals are confirmed in depth, the bartender laughs. He calls security, he stares at you.

"我拒绝给你服务",酒保说。

"I refuse to serve you," the bartender said.

"好吧,那我走好了"你面带傻笑,"我会用退款交易拿回我的钱,然后在大众点评上给你个大差评!"

"Well, I'll walk away, and you'll smile, "I'll take my money back with a refund deal, and I'll give you a bad opinion on the public opinion!"

"先别急"酒保说。他的声音让你背脊发冷,就像是他还记得你之前玩弄他的事,"瞧瞧刚才确认的那笔注资交易的交易ID。"

The bartender says, "Don't worry." His voice makes your back cold. It's like he remembers what you did to him. "Look at the I.D. that was just confirmed for the money deal."

"它咋啦?"你面无惧色的问道,说着你打开了你的笔记本电脑,然后找到了一个可靠的区块链浏览器。

"What's wrong with it?" You asked me without fear, saying you opened your laptop and found a reliable block-chain browser.

接下来的看到的东西把你吓坏了。

The next thing you see, it scares you.

"啥玩意?交易ID变了?!你他妈改了我的签名??怎么可能?我把我唯一一份私钥藏在了一个密封的信封里,然后把它放在一个神秘戈壁滩的保险柜里,一群骁勇的游牧民族守护它,他们以自己儿女的鲜血起誓,要誓死捍卫这份秘密!"

"What's the deal ID changed? You changed my fucking signature? How is it? I hid my only private key in a sealed envelope, and then put it in a safe on the mysterious Gobi beach, guarded by a group of brave nomads who swore by the blood of their sons and daughters to defend the secret!"

"难道你不知道?"酒保笑了。"签名仅仅是非常大的数字。签名中的一个标记可以被改变,从正变到负,或者从负变到正,但是签名仍然是合法的。即使不知道私钥,任何人都可以这么做。但是比特币在生成交易ID时在其中包含了签名,所以这一点小改变也让交易ID改变。有人想把签名从交易主体中分离出去,他们说这样签名延展性(signature malleability)就不再会影响到交易ID了,但是我打赌我可以让我的好哥们吴忌寒拖延这个'Sepsig'(分离签名)计划好长时间。

"Don't you know?" The signature is a very large number. A sign can be changed from positive to negative, or negative to positive, but the signature is still legal. Anyone can do so even without knowing the private key. But Bitcoin had a signature in it at the time of the creation of the transaction ID, so the change in the deal ID changed the deal ID. Some people want to separate the signature from the subject, and they say that the signature extension will no longer affect the transaction ID, but I bet I could keep my good buddy Wu from delaying the 'Sepsig' plan for a long time.

吴忌寒是个好人,只要我给他51杯啤酒,他就愿意挖那笔改动了的交易"他笑得更开心了"恐怕你的退款交易不会起作用了,因为它想花的那个交易ID根本不存在。

Wu is a good man, and if I give him 51 beers, he's willing to dig up the changed deal, "He's laughing better." I'm afraid your refund deal won't work because the deal ID that he wants to spend doesn't even exist.

好吧,让我们来谈谈吧。你把你注资交易里99%的资金给我,作为交换,我会给你在链上的那笔交易签名。如果拒绝,那你一毛不剩。但是我和所有的HODLer都会因为流通又减少了一些欢呼雀跃。接受这笔交易你可以剩1%的钱。如果你拒绝我,我也分毫不会损失,好好考虑一下吧!"他的眼睛发着贪婪的光。

All right, let's talk about it. You give me 99% of the money in your investment deal in exchange, and I'll give you the signature of the deal on the chain. If you refuse, you'll have nothing left. But I and all HODLer will lose some cheerful leaps because of circulation. You can have 1% of the money. If you refuse, I'll lose nothing. Think about it.

学到什么吗?

Did you learn anything?

(1)报复行为很糟糕。

(1) Reprisals are poor.

(2 )交易延展性更糟糕。这就是我们为什么要在隔离见证里修复这个bug的原因。MtGox宣称他们就是被这种漏洞攻击了,有人一直搞乱他们交易的签名,导致他们资金去向被重复提款,但是修复交易延展性更主要的是为了支持支付通道。

This is why we have to fix this bug in the isolation witness. MtGox claims that they were attacked by such loopholes, and that some people have been messing with the signatures of their transactions, causing their funds to go through repeated withdrawals, but it is more important to repair the extension of the transaction to support payment routes.

(3) 把签名包括进去取哈希,最终决定交易ID的设计是一个错误。中本聪犯了许多这样的错误。我们必须重申"中本聪并不是一个有着无限智慧的天龙人"。

(3) The inclusion of signatures in the Hashi, and ultimately the design of the transaction ID, was a mistake. Benz made many of these mistakes. We have to reiterate that "Heard is not an infinity-wise man."

3

CLTV保护型Spilman通道

CLTV protected Spilman Pass

使用CLTV做退款分支(branch)。

Use CLTV as the branch of refund (branch).

这和Spilman通道的区别是退款交易被退款分支给代替了。这种方案只有在2015年后OP_CHECKLOCKTIMEVERIFY(CLTV)被启用才成为可能。

The difference with the Spilman Pass is that refund transactions are replaced by refund branches. This option is only possible after 2015 when the OP_CHECKLOCKTIMEVEIFY (CLTV) is activated.

就像我们在Spilman通道里讨论的那样,交易延展性导致任何在链下被预注册的交易都可以在注资交易未被确认的时候通过改动注资交易的签名使预注册的交易无效化。

As we discussed in the Spilman Passage, the extended nature of the transaction makes it possible for any transaction pre-registered under the chain to invalidate a pre-registered transaction by modifying the signature of a funded transaction when the transaction is not confirmed.

这可以通过简单地在比特币脚本中把一些特殊的要求加到特定分支中来避免。现在,退款分支可以为支付通道创造一个最大的生命周期,通过我们之前对OP_CHECKLOCKTIMEVERIFY的介绍,我们知道这只有在有一个预注册的nLockTime的时候才是可行的。

This can be avoided by simply adding specific requirements to a specific branch in a bitcoin script. Now, the refund branch can create a maximum life cycle for the payment channel. Through our previous introduction to OP_CHECKLOCKTIMEVERIFY, we know that this is only possible when there is a pre-registered nLockTime.

通过CLTV,我们可以在你要支付的脚本中加入很多分支判断使它能够避免上面的问题。

Through the CLTV, we can add many branch judgements to the scripts you are about to pay to enable it to avoid the problems above.

为了设定好注资交易,你现在不必再向一个2/2地址付钱了,你现在要向一个脚本支付资金,这个脚本基本就相当于一个一开始是2/2但经过一段时间就变成单签名的地址。这样就不再需要预注册的交易了。

In order to set up a funded transaction, you don't have to pay for a 2/2 address now, and you're going to pay for a script that is basically like a 2/2 address that starts with a 2/2 but becomes a single signature over a period of time. That means that pre-registered transactions are no longer needed.

你可以稍后使用任何已确认注资交易的交易ID来创建你的退款交易。既然注资交易已经被确认,所以也就不可能再更改交易ID了。

You can start your refund transaction later by using any transaction ID that has been identified as a funded transaction. Since a funded transaction has been confirmed, it is impossible to change the transaction ID.

4

Todd微支付网络

Todd Micropayment Network

闪电网络最直接的前辈就是由Peter Todd引入的hub-spoke模式。

The most direct ascendant of the lightning network is the Hub-spoke model introduced by Peter Todd.

在这种模式中,付款人和收款人并不直接联系,付款人和收款人都连接上一个中心hub。

In this model, there is no direct link between the payer and the payee, and the payee and the payee are connected to the last hub, Hub.

这就使得任何的付款人可以向任何的收款人使用在hub上的同一个支付通道付费。相似的,它也允许任何的收款人从任何的付款人那里使用同一个通道收款。

This allows any payer to pay any payee for the same payment route on Hub. Similarly, it allows any payee to collect the same channel from any payer.

还记得之前的Spilman的例子吗?当你向酒保打开一个通道后,你必须等待注资交易确认。这可能会花费一个小时的时间。再想象一下你需要和所有你要付款的人开通通道。这并不具备可拓展性。

Remember the previous example of Spilman? When you open a channel to the bartender, you have to wait for confirmation of a funded transaction. This could take an hour. Imagine you need to open it with all the people you pay. That's not expansionary.

所以hub-spoke模式有一个清算中心,用来将资金从付款人转移到收款人。"Moonbeam"项目采取了这个模式。当然,这个模式hub会知道谁是付款者和收款者,所以hub有审查交易的能力。当然,通常hub更有效率的审查方式是不再维护它想审查的付款人和收款人的通道就好了(因为如果hub不处理这笔交易那通道里的资金只能被锁在里面毫无用处)。

So the Hub-spoke model has a clearing centre to transfer funds from the payee to the payee. The Moonbeam project has adopted this model. Of course, the Hub model will know who the payee and the payee are, so Hub has the ability to examine the transaction. Of course, the usual more efficient way to review Hub is to stop maintaining access to the payer and the payee it wants to review (because if Hub does not deal with the transaction, the money in the channel is locked in it for nothing).

拥有监控支付的能力意味着hub可以贩卖私人交易数据来牟利。在今天,这种对隐私的破坏是不能容忍的。

The ability to monitor payments means that hub can sell data on private transactions for profit. Today, such breaches of privacy cannot be tolerated.

另一个值得注意的点是如果这样的网络真的被大规模推广了,但是它只有单向的通道可以使用。但是一个人可能是付款人,也可能是收款人,你需要分别创建一个收款通道和付款通道。更糟糕的是,如果你想把钱从收款通道转移到付款通道,你需要在链上把他们都关闭然后再开通一次。

Another point worth noting is that if such a network is really large-scale, but only one-way access is available. But a person can be a payer or a payee, and you need to create a collection channel and a payment channel, respectively. Worse still, if you want to transfer money from a collection channel to a payment channel, you need to shut them down on the chain and open them again.

5

Poon-Dryja闪电网络

Poon-Dryja Lightning Network

Poon-Dryja是双向双参与者通道。

Poon-Dryja is a two-way double-participants channel.

Poon-Dryja通道的机制有两个重要的改变:双向且没有时间限制。

There are two important changes to the mechanism of the Poon-Dryja Pass: two-way and no time limit.

最初的中本聪版本和Spilman变体都是单向的:这里存在不同的两方,付款者和收款者,如果收款者想要退款,或者收款人想要买一个付款人的东西,他们也不能使用同一个通道。

The original neutron version and the Spilman variant were one-way: there were two different parties, the payer and the payee, who could not use the same channel if the payee wanted a refund or if the payee wanted to buy something from a payer.

Poon-Dryjam机制可以使通道变成双向的,你不只是一个付款人或者收款人,只要你的对手方在线,你可以任意的收款和付款。

The Poon-Dryjam mechanism can turn the tunnel into a two-way street, and you are not just a payer or a payee, as long as your opponent is online, you can collect and pay at will.

更进一步讲,不像是Spilman变体,通道没有时间限制。你可以让通道维持到你想要的任何时候。

Further, unlike the Spilman variant, there is no time limit on the passage. You can keep the passage as long as you want.

这两种特性,合在一起形成了一种大多数人都没有意识到的强大的拓展性。在单向的支付通道中,你需要为收钱和付钱单独开设一条通道。你需要定期的在链上执行操作来"逆转"支付通道的方向。其次,因为Spilman通道有一个固定的生命周期,你必须周期性的关闭和重开通道。

Together, these two characteristics form a powerful extension that most people are not aware of. In a one-way payment route, you need to open a separate channel for the collection and payment of money. You need to "reverse" the direction of the payment channel by performing regular operations on the chain. Secondly, because the Spilman route has a fixed life cycle, you have to close and reopen it periodically.

有了双向、无限生命周期的通道,可能你一生只需要进行两笔链上交易,一次在你开通通道时,一次在你死后遗产分配时。这就是这种通道的强大之处。

With a two-way, infinite life cycle path, maybe you'll just have to trade two chains in your lifetime, once when you open it, once when your estate is distributed after you die. That's the strength of the tunnel.

我不会在去解释Poon-Dryja双向通道的交易结构,它很复杂,而且你还可以在其他地方找到简单易懂的图示来搞明白它的机制。

I am not going to explain the two-way trade structure of the Poon-Dryja corridor, which is complex, and you can find simple and understandable illustrations of the mechanism for understanding it elsewhere.

下面我们来讲一下Poon-Dryja通道的一些人们常常忽视的缺点(因为这些缺点被完美的解决了)。

Let us turn to some of the shortcomings of the Poon-Dryja corridor, which are often overlooked (because they have been perfectly addressed).

你必须存储这个通道所有的撤销密钥。通道的每一次更新你都需要存储一个撤销密钥,也就是说仅仅对一个通道来讲,你需要在你的一生中存储上百万的密钥,大小会到几兆。

You have to store all the revocation keys in this channel. You need to store one revocation key for every update of the channel, which means, for one channel alone, you need to store millions of keys in your lifetime, the size of which is a few trillions.

RustyReddit解决了这个问题,我们可以从一个种子密钥开始生成所有的密钥。每一个密钥都是那个种子密钥不断重复的取SHA256。

RustyReddit solves the problem, and we can start generating all the keys from a feed key. Each key is the feed key that repeats the SHA256.

比如,我告诉你我的第一个撤销密钥是SHA256(SHA256(seed))。你可以在O(1)中存储它。等到下一次撤销时,我告知你撤销密钥是SHA256(seed)。从SHA256(seed)开始,你自己就可以计算SHA256(SHA256(seed))(也就是之前的撤销密钥)。所以你只需要记住最近的撤销密钥就可以了,你可以通过计算得出之前的每一个密钥。当你开通一个通道时,你会在你的种子密钥上执行上百万次SHA256,然后把最终结果作为第一次使用的撤销密钥,每当你需要一个撤销密钥时你只需要去掉一层SHA256。RustyReddit还提出了一种效率很高的储存结构O(log n),shachain。如果出现状况,你能够很快的找到原来的撤销密钥。人们现在不再讨论这个储存问题了,因为它被非常完美的解决了。

For example, I told you my first retraction key was SHA256 (SHA256 (seed)). You can store it in O(1). By the time you open a channel, I told you to cancel the key is SHA256 (seed). Starting with SHA256 (seed), you can calculate the SHA256 (SHA256 (Seed) (the previous retraction key). So you just need to remember the most recent revocation key, and you can calculate every key you have before. When you open a channel, you execute a million times SHA256 on your seed key, and then use the final result as the first revocation key, and you just have to remove one layer of SHA256 when you need it. Rusty Reddit also proposes a highly efficient storage structure O (logn), shachain. If something happens, you can quickly find the previous one.

我想强调的另一件事是,当闪电网络的论文从老的 hub-spoke模型里被发展出来时,现代的闪电网络吸取了教训,不再区分"hubs"和"spokes"了。

The other thing I'd like to stress is that when the lightning network paper was developed from the old Hub-spoke model, the modern lightning network learned the lesson and no longer distinguished between "hubs" and "spokes".

在闪电网络中的任何节点都可以当作其他节点的hub。所以,即使你在执行过程中只付款,或者只转发交易,至少最终你仍然部分是转发节点("hub")。这大大的减少了只有几个hub节点导致的隐私问题:转发节点只能得到通过他们的很少的信息,因为付款人和收款人之间的距离太大了,最终的收款人和付款人可以是闪电网络上的任何人。

Any node in the lightning network can be considered a hub for any other node. So, even if you only pay or simply forward the transaction in the execution process, at least in the end you will still be part of the forwarding node ("hub"). This significantly reduces the privacy problems caused by only a few hub nodes: the forwarding node only gets very little information through them, because the distance between the payer and the payee is too great, and the final payee and the payee can be anyone on the lightning network.

又到了知识点时间:

Here's a little bit of time to learn:

(1) 只要我们足够努力我们就可以做到去中心化!

(1) As long as we work hard enough, we can be decentralised!

(2) 只要我们都是hub,hub也可以变成一个好东西。

(2) As long as we are hub, hub can also be a good thing.

(3) 聪明的人能够解决问题,这也是他们聪明的原因。

(3) Smart people can solve problems, which is why they are smart.

6

未来

the future >/strong

在闪电网络之后,有Decker-Wattenhofer 双工微支付通道(DMC)。它使用了一种奇妙的"nSequence递减通道",使用一种新型的nSequence(不是中本聪残破的那一款)相对时间锁语义(relative-timelock semantics)。它使用多个"递减nSequence"结构体,终止于一对Spilman通道中,两个方向各一个。

After the lightning network, there is the Decker-Wattenhofer Double-Technology and Micropayment Channel (DMC). It uses an amazing "nSequence Regressive Channel" and a new type of "nSequence" (not the one that has a deafness in China) relative to the time-lock synonyms. It uses multiple "reduced nSequence" structures and ends in one of the two directions in a pair of Spilman Channels.

通道结构实际上可以在其中包含更多通道构造(Decker-Wattenhofer将一对Spilman通道放入一系列"递减nSequence通道"),这引导我们更进一步提出了Burchert-Decker-Wattenhofer通道工厂。

The channel structure can actually be constructed with more channels (Decker-Wattenhofer puts a pair of Spilman passages into a series of "deflated nSequience" channels), which leads us to further develop the Burcher-Decker-Wattenhofer pipeline plant.

基本上是说,你可以持有多个双参与者通道结构,这些通道结构又被包含在一个更大的多方"通道"里(也就是说在一个"工厂"里持有多个通道)。

Basically, you can hold multiple dual-participating channel structures, which in turn are contained in a larger multi-partite "channel" (i.e., multiple channels in a factory).

继续更进一步,我们还有有Decker-Russell-Osuntokun或者"eltoo"结构。这篇文章已经够长了,我准备以后再讨论它。

Further, we have a Decker-Russell-Osuntokun or "eltoo" structure. This article is long enough for me to discuss it later.

比特币链下扩展性比你想象的还要强大的多。

Bitcoin chain extension is much more powerful than you think.

作者:almkglor

Author: almkglor

翻译:空岛飞行

Translation: An empty island flight

原文地址:

Original address:

https://www.reddit.com/r/Bitcoin/comments/cc9psl/technical_a_brief_history_of_payment_channels/

  • DAG也许是真正的区块链3.0
  • 区块链科普深入浅出 | 再也没有比这个更全的区块链知识了!

声明:链世界登载此文仅出于分享区块链知识,并不意味着赞同其观点或证实其描述。文章内容仅供参考,不构成投资建议。投资者据此操作,风险自担。此文如侵犯到您的合法权益,请联系我们100@7234.cn

Statement: The chain world has published this text solely for the purpose of sharing block-chain knowledge, which does not mean endorsing its views or confirming its description. The text of the article is for information purposes only and does not constitute an investment proposal. Investors operate on this basis, taking on their own risks. Please contact us at 100@7234.cn if your legitimate rights and interests are violated.

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 1983年,山西老人致信央行:人民币上的“中国人民银行”是我写的

    1983年,山西老人致信央行:人民币上的“中国人民银行”是我写的
    阅读本文前,请点击红色“关注”按钮,方便大家讨论和分享,给您带来不一样的参与感。谢谢大家的支持!1983年,山西日报发表了一篇异常简短的文章,主要内容是:“人民币的字体作者是纪。“不久后,上海《新民晚报》也发表了一篇报道,主要内容与《山西日报》基本相同。二人转文章的排版只占一小部分,但不妨碍大家关注此事。一位家住山西的老人看完文章后显得有些不解:“不是啊,人民币上的字明明是我写的。我怎么能把它戴在别人头上呢?”本着尊重历史的原则,老人的女儿给报社写了两封“澄清信”,分别寄给了...
  • 1929经济大萧条或许即将重演?

    1929经济大萧条或许即将重演?
    人类似乎陷入了一个历史悖论,即我们总是重复同样的错误,无法真正从过去的错误中吸取教训。近年来,我们对世界各地接连不断的挑战和危机深感不安。20 19年突如其来的疫情,乌克兰的战火硝烟,欧洲的天然气供应危机以及全球少数国家的饥荒,所有这些问题都像洪水一样,一个接一个地涌来。如果你今天感到心情沉重,不要失去希望,因为明天可能会带来更严峻的挑战。首先,让我们深入讨论名为1929大萧条的时期。这场大萧条实际上是指从1929到1933的一场影响深远的经济危机。这场危机首先起源于美国,然...
  • 2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?

    2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?
    GDP作为全球公认的实力基准,就像是一个大国实力的代言人,它是布雷顿森林体系下全球团结的声音。它不仅仅是数字的累积,更是大国综合实力的人格化,默默诉说着每个国家的辉煌与荣耀。虽然GDP不是衡量一个国家综合实力的唯一标准,但无疑是最关键的指标之一。作为一面镜子,它反映了国家的经济实力和发展水平,是国家综合实力的重要体现,不容忽视。2000年,中国GDP迈过/克洛克-0/万亿美元的重要门槛,达到/克洛克-0/。2/克洛克-0/万亿美元(折合人民币7。7万亿元)。然而,在全球经济的...
标签列表