ZCash, Monero, 以及所有基于CryptoNote的coins,都支持confidential transactions 隐私交易。
1.1 Bitcoin transactionBitcoin transaction的结构为: ( { a i } , { b i } , { v i } ) (\{a_i\},\{b_i\},\{v_i\}) ({ai},{bi},{vi}),其中 { a i } \{a_i\} {ai}为input addresses, { b i } \{b_i\} {bi}为output addresses, { v i } \{v_i\} {vi}为the amounts that go to each output。
在Bitcoin中,each transaction appears unencrypted for the whole world to see in the public ledger,使得比特币中的交易容易被跟踪,even when the coins go through multiple owners。解决交易跟踪问题的方式可为:
- 使用tumbler:takes in Bitcoin from many sources, mixes them around, and hands back some fresh uncorrelated coins。(类似于money laundering)
- confidential transaction:仅允许交易的参与方看见 v i v_i vi values,而对于其他非参与方均隐藏不可见。同时要求非参与方能够发现伪造的交易的。(don’t want a user to be able to print money by spending more than they actually have.)对于非参与方,account contents和output values都是保密的secret,怎么来验证交易是有效的呢? ⇒ \Rightarrow ⇒ 需要用到的技术主要有: ** Schnorr Signature。 ** AOS Ring Signature。 ** Borromean Ring Signatures。 ** Pedersen Commitments。 ** Hiding Transaction Amounts。 ** Rangeproofs。
详细可参见博客 ECDSA VS Schnorr signature VS BLS signature 第2节内容。
主要内容为:
- an abelian group G \mathbb{G} G of prime order q q q with generator G G G.
- public key P = x G P=xG P=xG, where x ∈ Z q x\in\mathbb{Z}_q x∈Zq is secret key。
- hash function H : { 0 , 1 } ∗ → Z q H:\{0,1\}^*\rightarrow \mathbb{Z}_q H:{0,1}∗→Zq.
- message to be signed M ∈ { 0 , 1 } ∗ M\in\{0,1\}^* M∈{0,1}∗
Schnorr 签名过程为:
- 选择随机数 a ← Z q a\leftarrow \mathbb{Z}_q a←Zq,设置 Q = a G Q=aG Q=aG;
- 计算 e = H ( Q ∣ ∣ M ) e=H(Q||M) e=H(Q∣∣M)
- 计算 s = a − e x s=a-ex s=a−ex
- 发送Schnorr signature σ = ( s , e ) \sigma=(s,e) σ=(s,e)
Schnorr验签过程为:
- 计算 Q = s G + e P Q=sG+eP Q=sG+eP
- 验证 e = H ( Q ∣ ∣ M ) e=H(Q||M) e=H(Q∣∣M)是否成立。
confindential transactions底层使用的签名机制为ring signatures。ring signature 与普通签名类似,除了: a ring signature of the message m m m over the public keys { P 1 , P 2 , ⋯ , P n } \{P_1,P_2,\cdots,P_n\} {P1,P2,⋯,Pn} proves that someone with knowledge of one of the private keys { x 1 , x 2 , ⋯ , x n } \{x_1,x_2,\cdots,x_n\} {x1,x2,⋯,xn} has seen the message m m m。 普通签名为ring signature n = 1 n=1 n=1的特例。
ring signature的主要目的是: 隐藏实际进行签名的private key,具有signer ambiguity特性。(not reveal which private key it was that performed the signature.)
Abe,Okhubo,Suzuki 2002年论文《1-out-of-n Signatures from a Variety of Keys》中所构建的ring signature是Schnorr Signautre的generalization。
3.1 AOS Ring Signatures签名过程假设 n n n 个 public keys { P 0 , P 1 , P 2 , ⋯ , P n − 1 } \{P_0,P_1,P_2,\cdots,P_{n-1}\} {P0,P1,P2,⋯,Pn−1} 中,签名方实际仅知道 P j P_j Pj的私钥 x j x_j xj,即该签名方实际仅能用 x j x_j xj对消息 M ∈ { 0 , 1 } ∗ M\in\{0,1\}^* M∈{0,1}∗进行签名。具体的AOS签名流程为:【注意下面的 j + 1 , i + 1 j+1,i+1 j+1,i+1等计算均做modulus n n n运算,保证实际下标不超过 n n n。】
- 随机数 a ← Z q a\leftarrow\mathbb{Z}_q a←Zq,计算 Q = a G , e j + 1 = H ( Q ∣ ∣ M ) Q=aG,e_{j+1}=H(Q||M) Q=aG,ej+1=H(Q∣∣M);
-
i
i
i的取值从
(
j
+
1
m
o
d
n
)
(j+1\mod n)
(j+1modn)开始,
f
o
r
(
i
=
(
j
+
1
m
o
d
n
)
;
0
≤
i
<
n
,
i
≠
j
;
i
+
+
)
for\ (i=(j+1\mod n);0\leq i< n,i\neq j;i++)
for (i=(j+1modn);0≤i
关注打赏
最近更新
- 深拷贝和浅拷贝的区别(重点)
- 【Vue】走进Vue框架世界
- 【云服务器】项目部署—搭建网站—vue电商后台管理系统
- 【React介绍】 一文带你深入React
- 【React】React组件实例的三大属性之state,props,refs(你学废了吗)
- 【脚手架VueCLI】从零开始,创建一个VUE项目
- 【React】深入理解React组件生命周期----图文详解(含代码)
- 【React】DOM的Diffing算法是什么?以及DOM中key的作用----经典面试题
- 【React】1_使用React脚手架创建项目步骤--------详解(含项目结构说明)
- 【React】2_如何使用react脚手架写一个简单的页面?