新团队不透露配方怎么办_您如何证明自己知道答案,却不透露答案?

探讨了零知识证明的概念,这是一种允许某人在不泄露任何额外信息的情况下,证明自己知道某个秘密或解的能力。文章通过一个数学问题的场景,详细解释了如何使用加密配对和椭圆曲线在区块链中实现匿名交易。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

新团队不透露配方怎么办

As a teacher you mark your student’s work, but where they give away the answer each time. So can we find a method to prove that a student has finished their coursework, without them telling you the answer. So let’s say we have Peggy the student and Victor the teacher. Victor sets Peggy a problem:

作为老师,您会标记学生的工作,但是他们每次都会给出答案。 因此,我们可以找到一种方法来证明学生已完成课程,而无需他们告诉您答案。 假设我们有学生Peggy和老师Victor。 维克多给佩吉设置了一个问题:

“Prove to me that you know the value of x for x²+5x-150=0, but don’t tell me the answer!”

“向我证明,您知道x对于 x²+ 5x-150 = 0的值,但请不要告诉我答案!”

Peggy scratches her head. She knows that x²+5x-150=0 is (x-15)(x+10)=0, and can solve this for x=15 or x=-10. But she cannot tell Victor the answer. Well, she needs to create a proof of correctness.

佩吉挠了挠头。 她知道x²+ 5x-150 = 0是(x-15)(x + 10)= 0,可以解决x = 15或x = -10的问题。 但是她无法告诉维克多答案。 好吧,她需要创建正确性证明。

Here is the proof for x=10, x²+5x-150=0:

这是x = 10,x²+ 5x-150 = 0的证明:

How do we do it? Well, crypto pairing for zero-knowledge proofs supports this.

我们该怎么做呢? 好吧,零知识证明的加密配对支持这一点。

零知识证明 (Zero-knowledge Proofs)

We give away too much of our data. Why should we give away our password every single time that we log into a system. Why can’t we just prove that we still know it? Thus Victor (the verify) can prompt Peggy (the prover) with a puzzle, and where she can show that she can solve it. This is the method that zero knowledge proof (ZKP) uses to prove things. In this case we will use the method used by zk-SNARKs to prove that we still know a secret. This method is used in blockchain methods to anonymise transactions. In this we use the pairing property (e()) of:

我们放弃了太多数据。 为什么每次登录系统时都应该放弃密码。 为什么我们不能仅仅证明我们仍然知道呢? 这样,维克多(验证者)可以提示佩吉(证明者)一个难题,并在哪里可以证明自己可以解决难题。 这是零知识证明(ZKP)用来证明事物的方法。 在这种情况下,我们将使用zk-SNARK所使用的方法来证明我们仍然知道秘密。 此方法在区块链方法中用于匿名交易。 在此,我们使用以下项的配对属性(e()):

e(aU,bV) = e(U,abV) = e(U,V)^{ab} = e(bU,aV)

e(aU,bV)= e(U,abV)= e(U,V)^ {ab} = e(bU,aV)

First we have two elliptic curves (G1 and G2). Crypto pairs can then be used to prove that Peggy still knows a secret. For this we may have a quadratic equation of:

首先,我们有两条椭圆曲线( G 1和G 2)。 然后可以使用加密对来证明Peggy仍然知道一个秘密。 为此,我们可能有一个二次方程式:

x²+5x−150=0

X 2 + 5×-150 = 0

Then, we will ask Peggy to prove that she knows the value of x. In this case, the solution is x=15 or x=−10. Now Peggy has to pass something to Victor to prove that she knows the solution, without giving away the value.

然后,我们将要求Peggy证明她知道x的值。 在这种情况下,解为x = 15或x = −10。 现在,佩吉(Peggy)必须传递一些东西给维克多(Victor),以证明她知道解决方案,而没有付出任何价值。

For this we have a point on an elliptic curve of G, and use the pairing property of (and where e() is the pairing function):

为此,我们在G的椭圆曲线上有一个点,并使用的配对属性(其中e()是配对函数):

e(G,G)^k=1

e( GG )^ k = 1

and thus:

因此:

e(G,G)^{x²+5x−150}=1

e( GG ) ^ { x²+ 5 x −150} = 1

In pairing this then becomes:

在配对中,它变为:

e(G,G)^{x2^} (G,G)^{5x} e(G,G)^{−150}=1

e( GG ) ^ {x 2 ^}( GG )^ {5 x } e( GG )^ {− 150} = 1

and which becomes:

变成:

e(xG,xG) e(xG,5G) e(G,−150G)=1

e( xGxG )e( xG ,5 G )e( G ,−150 G )= 1

Peggy will then provide xG and Victor will check the pairings multiplied equals unity. If real life x will be a large value, and it will not be possible to determine x from xG.

然后,Peggy将提供xG,而Victor将检查配对乘以等于1的配对。 如果现实生活中的X将是一个较大的值,这将是不可能的从X G.确定X

The outline coding using the library from the gsnark library [here] is:

使用来自gsnark库[ 这里 ]的库的轮廓编码是:

A sample run is [here]:

样本运行在[ 这里 ]:

-12 =x^3 + (-3) x + (-10) when x= 1Proof: &{{[2675658996782286732 8914725834961326762 13447480635561102629 17946381993026357171 13999854648367502125 45984963968108606] [12436099469856088005 9476267384122043601 1473904065594197110 1856969899058675802 8558075317656655462 120264009124913042]} {[13009199714519461133 11144420394545007472 9518163973024256862 17990757860837992915 9557229965428639720 14442379772686021] [6958436928058547774 7115083387299807185 17495458330385439451 10656561640959987832 1331293918824267611 54193300516895449]} {{[516848653940528355 9960425841574927652 5302473275361053517 457295650691531379 9736863588490620470 60884129589037391] [8737861606191359736 9146941305537024805 7734269607322910088 1455444471768871536 11061844635811516102 26691571454434682]} {[6598268733689889709 14849969620105935699 135189537366654044 4091349966081677994 7668200215144098765 48853293321301083] [12438266814412970556 13981091221663188431 15767719380617845524 3596523800781485162 1624406842663105729 45539061396846750]}}}
Verified: true

If we try an incorrect value, such as x=5, we get a not proven result:

如果尝试输入不正确的值(例如x = 5),则会得到未经证实的结果:

-13 =x^3 + (-3) x + (-10) when x= 1No proof!

结论 (Conclusions)

We have many things in life where we have to prove things, but we perhaps give away too much of our data, so crypto pairing comes to our rescue.

我们生活中有很多事情需要证明,但是我们可能会遗漏太多数据,因此加密配对可以为我们提供帮助。

翻译自: https://medium.com/asecuritysite-when-bob-met-alice/how-do-you-prove-you-know-the-answer-without-revealing-the-answer-40f5b7cbda54

新团队不透露配方怎么办

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值