Lecture 3 - Merkle Trees

Amir Goharshady
7 Feb 202448:39

Summary

TLDR本视频讨论了银行两个分行间的资金转移问题,提出了一种通过Merkle树结构来确保交易记录的安全性和隐私性的方法。通过构建一个由交易哈希值组成的二叉树,并仅通过树的根哈希值来提交所有交易的承诺,同时允许用户通过短证明验证其交易的存在。此外,视频还探讨了如何使用排序Merkle树来证明某个值不存在于树中,而不会泄露其他信息。最后,视频提出了一个关于如何在网络上安全地玩剪刀石头布的问题,作为观众思考的挑战。

Takeaways

  • 🏦 问题描述:银行有两个分行,分别位于香港和伦敦,客户在香港存款后希望在伦敦取款。
  • 🔒 安全性要求:香港分行发送给伦敦分行的消息M通过不安全的通道传输,可以被任何人查看,但无法篡改。
  • 📜 消息M的构成:消息M包含所有存款交易的哈希值,每个存款人获得一个证明P,用于在伦敦分行取款。
  • 💡 解决方案初探:使用链表或账本,每个交易包含交易ID、付款人信息和金额,以及指向前一个交易的哈希指针。
  • 🔏 隐私保护:通过在交易中包含个人信息的哈希值而非实际信息,保护客户隐私。
  • 🌳 梅克尔树(Merkle Tree):使用梅克尔树结构来优化证明长度,提高效率。
  • 🔄 梅克尔树的证明:通过提供从根节点到特定交易节点的路径上的节点及其兄弟节点的哈希值,验证交易的存在。
  • 📈 梅克尔树的优势:提供了较短的证明长度(O(log n)),同时保持了隐私性,因为只包含哈希值而非实际交易信息。
  • ⏱️ 实时性问题:创建梅克尔树需要知道所有交易,因此在所有存款完成后才能生成证明,存在延迟。
  • 🔄 排序梅克尔树:通过排序交易值(或其哈希值),可以更高效地证明某个值不存在,同时减少信息泄露。
  • 🤼‍♀️ 应用场景:梅克尔树可以用于多种场景,如在线游戏(如剪刀石头布)和拍卖,确保公平性和不可篡改性。

Q & A

  • 如何确保香港分行和伦敦分行之间的信息传递既安全又高效?

    -通过使用Merkle树结构,香港分行可以将所有交易的哈希值发送给伦敦分行,这样伦敦分行可以通过较短的证明来验证每个存款者的资金是否真实存在。

  • 在不安全的通道上发送信息时,如何防止信息被篡改?

    -通过在信息上附加数字签名,可以确保信息在传输过程中不被篡改。虽然在这个脚本中还没有详细讨论数字签名,但它是一种常见的安全措施。

  • 什么是Merkle树,它是如何工作的?

    -Merkle树是一种树状数据结构,其中每个叶节点包含一个数据块的哈希值,而非叶节点包含其子节点哈希值的哈希。这种结构允许有效的验证,因为可以通过比较根哈希值和叶节点的哈希值来验证数据的完整性。

  • 为什么需要使用随机数(nonce)?

    -随机数(nonce)用于增加交易的唯一性,防止重放攻击,并隐藏数据模式,从而提高安全性。

  • 如何确保存款者在伦敦分行取款时,他们的个人信息不被泄露?

    -通过在Merkle树中存储个人信息的哈希值而不是实际信息,可以确保即使哈希值被公开,个人隐私也不会泄露。

  • 如果存款者想要证明他们的交易确实存在于列表中,他们需要提供哪些信息?

    -存款者需要提供从根节点到其交易所在的叶节点的路径上的节点值。这些值包括每个节点的哈希值,以及在必要时,其兄弟节点的哈希值。

  • Merkle树如何帮助防止双重支付问题?

    -伦敦分行可以通过跟踪已经支付的交易的哈希值来防止双重支付。一旦交易被验证并支付,它的哈希值就会被记录下来,从而防止同一笔交易被重复提取。

  • 在Merkle树中,如何证明某个特定的值不存在于树中?

    -通过提供该值前后的两个值的哈希值,可以证明中间的值不存在于树中。这是因为Merkle树的结构保证了值的顺序,所以如果两个相邻的值都知道,那么中间的值也就知道了。

  • 为什么在创建Merkle树时需要知道所有的交易?

    -创建Merkle树需要将所有交易的哈希值按照一定的顺序排列,然后逐层计算父节点的哈希值,直到得到根节点的哈希值。因此,必须先知道所有的交易才能构建完整的Merkle树。

  • 在网络环境中如何安全地玩剪刀石头布游戏?

    -可以通过设计一种机制,要求Alice和Bob同时提交他们的选择,并且这个提交是不可更改的。例如,可以使用区块链技术,让他们的选择被记录在区块链上,这样就没有人能够在知道对方选择后更改自己的选择。

Outlines

00:00

🏦 银行分支间资金转移问题

视频脚本讨论了一个银行两个分支(香港和伦敦)之间的资金转移问题。客户在香港存款,并希望在伦敦取款。银行只能发送一条消息(M)给伦敦分支,这条消息通过不安全的渠道传输,任何人都可以看到,但无法更改。香港分支给每个存款人一个证明(P1, P2, P3, P4),这些证明是二进制字符串。目标是确保每个存款人都能取款,但只能取一次,同时不泄露任何个人信息。

05:02

🔗 使用哈希指针的链表解决方案

提出了一种使用链表和哈希指针的解决方案,通过创建交易并链接它们,每个交易包含付款人信息和金额。通过哈希指针连接交易,形成链表。为了验证交易的存在,客户需要提供从链表末尾到其交易的路径。这种方法的问题是证明太长,且泄露了所有交易信息,不符合隐私要求。

10:03

🔒 隐私保护和短证明的需求

讨论了如何通过使用哈希函数来保护客户隐私,避免泄露个人信息。同时,提出了短证明的需求,即如何减少验证交易存在所需的信息量。

15:04

🌳 利用Merkle树优化证明长度

介绍了Merkle树(奇迹树)的概念,通过构建一个二叉树结构来优化证明长度。每个交易都有一个哈希值,树的根节点是所有交易哈希值的哈希。这样,证明一个交易的存在只需要提供从根节点到该交易的路径上的节点,大大减少了证明的长度。

20:06

🔐 提供交易存在的证明

详细说明了如何使用Merkle树为每个客户提供其交易存在的证明。客户需要提供根哈希值和从根节点到其交易的路径上的节点哈希值,以证明其交易确实存在于树中。

25:10

📈 优化Merkle树以支持实时交易

讨论了如何优化Merkle树以支持实时交易。提出了一个问题,即如何在不知道所有交易的情况下创建Merkle树,这需要在所有存款完成后才能进行。

