大咖专访:Conflux公链研究总监“杨光”现场解决实际技术问题

第一个问题是关于 Conflux 的

The first question about Conflux is:

Conflux 实验室环境的 TPS 峰值是 6000

Conflux can reach 6000 TPS under the testing environment,

现在说的是3000

but 3000 TPS is being said, then

具体是哪个数据为准

which of the two TPS-Numbers is more precise?

6000 多和 3000 的实验的测试环境是不一样的

The testing environments for 6000 and 3000 TPS are not the same!

6000 TPS的测试环境中

For the 6000 TPS testing environment,

每个节点的带宽是 40 Mbps

each node has a bandwidth of 40 Mbps

3000 的对应的是 20 Mbps

And for the 3000 TPS the bandwidth for each node is 20 Mbps.

但是因为我们认为实践中可能 40 Mbps

But we think that 40 Mbps bandwidth per node

相对来说是比较难达到的

are quite hard to realize in practice.

以现在的网络条件

And with the current network conditions

所以一般我们以 3000 TPS为准

we use 3000 TPS as our standard.

 

Conflux 可达到 4000—6000 的 TPS

Conflux can reach 4000 - 6000 TPS

区块确认时间为 4.5—7.4 分钟

With a block confirmation time of 4.5 - 7.4 minutes.

有声音认为正常的确认时间如果不出现分叉

Some might think that if there are no forks in the confirmation time

则必然会丢弃大量的有效交易

a large number of valid transactions will be discarded.

在这么长的延迟时间下谈高 TPS

Talking about high TPS with such a long delay

没有实际的应用价值

has no value for potential real-life applications.

首先丢弃大量有效交易

Discarding large amounts of valid transaction

这个是在比特币

Is something that can only be found in Bitcoin

或者其它采用最长链规则的区块链里面才会有的

or other public chains that use the Longest-Chain Rule.

但是我们会保留所有分叉的区块

But we keep all forked blocks

所以所有的交易都不会丢失

And therefore, all transactions stay and don’t disappear.

然后其次

ANd,

关于确认时间比较慢的问题

About the slow confirmation time!

这个用的数据是我们比较早的实验数据

The number is from our initial tests,

在当时我们采用了非常保守的五秒钟一个块

where we used a conservative average time of 5 seconds per block

所以确认时间是大概 4 分钟到 7 分钟左右

That resulted in a block confirmation time between 4 and 7 minutes.

但是现在我们在测试网上新的结果

But now on our test net,

是每秒钟出四个块

We can produce 4 blocks per second

就是出块的速度提高到 20 倍

Resulting in a time increase of 20 times

然后确认时间也可以缩短到 30 秒以内

And the block confirmation time can be shortened to under 30 seconds.

但这个还是关于区块的确认时间

But this is only about the block confirmation time.

实际上如果说我们考虑单笔交易的确认时间

If we consider the confirmation time of a single transaction in reality,

只要我们在相对一段时间内分叉的区块中

as long as we don’t find any conflicts of this one transaction

都没有和这个交易冲突的任何其它交易

with other transactions in forked blocks from a certain time period, 

那么即使这个区块的顺序有一定的变化

even if the sequencing of this block has some changes,

但这样一笔简单的交易

such a simple transaction

依然没有任何 冲突

will have no conflicts

依然会是有效的

and will be valid.

这种情况下我们经过分析

We have analyzed such a situation

其实还可以把确认时间再进一步的缩短

And can even shorten the confirmation time.

但这个需要就更复杂的分析以后

But this needs more complex analysis

才可以确定到底能到多短

To confirm to which extend the confirmation time can be reduced.

加密算法的抗冲突性如何

How is the collision resistance of the encryption algorithm?

加密算法的抗冲突性

The collision resistance of the encryption algorithm

并不是加密算法的设计指标之一

is not actually one of the design indicators for the encryption algorithm.

所以有一些算法可能会有抗冲突性

Therefore, only some algorithms might be able to achieve collision resistance,