30:10

🔎 证明特定项不在Merkle树中

探讨了如何证明一个特定项不在Merkle树中,通过使用排序的Merkle树来简化这一过程。通过证明一个特定值前后的值,可以间接证明该值不存在。

35:11

🤼‍♀️ 在线游戏的安全性问题

提出了一个在线游戏(如剪刀石头布)的安全性问题,即如何确保游戏双方不作弊,同时保持游戏的公平性。这个问题与之前的拍卖例子相似,都需要确保双方在不知道对方选择的情况下做出决定。

Mindmap

Keywords

💡银行分支

在视频中,银行分支是指分别位于香港和伦敦的两个银行网点。这两个分支通过一个不安全的通道进行通信,以处理客户存款和取款的业务。香港分支负责收集客户的存款信息,并通过发送一条消息给伦敦分支,使得客户能够在伦敦分支取回他们的资金。

💡不安全通道

不安全通道指的是一个通信路径,虽然消息不能被篡改,但是可以被任何能够访问该通道的人看到。在视频中,香港分支通过这个通道向伦敦分支发送消息,而这条消息可能被黑客拦截并公开,但内容无法被更改。

💡数字签名

数字签名是一种用于验证电子文档真实性的技术,确保消息或文件未被篡改,并确认发送者的身份。在视频中,虽然提到了数字签名,但并未深入讨论其具体实现和作用。数字签名在确保消息M的安全性和验证其来源方面起着关键作用。

💡存款证明

存款证明是银行为客户提供的一种凭证,证明客户在银行存有特定金额的资金。在视频中,香港分支给每个存款人一个证明,这个证明是一串数字,客户可以凭借这个证明在伦敦分支取回他们的钱。

💡双重支付

双重支付是指同一个货币被使用两次或以上的情况,这在数字货币和电子交易中是一个需要解决的问题。在视频中,提到了设计一个系统来防止双重支付的问题,即确保每个存款只能被取款一次。

💡数据泄露

数据泄露是指敏感或私密信息被未经授权的人访问或公开。在视频中,提到了设计系统时的一个要求,即不能通过消息M泄露存款人的个人信息和存款金额。

💡Merkle树

Merkle树,也称为奇迹树,是一种用于验证大量数据的树状数据结构。在视频中,通过构建一个Merkle树,可以有效地证明某个数据项是否存在于整个数据集中,同时保持数据的隐私性。

💡隐私保护

隐私保护是指采取措施保护个人信息不被未经授权的访问或公开。在视频中,设计系统时的一个重要要求是确保客户在验证存款记录时不会泄露其他客户的个人信息。

💡链表与哈希指针

链表是一种线性数据结构,其中的每个元素都指向下一个元素。哈希指针是链表中的一种特殊指针,它通过哈希值而不是直接通过链接指向前一个元素。在视频中,最初的想法是使用链表和哈希指针来构建一个系统,但这种方法最终因为证明太长和隐私问题而被放弃。

💡二叉树

二叉树是一种每个节点最多有两个子节点的树状数据结构,通常用于提高数据检索的效率。在视频中,通过使用二叉树而不是链表,可以减少验证存款记录所需的步骤,从而缩短证明的长度。

💡实时性问题

实时性问题指的是在需要立即响应或处理的情况下,系统可能无法满足时间要求的问题。在视频中,构建Merkle树需要知道所有交易后才能进行,这意味着客户在存款后不能立即获得存款证明,需要等待所有交易完成后才能获得。

Highlights

讨论了银行两个分行间的资金转移问题,其中一个分行在 Hong Kong,另一个在 London。

Hong Kong 分行通过不安全的渠道发送一条消息 M 给 London 分行,这条消息可以被任何人看到,但无法被篡改。

Hong Kong 分行给每个存款人一个证明 P1、P2、P3 和 P4,这些证明是二进制字符串。

存款人 Alice、Bob、Carol 和 Dave 分别存入不同金额,希望以后能在另一个分行取回。

设计要求确保每个人都能取回自己的钱,并且每笔存款只能取回一次,防止双重支付问题。

消息 M 不能泄露任何关于存款人的个人信息和存款金额。

提出了使用链表或带有哈希指针的账本来记录交易,但这种方法存在问题。

为了解决链表方法的问题,提出了使用哈希树(Merkle tree)来提高效率。

哈希树的每个节点都是其子节点哈希值的哈希,根节点的哈希值作为整个交易历史的承诺。

哈希树的证明长度是 log(n),比链表方法的 n 要短得多。

哈希树方法解决了隐私问题,因为树中的节点只包含数据的哈希值,而不包含实际的个人信息。

每个存款人需要证明其交易存在的路径,以及该路径在哈希树中的位置。

通过哈希树,可以有效地证明某个特定值是否存在于树中,同时保持证明的长度较短。

提出了排序哈希树(sorted Merkle tree)的概念,通过排序数据来简化证明特定值不存在的过程。

即使在排序哈希树中,也可以通过证明前后哈希值来证明某个值不存在,而不会泄露其他数据信息。

讨论了如何在互联网上安全地玩剪刀石头布游戏,确保双方无法作弊。

将拍卖视为一种游戏,其中参与者需要在不知道对手动作的情况下进行出价。

提出了使用区块链技术来解决分布式系统中的共识问题,确保数据的一致性和安全性。

通过这个银行分支间资金转移的例子,展示了区块链技术在金融领域的应用潜力。

Transcripts

play00:05

at the end of the last session we talked

play00:06

about this problem of a bank with two

play00:09

branches and let's just revisit that so

play00:12

let's say that I have one branch here in

play00:16

Hong Kong and let's say there is another

play00:18

branch in

play00:20

London and we said that people can

play00:23

deposit money in Hong Kong and they want

play00:24

to get their money back in London later

play00:28

now the idea was that the Hong Kong

play00:30

Branch can send only one message to the

play00:32

London branch and this message we called

play00:34

it

play00:36

m we said that this is sent over an

play00:39

unsecure channel so my assumption is

play00:42

that this message M can be seen by

play00:44

anyone maybe a hacker sees it and then

play00:46

publishes it to everyone but no one can

play00:48

change it okay and we will talk about

play00:52

digital signatures later on but for now

play00:54

just imagine that this message somehow

play00:56

has a signature from Hong Kong and it's

play00:58

impossible to forge that okay so this is

play01:03

what we have and then we have a bunch of

play01:05

people who are depositing money so let's

play01:07

say again we have Alice

play01:11

Bob maybe

play01:13

Carol and let's say

play01:16

Dave and each of them is depositing some

play01:18

amounts maybe

play01:20

50 100 200 and maybe

play01:24

10 right and then later on they want to

play01:27

be able to go to the other branch and

play01:29

get their money back and we said that

play01:31

the Hong Kong Branch should give each

play01:33

one of these people uh a proof so let's

play01:37

call it P1 P2 P3 and

play01:43

P4 and generally whenever I don't say

play01:45

what the type of something is you should

play01:47

just assume that it's a string of zeros

play01:49

and ones so the message M that's I'm

play01:52

sending from Hong Kong to London is just

play01:54

a string of zeros and ones the proofs

play01:56

that I'm giving to each one of the

play01:58

depositors these are also just strings

play02:01

of zeros s ons and then the idea was

play02:04

that let's say this happens on day one

play02:06

so on day

play02:07

one everyone does the deposit and then

play02:10

the Hong Kong Branch gives them the

play02:11

proofs and then let's say the next day

play02:14

on day

play02:16

two each one of them go to the London

play02:18

Branch the London branch has already

play02:20

received the message M but now each of

play02:23

them should be able to give the proofs

play02:25

that they have received from Hong Kong

play02:27

to the London branch and get their money

play02:30

now if we want to write our requirements

play02:33

more

play02:34

specifically these are the requirements

play02:36

that I

play02:38

have I have to make sure that everyone

play02:40

can get their money back and I have to

play02:43

make sure that they can get their money

play02:44

back only once so you shouldn't be able

play02:47

to deposit once and then withdraw twice

play02:50

so uh let's say the first one is that

play02:54

every

play02:58

depositor can

play03:02

withdraw but the second constraint is

play03:05

that each deposit can be withdrawn at

play03:08

most

play03:13

once

play03:17

okay and we will later on see that this

play03:19

is actually one of the most problematic

play03:23

issues when we're designing a

play03:24

cryptocurrency so this is the problem of

play03:26

double spending maybe someone has just

play03:28

one coin and they're trying to use it

play03:30

twice or something like that here we

play03:32

will have someone who has deposited once

play03:35

let's say Alice has deposited $50 and

play03:37

maybe she goes to the London branch and

play03:39

then she tries to withdraw $50 twice we

play03:43

have to make sure this cannot

play03:45

happen and the other constraints that we

play03:49

want to

play03:50

have is basically I don't want to leak

play03:53

any data based on M so m is public

play03:56

everyone can see M no one should be able

play03:59

to find any of the personal information

play04:01

on of the depositors and the amounts

play04:03

that they deposited based on M so

play04:08

M does not

play04:10

leak any personal

play04:19

data

play04:20

okay and then we also talked about this

play04:23

idea that maybe this channel is really

play04:27

expensive maybe I want my message M to

play04:30

be as short as possible so this is

play04:33

another requirement I just want to say

play04:35

that the message m is really small so

play04:39

let's say m has constant lengths

play04:46

has1 this is another thing that I would

play04:48

like to

play04:49

have because otherwise if M could be

play04:51

large well the Hong Kong Branch could

play04:54

just take the hash of every transaction

play04:56

the hash of every deposit and send all

play04:59

of these has hases to the London ranch

play05:01

right that would make the problem

play05:03

trivial but at the same time we have a

play05:06

really

play05:07

huge now we saw a solution last time and

play05:10

the solution was to just use a linked

play05:13

list or a ledger with hash pointers so

play05:16

the idea was very simple this was our

play05:20

initial

play05:21

idea so uh maybe I can call it nons

play05:25

solution one because we know that it

play05:27

will not work in the end

play05:30

was that I'll just create some

play05:32

transactions and let's say every

play05:35

transaction has some ID and a let's say

play05:38

this is transaction number one and let's

play05:40

say it also has a pointer to the

play05:42

previous transaction now in this case

play05:44

because there is no previous transaction

play05:46

this pointer is just null there's

play05:48

nothing in there but then in this

play05:50

transaction I say who paid the money and

play05:52

how much so maybe I just say this is

play05:56

Alice and

play05:58

50 then I I create another

play06:01

transaction it's really hard

play06:04

to this so this was transaction one this

play06:07

is my transaction two it has a serial

play06:10

number two it should also have a pointer

play06:13

to the previous transaction so it will

play06:16

have a

play06:16

pointer to this transaction and

play06:19

basically the way that works is that I

play06:21

have a hash of the previous transaction

play06:24

so the pointer is just a hash of

play06:26

transaction one and then in transaction

play06:28

two I'm saying that Bob paid 100 so I

play06:31

would just write Bob

play06:35

100 and I just repeat this for the other

play06:38

two transactions as well so I have

play06:41

transaction

play06:43

three and this one was Carol plus d 200

play06:48

and then

play06:49

10 okay so 200 and it also includes the

play06:53

hash of the previous

play06:56

transaction and then finally I have this

play07:00

last transaction transaction

play07:03

4 it has the hash of transaction

play07:08

three and it says that they've paid

play07:14

much

play07:17

okay now the question was what is the

play07:20

proof that we can give uh to each of the

play07:23

depositors and what is the message M

play07:25

that we're going to send to the other

play07:27

Branch so for the message m

play07:30

we said we just take the hash of the

play07:31

very last transaction so I just take

play07:34

this whole transaction I hash it I get

play07:37

hash of transaction for and I say this

play07:40

is my message

play07:41

M and I send this to the other

play07:45

Branch now let's say that you're one of

play07:48

these depositors and you need to go to

play07:50

the London branch and prove that one of

play07:52

these transactions actually exists it's

play07:55

actually in this list now let's say

play07:57

you're Dave if you're Dave you can just

play08:00

go to the other uh branch and you can

play08:03

just show your

play08:04

transaction and they can just calculate

play08:06

the hash they see that it's the same as

play08:08

M that they received from the other

play08:10

Branch so they know that you didn't fake

play08:12

this

play08:13

transaction so they would give you the

play08:15

money but now imagine your Carol if

play08:19

you're Carol you can't just give your

play08:21

own transaction you have to also provide

play08:24

Dave's

play08:25

transaction because that's the only way

play08:27

you can verify Carol's transaction here

play08:30

see uh as the London Branch You Know M

play08:33

you know the hash of this last

play08:35

transaction so if Carol wants to prove

play08:37

that this transaction transaction three

play08:40

actually I forgot to write the

play08:42

transaction name so this was transaction

play08:44

three this is transaction

play08:46

4 if Carol wants to prove that this

play08:48

transaction is actually in the list she

play08:52

has to start from the end of the list

play08:55

she has to First say here's transaction

play08:57

four which has the the correct hash and

play09:00

the bank can check that and then she has

play09:02

to say okay now in transaction four as

play09:05

you see there is a hash pointer to

play09:06

transaction three and here's transaction

play09:09

three and now you can check that it has

play09:11

the correct hash so that's how Carol can