但是这个并没有普遍的要求

but this has special needs!

比如说我们熟悉的一次一密的加密算法

For example, with the one-time pad algorithm

包括 AES 这样的加密算法

and even when we encrypt the algorithm, with let’s say AES, 

都是对冲突性没有任何抵抗能力的

the algorithm is not really resistant to conflict.

我们随便的就可以找到一个明文和密钥对

We can find a random plain text and pair it with a key

生成任何的一个密文

and form any encryption.

但是在有些场景下

But in some scenarios,

如果我们需要对加密的明文的完整性进行检验

if we need to do an integrity test on the completeness of the encrypted plain text

我们通常会用到一种叫做认证加密的算法

an algorithm called authentication encryption (AE) is usually used.

这个会比普通的加密算法要稍微复杂一点

This is a bit more complicated than normal encryption.

但基本的原理就是除了明文信息以外

The basics are: besides the plain text

我还要附带上一个明文消息的哈希值

we need to attach the hash of the plain text

然后把明文消息和哈希值放在一起进行加密

and then encrypt the plain text with the respective hash.

这样解密的时候

Like this, during the decryption process,

如果用不同的密钥解出来的

when using a non-corresponding key to decrypt

就不会在原来的明文的空间里边

the decrypted message will be totally different

因为解出来以后

because the hash of the decrypted plain text

对应的哈希值是对不上的

does not match the corresponding hash value.

所以这种情况下

So in this situation,

就可以保证很难找到一个冲突

finding a conflict of single transactions will be very hard.

这里抗冲突性还是通过哈希函数实现的

The collision resistance is realized the hash function

而不是通过加密算法本身

and not the encryption algorithm.

 

为什么一个好的哈希算法

So why does a good hash-algorithm

不允许攻击者找到两个产生相同哈希的消息

not allow the attacker to find two produced messages with the same hash function?

首先这个是密码学哈希算法的定义所要求的

This is the first requirement in Cryptography for hash algorithms

这也是密码学哈希算法最主要的目的

And is also the most important purpose of hash algorithms.

然后他们要做的就是让生成的哈希的结果

And then they need to ensure that the result of the generated hash

是非常难预测的

is very hard to predict.

因为难以预测

Because it is hard to predict

而且是不可逆的

and is irreversible due to it being asymmetric

所以就很难让攻击者找到两个不同的明文

it is very hard for the attacker to find two different plain texts

对应同样的哈希值

with the same hash value.

这样的话就可以把哈希值作为明文的一个代表

This way we can see the hash value being a representative of the plain text

然后去使用

and using it

会比较方便

will be easier.

 

如何将 AES 加密中使用的密钥

How to share a key with AES encryption 

与其它应用程序共享进行解密

with other applications for decryption?

这个共享的方式是有很多

There are many ways to share

当然最简单的共享方式是你把这个密钥

The easiest way to share is for you to copy

抄下来或者拷贝下来

or write down the key

然后以一个安全的方式传输给对方

and then use a safe method to send it to the opposite party.

这个安全的方式可以是一个已经加密的信道

This ‘safe method’ can be an already encrypted messaging channel

或者也可以是人线下

or offline

就是人肉去传输

meaning giving it to someone in person.

当然在线上传输的话

Of course, if it is transmitted online

可以用一些密码学

cryptography can be used.

主要是公钥密码学里

In Public-Key cryptography,

会有专门的密钥交换协议

there are so-called key exchange protocols.

用这样的协议大家就可以

These protocols allow multiple parties

在线上去产生一个双方共享的密钥

to generate a shared key by exchanging messages.

同时即便中间被人窃听

Furthermore, even if an eavesdropper 

你们交换的消息

has access to all the exchanged messages,

 这个密钥依然是安全的

the generated key remains secure (against the eavesdropper).

上一篇:Python绘制bezier曲线


下一篇:系统吞吐量、TPS(QPS)、用户并发量、性能测试概念和公式