play09:14

prove that her transaction is in there

play09:17

so in order for Carol to prove the

play09:19

existence of her transaction in this

play09:21

list she has to actually know her own

play09:24

transaction but also Dave's

play09:27

transaction now the problem because

play09:29

comes even worse for Bob because you can

play09:32

just continue with this Bob has to know

play09:34

his own transaction Carol's transaction

play09:36

and Dave's transaction in general each

play09:39

person who wants to prove the existence

play09:40

of their transaction has to also prove

play09:42

every transaction that comes after it

play09:45

right so in general the proof that I'm

play09:48

going to have if I have end

play09:52

transactions

play09:53

[Music]

play09:55

uh I don't know why this writing is not

play09:58

working okay so assuming that I have n

play10:03

transactions this is what happens the

play10:05

proof of transaction I is going to

play10:08

include transaction I itself but also

play10:11

transaction I + one transaction I plus 2

play10:15

all the way to transaction

play10:17

n right so this is the proof that I'm

play10:20

giving to each one of my

play10:23

depositors so Alice here is going to

play10:25

have the longest proof because she

play10:27

actually needs to have all all of the

play10:29

transactions in order to prove the

play10:31

existence of

play10:32

a now two problems and these were the

play10:35

problems that I mentioned at the end of

play10:37

the previous session the first problem

play10:40

is that now our proofs are too

play10:42

long and the second problem is privacy

play10:45

if Alice needs to know all of the

play10:48

transactions that come after hers in

play10:50

order to prove the existence of her

play10:52

transaction that means that Alice has to

play10:54

know that Bob deposited 100 and Carol

play10:56

deposited 200 and so on so Alice knows

play10:59

everyone's name and amount that they

play11:01

transacted and that's not something that

play11:04

we would be happy with so let's add some

play11:08

extra requirements

play11:11

here I can apparently only write towards

play11:14

the top of the page for some

play11:18

reason okay

play11:21

so my extra

play11:25

requirements are going to be short

play11:27

proofs and privacy

play11:34

see so short proofs is fine

play11:37

privacy by privacy at this point I mean

play11:40

that no one should be able to see other

play11:42

people's transactions so no one should

play11:45

be able to see other people's names and

play11:47

no one should be able to also see the

play11:48

amounts that they

play11:50

deposited so uh no

play11:55

client

play11:57

sees

play12:00

other people's

play12:04

information but are these the only

play12:07

requirements that are not satisfied can

play12:08

we just check that these previous

play12:10

requirements are already all

play12:12

satisfied

play12:14

so every depositor can withdraw yes

play12:17

because every depositor can prove that

play12:19

their uh transaction was actually in the

play12:22

linked list in The Ledger so we have

play12:24

this one each deposit can be withdrawn

play12:27

at most once well this one is something

play12:30

that we can enforce on the side of the

play12:32

London Branch because the London Branch

play12:34

can just remember which transactions uh

play12:37

have been paid out and just don't pay

play12:39

out the same transaction more than once

play12:42

right and every transaction has a serial

play12:43

number so they can just keep track of

play12:45

the serial numbers that are paid out so

play12:48

this is

play12:49

easy now here's the interesting part we

play12:53

already had the requirement that M the

play12:56

message that is sent from Hong Kong to

play12:57

London does not leak any information any

play13:00

of the personal information of the

play13:02

people and actually we satisfied that

play13:05

because m is just the hash of this

play13:09

transaction right and hopefully the hash

play13:11

of the transaction doesn't really leak

play13:13

any information but in the last session

play13:16

we saw that if you don't have nones in

play13:19

your hash it can actually leak

play13:22

information right but here I don't need

play13:25

to add an extra NS because this hash is

play13:28

pretty much like an ANS

play13:30

itself right so the hash of transaction

play13:32

three is already included in transaction

play13:35

four and that's something that uh really

play13:38

makes our domain large so no one can

play13:41

really do uh any kind of uh butterfly

play13:45

attack or uh just trying every

play13:47

possibility root forcing things like

play13:49

that but if you don't trust your hash

play13:52

function you can also add a non here

play13:55

that's fine so this makes sure that M

play13:58

does not leak any information and of

play14:01

course M's length was fixed because the

play14:03

output of a hash function always has a

play14:05

fixed length let's say

play14:07

256 so this is also F now the thing that

play14:12

is interesting here is that I didn't

play14:14

want M to leak any personal data and

play14:18

basically I used the hiding property of

play14:21

the hash function here I said that

play14:23

because m is just the hash of something

play14:26

and because my uh hash function is

play14:29

hiding this m is not going to leak any

play14:32

information

play14:34

right so now here for privacy I need

play14:38

something very similar it's just that I

play14:41

want to make sure that none of the

play14:42

clients can see anyone else's

play14:45

information so maybe I can again use

play14:48

hashes so the idea here is to use

play14:53

hash to hide

play14:57

data

play15:00

okay so what was our problem here why

play15:03

were we leaking any personal

play15:07

information basically the problem was

play15:09

that when Carol wanted to prove that her

play15:11

transaction is in there she had to also

play15:14

provide the transaction for Dave but

play15:16

then the transaction of Dave actually

play15:18

included his name and his amount right

play15:22

so if I just Define my transactions in a

play15:24

different way so that my transactions

play15:27

don't have this personal information in

play15:29

them but they only have let's say the

play15:31

hash of the personal

play15:34

information then no information will be

play15:36

leaked so let's do this let's say that

play15:40

uh first of all I need a bunch of

play15:42

nonsense for my hashes so let's say

play15:44

whenever someone is depositing money

play15:47

they're also giving a random nons to the

play15:49

branch so Alice when she deposits the

play15:52

money she chooses some nons n one and

play15:56

also gives this nons uh to the Hong Kong

play15:59

branch and let's say this N1 is just a

play16:01

random string of 1,24

play16:05

bits and let's say Bob does the same

play16:07

thing Carol does the same thing and Dave

play16:10

also does this now I'm going to change

play16:14

the structure of my

play16:17

transactions so this is nons solution

play16:23

two it's going to solve our privacy

play16:26

issue but it's not going to solve the

play16:28

problem problem with really long

play16:31

proofs now again look here transaction

play16:35

one used to include the personal

play16:37

information of Alice instead I'm just

play16:39

going to say this transaction will only

play16:41

have the hash of the personal

play16:43

information so I'm going to create a new

play16:47

transaction

play16:51

one and again just as before it has a

play16:54

serial number it has a pointer to the

play16:56

previous transaction but there is no

play16:58

previous previous transaction so this

play16:59

one is null so when I say null you can

play17:01

just imagine a string of all zeros right

play17:05

and then here instead of actually

play17:08

putting Alice 50 I put the hash of the

play17:11

string that contains her name and then

play17:14

concatenated with the amount and then

play17:17

concatenated with the nons that she

play17:20

chose okay so this is now my new

play17:23

structure for my transactions and of

play17:26

course I do the same thing for the other

play17:28

trans transaction so

play17:30

uh this is my transaction

play17:33

two and let's say transaction three and

play17:36

transaction four and each one of them

play17:40

will have a serial number it will have a

play17:43

pointer to the previous transaction

play17:45

which is basically just the hash of the

play17:46

previous

play17:47

transaction and instead of the

play17:50

information it will just have the hash

play17:52

of the information so Bob

play17:54

100 and the nons of Bob

play18:03

two okay and so on I'm just too lazy to

play18:06

draw this you

play18:09

know okay now first of all why do we

play18:13

need the nones we need the nonsense

play18:16

because otherwise uh again someone can

play18:19

do a Brute Force attack If someone knows

play18:21

the names of all of our clients they can

play18:24

just try every possible name and they

play18:26

can also try every possible value if the

play18:28

values are small so we need the nonsense

play18:31

here to really hide the

play18:33

data but now actually my laziness is

play18:36

backfiring I have to actually put them

play18:39

here I guess so I have this hash of

play18:43

whatever here hash of the personal

play18:45

information I have a pointer to the

play18:47

previous one I have a serial number and

play18:51

here again I have the hash I have a

play18:55

serial number and I have a pointer to

play18:57

the prev

play18:59

okay

play19:01

now just as

play19:04

before we have to talk about what kind

play19:07

of proof we have to give to each one of

play19:08

the

play19:09

depositors so the last depositor again

play19:12

just uh brings the transaction so I just

play19:16

say that my m is the hash of this last

play19:22

transaction so that's the value that the

play19:24

Hong Kong branch is sending to the

play19:26

London branch

play19:28

and if the last depositor wants to prove

play19:31

that their transaction is in the this

play19:33

they can just bring their transaction

play19:35

and when they bring their

play19:36

transaction the Hong Kong Branch can

play19:38

check that it has the right

play19:40

hash and then when they see that it has

play19:43

the right hash what is it that uh I'm

play19:47

providing I'm basically providing this

play19:49

pointer this serial number and this

play19:52

other

play19:54

hash but now the Hong Kong the London

play19:58

branch is convinced about this

play20:01

hash right but this hash is the hash of

play20:05

my personal information so it's the hash

play20:08

of my name and the amounts that I put in

play20:10

and the nons that I chose but I know all

play20:13

of those things so I can give those

play20:15

things to the London Branch as well and

play20:17

they can verify it and they can know

play20:19

that this was the amount that I put

play20:21

in so the proofs actually work just like

play20:26

before so now let's consider

play20:29

Alice let's say that Alice wants to

play20:32

prove that transaction one was in there

play20:35

so she has to start with the last

play20:37

transaction she has to give the hash of

play20:39

the last

play20:40

transaction right uh so sorry she has to

play20:43

give the last transaction transaction 4

play20:45

and then the branch checks that it has

play20:47

the right hash but after it checks that

play20:50

transaction 4 has the right hash it can

play20:53

see the pointer here to transaction

play20:55

three and then Alice can give

play20:56

transaction three and then we can just

play20:59

Traverse all the pointers back until we

play21:01

get to transaction one so everything is

play21:05

just like before Alice knows all of

play21:07

these transactions the difference is

play21:09

that these transactions now don't

play21:11

include any personal information of

play21:13

anyone they just include these hashes so

play21:16

even though Alice knows this hash that

play21:18

appears in transaction two she doesn't

play21:21

know that transaction two actually

play21:23

belongs to Bob and it was for $100 and

play21:25

so on that information is Now hidden

play21:30

she knows that information only for her

play21:31

own transaction so now the proof is

play21:34

exactly like before she just proves that

play21:37

this transaction transaction one is in

play21:39

the linked list but after she does this

play21:42

she also knows the values that created

play21:45

this hash so so she can actually open

play21:47

this hash and say okay now this hash

play21:49

says that I'm Alice I deposited 50 and

play21:52

this is my NS so she can know only about

play21:56

her own personal data and she can prove

play21:58

the existence of the transaction to the

play22:00

other branch and everything else goes

play22:02

through because well of course she can

play22:04

withdraw now because she can prove her

play22:06

own

play22:07

transaction uh every deposit can be

play22:09

withdrawn at most once because again

play22:12

let's say the London Branch just keeps

play22:14

track of the serial numbers that are

play22:16

withdrawn and it's really important that

play22:19

these serial numbers and the hash

play22:21

pointers they're outside of this hash so

play22:24

the design is quite important here and M

play22:29

does not leak personal data for the same

play22:31

reason as before it's a hash it has

play22:33

constant lengths for the same reason as

play22:35

before but now we also have this

play22:38

privacy now we have this as well no

play22:42

client can see any other clients

play22:44

information they can only see the hashes

play22:46

and the hashes don't

play22:48

leak but we still don't have short

play22:50

proofs the lengths of our proofs are

play22:52

still as bad as before so my proof is

play22:55

still the same as before if I want to

play22:57

prove transaction I I have to provide

play22:59

all the transactions from transaction I

play23:02

forward so if I want to prove the first

play23:04

transaction I have to give all of the

play23:05

transactions so in the worst case my

play23:07

proofs have a length of basically Theta

play23:11

n

play23:13

okay

play23:16

so how do we make this better let's

play23:19

forget about the hashes and let's just

play23:21

look at the data structure what are we

play23:24

doing this message M that I'm giving to

play23:27

the London branch

play23:28

it's basically a pointer to the last

play23:31

transaction right because we talked

play23:33

about this hashes are

play23:35

Pointers now I'm giving a pointer to

play23:37

this last transaction and whenever

play23:39

someone wants to prove that their

play23:42

transaction is in the list they have to

play23:45

basically help the London Branch

play23:47

Traverse this whole list until it

play23:50

reaches their

play23:52

transaction so that's the problem the

play23:55

problem is that I have a link list and

play23:57

basically I have to Traverse this link

play23:59

list until I get the transaction I was

play24:02

looking for and doing

play24:05

that uh in the worst case takes n steps

play24:09

or n minus one steps

play24:11

okay now from your basic data structures

play24:15

coures what is a data structure that

play24:18

would allow you to Traverse it

play24:21

faster you can just use something like a

play24:24

binary tree right so this is the

play24:27

intuition that I want you to have

play24:28

imagine that instead of having a linked

play24:33

list I just use a binary

play24:39

tree so let's say I have a root in my

play24:43

tree and each node has two children it's

play24:46

a binary

play24:48

tree so it's a tree that looks like

play24:54

this okay now if I have a tree like this

play24:59

and if I have n elements in the tree so

play25:03

let's say n nodes or n

play25:05

elements what is the height of this

play25:09

tree it's logarithmic in N right so my

play25:16

height is just going to be o of

play25:20

log now let's say that I

play25:24

somehow can give the London Branch a

play25:28

pointer to the root of this tree and

play25:31

let's say that every node also has two

play25:34

pointers it has a pointer to the left

play25:36

side and a pointer to the right side so

play25:37

a pointer to the left child and another

play25:40

one to the right

play25:41

child if this is the case then you can

play25:45

see that my proofs will be shorter so if

play25:48

I want to prove that this node for

play25:52

example let's say I want to prove that

play25:55

this is in my tree let's say this is the

play25:57

transaction where I've deposited some

play25:59

money in Hong Kong I want to prove that

play26:01

this is in the tree and let's say that

play26:05

the pointer that Hong Kong sent to

play26:07

London was a pointer to the rout all I

play26:10

have to do is that I have to prove that

play26:13

the root is there so I have to give the

play26:15

root to the London Branch then I have to

play26:18

show that the root has a pointer to this

play26:20

left child and give this left child to

play26:22

the London Branch then I have to show

play26:25

that this left child has a pointer to a

play26:26

right child and give this

play26:29

one so now as you see I'm basically

play26:32

providing only one of the nodes at each

play26:34

level of the tree so I'm providing a

play26:37

proof that has a length of login but I

play26:40

didn't tell you how to create this tree

play26:42

yet this is just the intuition the

play26:44

intuition is that instead of

play26:46

traversing a whole link list which takes

play26:49

linear time I just want to be able to

play26:52

Traverse a binary tree which takes login

play26:55

time okay now how how do we actually

play26:58

make this kind of tree this is what we

play27:01

call a miracle

play27:06

tree

play27:08

okay now here's how this works let's say

play27:12

that I have a bunch of transactions

play27:15

transaction one to transaction four now

play27:18

in my transactions I'm just going to put

play27:20

the uh personal data so

play27:23

basically I have um let's say I don't

play27:27

personal data let's show with d so I

play27:30

have D1 D2

play27:34

D3 and D4 and basically D1 is the

play27:38

personal data of Alice it's basically

play27:40

the string that says Alice deposited 50

play27:44

and her nons was N1 so that's what

play27:48

d1s right and similarly for all the

play27:50

other ones so for example D4 is just

play27:53

Dave 10

play27:56

N4 okay so

play28:00

D4 it's just going to be Dave deposited

play28:04

10

play28:06

and is non for N4 okay I want to create

play28:10

a binary tree that contains all of these

play28:13

uh pieces of information D1 to

play28:16

D4 uh kind of as its leaves but not

play28:20

exactly so here's what I'm going to do

play28:22

I'm going to create a leaf for each one

play28:25

of

play28:26

these so I'm going to create a node in

play28:29

my tree and in this one I'm going to put

play28:31

the hash of

play28:33

D1 in this node I'm going to put the

play28:36

hash of

play28:38

D2 similarly I'll just put the hash of

play28:41

D3 the hash of

play28:46

D4

play28:48

okay now I want to create a binary tree

play28:51

so there should be a node that is the

play28:54

parent of both of

play28:56

these and let's give this a name let's

play28:59

call this one L1 so L1 is just the hash

play29:03

of D1 L2 is just the hash of D2 I have

play29:07

L3 here and L4

play29:09

here now I create a parent that

play29:13

basically has the hash of L1 and L2 so I

play29:16

do this hash of L1 concatenated with

play29:22

L2 and I make it the parent of both of

play29:26

these

play29:27

and here I do the same thing I have to

play29:31

scroll up in order to be able to write

play29:34

so hash of

play29:36

L3 oops concatenated with

play29:44

L4 okay let's give this some other name

play29:48

so I don't know let's call this one B1

play29:50

and let's call this one B2 I will

play29:53

finally have a root which basically has

play29:56

the hash of B1 concatenated with

play30:05

B2 and this is my root let call it

play30:10

R

play30:12

okay let me just clarify something here

play30:16

so I have a bunch of pieces of data and

play30:18

all of these are strings D1 D2 D3 D4

play30:21

right so I'm taking the hash of D1 I'm

play30:24

calling that L1 so L1 is also a string

play30:28

it's just the hash of D1 L2 is just the

play30:30

hash of D2 so I then take these two

play30:33

strings I concatenate them and I take

play30:36

their hash and I call that B1 so if I

play30:39

want to expand this B1 is basically the

play30:43

hash of the hash of D1 concatenated with

play30:48

the hash of

play30:49

D2 that's what B1

play30:53

is okay and similarly B2 is the hash of

play30:56

the hash of D3 concatenated with the

play30:58

hash of

play31:00

D3 now finally I'm going to use my root

play31:05

hash uh which is called also the miracle

play31:08

root so this whole tree is called the

play31:09

miracle tree after its inventor and The

play31:12

Roots we always call it the miracle rout

play31:15

I'm going to use this route as my

play31:17

message M so this is what the Hong Kong

play31:20

branch is sending to the London

play31:22

Branch now the first thing I want you to

play31:25

see is that when send this message m to

play31:28

the other Branch I'm basically

play31:30

committing to everything in this tree

play31:32

I'm committing to all of the data points

play31:35

D1 to D4 because if I later want to

play31:38

change any of them let's say I want to

play31:41

change D2 this would also change L2

play31:44

because it's just the hash of T2 but if

play31:46

it changes L2 it will also change

play31:49

B1 and generally whenever any node in

play31:53

this three changes it also changes its

play31:55

parents because you you have to

play31:57

recalculate the hashes so this means

play32:00

that when I'm giving the hash of the

play32:01

root I'm committing to everything in

play32:04

this tree I cannot change any of the

play32:05

entries in this

play32:07

tree

play32:09

okay so that's good because it means

play32:12

that uh I can just send this root hash

play32:15

to the other branch and I have sent a a

play32:18

very short message a message of constant

play32:20

length but I'm now sure that that

play32:23

message has enough information to commit

play32:24

me to every one of the transactions

play32:27

now let's say that someone wants to

play32:29

prove that their transaction is actually

play32:31

in the list so what kind of proof should

play32:34

I give to Alice so that Alice can prove

play32:37

that D1 is actually in this

play32:40

stream so Alice should be able to go to

play32:43

the London branch and she should be able

play32:46

to basically let the r London Branch

play32:48

start from here and then go to B1 and

play32:52

then go to L1 so that they're convinced

play32:55

that D1 is there so the information that

play32:58

Alice needs to know is going to be what

play33:01

well she needs to know the root

play33:04

hash needs to basically Know M or let's

play33:08

say

play33:09

this right but let's say that she knows

play33:14

M and the London Branch also knows M but

play33:18

now Alice wants to prove that B1 is the

play33:20

left child of

play33:22

M okay how can you do that well you

play33:26

actually also o need to know

play33:29

B2 right because the only way I can

play33:31

prove that B1 is the left child is by

play33:35

providing both B1 and B2 and saying just

play33:37

take the hash of B1 V2 and that gives

play33:39

you the hash that you already have here

play33:41

it gives you

play33:43

R right so Alice needs to know this note

play33:48

Alice needs to know R she needs to know

play33:51

B1 but she also needs to know

play33:54

B2 and the role of B2 is to just prove

play33:57

that B1 is the left child of

play34:00

R okay so now that she has provided this

play34:05

information the London branch has

play34:07

verified that B1 is the left child of R

play34:10

but B1 is just the hash at this point

play34:12

right now Alice wants to prove that L1

play34:15

is the left child of B1 but in order to

play34:19

do that she also needs to know the right

play34:20

child she also needs to know L2 so if

play34:23

she provides both L1 and L2 then uh the

play34:27

branch can just compute the hash of L1

play34:30

and L2 and verify that it was correct

play34:32

which means that L1 is the left child

play34:33

and L2 is the right child so she needs

play34:36

to know L2 and she needs to also know

play34:40

L1 and at this point when she gives all

play34:43

of this information to the London Branch

play34:45

the London Branch knows that L1 is in

play34:47

the tree now L1 was just the hash of the

play34:51

personal data of Alice and Alice knows

play34:53

her own personal data she knows that uh

play34:56

d one was basically Alis 50 and N1 so

play35:00

she can just provide this and then at

play35:03

this point it's proven to the bank that

play35:05

this deposit was actually in the list

play35:07

and it was actually in this

play35:09

tree

play35:11

so now let's do it for someone

play35:16

else let's say

play35:19

that uh Carol wants to prove it so I

play35:23

want to prove this third transaction

play35:25

again I have to prove the root

play35:29

I have to prove that B2 is the right

play35:31

child of the root but in order to do

play35:33

that I have to also know B1 so she

play35:36

should also know

play35:38

B1 and B2 but at this point B2 is proven

play35:43

to the bank so she wants to prove that

play35:45

L3 is the left child of B2 but to do

play35:48

that she needs to also know L4 so she

play35:50

needs to know L3 and

play35:53

L so this is the proof that I'm going to

play35:56

give

play35:57

to Carol to the person who's done the

play36:00

third deposit and so now in general this

play36:03

might not look great when I have only

play36:05

four deposits because the proofs seem to

play36:08

be

play36:09

long but in general if I have a Long

play36:13

Tree basically my intuition holds I can

play36:16

start at the top of the tree and I just

play36:20

have to provide the path that goes to my

play36:22

particular Leaf but the difference is

play36:25

that whenever I'm providing some node I

play36:28

have to also provide it

play36:30

sibling so I'm not going to just give

play36:34

proofs of lengths login the lengths of

play36:36

the proofs are actually two times login

play36:38

but that's fine I don't care about just

play36:40

the constant factor it's all login

play36:42

anyway so I can now have proofs whose

play36:46

lengths are just all Lin so every

play36:51

Pi

play36:53

now if I take any proof Pi the lengths

play36:57

of this

play36:59

proof is in O of login more specifically

play37:02

it's twice the logarithm plus one plus

play37:04

two whatever

play37:07

okay nice so this is what we call a

play37:10

mirle tree and it finally now satisfies

play37:13

all of our requirements so first of all

play37:16

it has short proofs short in the sense

play37:19

that the length of the proof is all in

play37:22

we will later on see how we can actually

play37:24

decrease this to even constant time

play37:27

when we talk about digital signatures

play37:29

and other things but for now this is

play37:31

short enough for

play37:33

us it also protects the privacy because

play37:37

you

play37:38

see any one of my clients would just see

play37:41

some of the hashes this tree but these

play37:45

hashes they don't contain any personal

play37:47

information so in my tree I'm not

play37:50

putting any of the actual personal data

play37:52

I'm only ever putting the hashes and all

play37:54

of my hashes have nonsense in them

play37:58

so it also satisfies the Privacy

play38:01

requirement and these previous

play38:03

requirements it's also kind of easy to

play38:05

verify so the message that is sent from

play38:08

one branch to the other branch is just

play38:10

the hash of the root that's constant

play38:12

size of course it doesn't leak any

play38:14

information none of our hashes leak any

play38:16

information and every depositor can

play38:19

prove that their deposit exists by just

play38:21

proving the path from the route to their

play38:24

deposit so that's fine and when we say

play38:27

each deposit can be withdrawn at most

play38:29

once that's also easy because uh

play38:33

the the London Branch can basically keep

play38:36

track of the hashes of all the deposits

play38:38

that have already been paid out and you

play38:41

don't pay out for the same hash more

play38:43

than once or you can keep track of the

play38:45

paths that have been paid out and you

play38:47

don't pay for the same paths more than

play38:49

once in any case it's easy to keep track

play38:52

of these

play38:55

things okay

play38:58

but we still have another problem and

play39:00

this is a problem that we will solve in

play39:03

future sessions and the problem is that

play39:06

this is not in real time right so in

play39:09

order to create this whole tree I need

play39:12

to know all of my transactions so the

play39:15

way this actually works is that on day

play39:19

one in the morning everyone goes to the

play39:21

Hong Kong branch and deposits their

play39:23

money and gives their nonsense and

play39:25

everything and then after all the

play39:27

deposits are done only then the Hong

play39:30

Kong Branch can create that tree the

play39:32

miracle tree so they create the Merle

play39:35

tree they send the hash of the root to

play39:37

the London Branch but again only after

play39:41

they have created the Merle tree they

play39:42

can give the proofs to the

play39:44

clients so when the client makes a

play39:47

deposit they're not going to get a proof

play39:49

immediately they're going to have to

play39:51

wait until everyone else does their

play39:53

deposits too and then only at the end of

play39:56

the the day they each get their

play39:59

proof okay so we have this problem

play40:05

here

play40:09

now let's forget about our use case and

play40:11

let's just focus on Miracle

play40:13

trees so we saw how we can prove that a

play40:17

particular item is in the leaf of a

play40:19

miracle tree I can just start at the

play40:22

root prove the

play40:23

pass what if I want to prove that the

play40:25

particular item is not in the Merle

play40:29

tree can I give those kinds of

play40:34

BS so right now it seems

play40:37

impossible right because I mean how can

play40:40

you prove that something is not there

play40:42

unless you know everything unless you

play40:44

can prove every single element that is

play40:47

there if you know all of the hashes uh

play40:51

at every level and if you know D1 D2 D3

play40:53

and D4 you can prove everything that is

play40:56

in there and then you can say nothing

play40:57

else is there right but in general if I

play41:01

give you some other number D5 and I ask

play41:04

you is D5 in this tree or not there is

play41:08

no way you can give a short proof that

play41:10

D5 is not in the tree but we can solve

play41:13

that by a very nice trick and this is

play41:17

what we call ass sorted mle

play41:23

tree so the idea in a sorted tree is

play41:26

that I'm just going to create a miracle

play41:29

tree but when it comes to the leaves

play41:31

when it comes to the data Le I'm going

play41:34

to sort

play41:36

those okay so I'm going to have the

play41:39

exact same thing as

play41:41

here let me see if I can just copy

play41:55

this I'm going to have the exact same

play41:59

thing now it's going to be

play42:04

sorted so it means that D1 is going to

play42:07

be less than D2 less than D3 less than

play42:11

D4 and in general I can do this with n

play42:14

of

play42:15

course now why does this sorting

play42:18

actually help

play42:21

me well first of all how do I sort

play42:24

strings I can just sort them in lexical

play42:26

graphic order so even if you think of

play42:29

these not as numbers but as just

play42:32

sequences of zeros and ones you can sort

play42:34

them anyway so we have an

play42:37

order and

play42:39

now let's think of them as numbers for a

play42:41

second because for this example it's

play42:43

easier to do with numbers let's say D1

play42:46

is two D2 is five D3 is 8 and this one

play42:51

D4 is 10

play42:53

let's and suppose that I want to prove

play42:56

that's there is no six in

play42:59

here how can I prove it well I can just

play43:02

prove the existence of D2 and D3 I can

play43:05

just prove the existence of five and

play43:06

eight because when I prove the existence

play43:09

of five and eight I'm not just proving

play43:12

that they exist in the tree I'm also

play43:14

proving their location in the tree so if

play43:17

I prove that five is here which I can do

play43:21

and I can give a proof of uh length

play43:23

login and then if I can also prove that

play43:26

8 is

play43:28

here because I've also proven the

play43:31

location I've proven that 8 comes

play43:34

exactly after five which means that

play43:36

there is no six there is no

play43:38

seven right so this is how we can prove

play43:41

that a particular value does not exist

play43:44

in a miricle tree if I just sort all of

play43:47

my values and if I just prove the

play43:49

previous value and the next

play43:52

value

play43:54

okay but now of course

play43:56

the next problem and what I want you to

play43:58

think about is that suppose I want to

play44:01

prove that a particular value is not in

play44:03

my tree but I also don't want to leak

play44:07

information right because here I have a

play44:10

problem and the problem I have is that I

play44:12

wanted to prove that six is not in my

play44:15

tree but then in order to do that I had

play44:18

to prove that five and eight are

play44:20

actually in my tree but that's leaking

play44:23

five and eight that's leaking some

play44:26

information uh and maybe I don't want to

play44:28

do that maybe I just want to prove that

play44:30

a particular number is not in the tree

play44:33

but I don't want to leak any information

play44:35

about the numbers or the datas that are

play44:37

actually in the tree can I do

play44:48

that yeah so the idea

play44:52

is yes exactly so instead of sorting

play44:56

based on the D's let's just sort the

play44:58

L's let's just sort based on the

play45:01

hashes right and then when I want to

play45:04

prove that a particular item is not

play45:06

there I just take its hash and then I

play45:08

prove the previous hash and the next

play45:10

hash and that proves that this

play45:12

particular hash is not there and when

play45:14

the hash of this item is not there that

play45:16

item is also not right so that's pretty

play45:22

easy uh yeah but in general this is like

play45:26

a factor of

play45:28

two well not a factor of two ex it's a

play45:31

little bit worse than just proving the

play45:33

existence of something because now I

play45:35

have to prove the existence of two

play45:37

things so if I just wanted to prove the

play45:40

existence of eight I have to provide R

play45:44

B2 B1 L3 and L4 but now for five I have

play45:49

to prove R V1 V2 L1 and L so actually in

play45:53

this particular case again because my is

play45:55

really shallow in order to prove that

play45:58

500 I have to

play46:04

Pro

play46:06

okay now here's a problem that I want

play46:10

you to think

play46:12

about suppose that I want to play Rock

play46:15

Paper

play46:16

Scissors but I want to play it over the

play46:18

Internet so this is just something to

play46:23

think about rock paper scissors this was

play46:25

actually the homework in the last uh

play46:28

offering of this course but I'm not

play46:30

going to use the same homework again so

play46:33

I'm just going to give it to you let's

play46:35

say that I have two players Alice and

play46:39

Bob and let's say they have access to

play46:42

the

play46:44

internet so let's say they're on a group

play46:46

chat and everyone else can also see what

play46:49

messages they're

play46:51

sending uh so they cannot fake messages

play46:54

and they cannot also hide the messages

play46:56

that they have already sent but let's

play46:58

say they want to play Rock Paper

play47:01

Scissors now in the real world the way

play47:04

we do this is by forcing them to move at

play47:07

the same

play47:08

time right but if I just have a group

play47:12

chat on let's say WhatsApp I can't do

play47:14

that because even if I give them a very

play47:17

particular time if I say you have to

play47:19

write rock or paper or scissors exactly

play47:22

at

play47:23

1250 it might be that Bob is cheating

play47:26

and he just has a script that Waits For

play47:28

Alice to write the answer and as soon as

play47:30

she writes the answer Bob takes that

play47:32

answer calculates what would make him

play47:35

win and immediately outputs that so if

play47:38

Alice is playing Rock Bob would

play47:39

immediately play paper and you cannot

play47:42

tell the difference between this kind of

play47:44

cheating and just basic Network

play47:47

lag right so the question now is how can

play47:52

we play Rock Paper Scissors in a secure

play47:55

way in the sense that we want to make

play47:57

sure neither side can

play48:02

cheat okay and actually I want you to

play48:05

think how this relates to the example of

play48:08

the auction that we saw before because

play48:10

in some sense you can also think of an

play48:12

auction as a game and the idea there was

play48:15

that you should also move before knowing

play48:17

your opponent's

play48:19

move and here it's exactly the same

play48:21

problem so I have to make sure that

play48:23

Alice moves before knowing what Bob

play48:25

wants to do and I have to also make sure

play48:28

that Bob moves before knowing alysis

play48:32

move okay so I'll see you

play48:37

tomorrow

Rate This

5.0 / 5 (0 votes)

Related Tags
金融安全隐私保护加密货币Merkle树防止双重支付数据结构网络安全区块链技术银行业务技术解析
Do you need a summary in English?