您当前的位置: 首页 > 

mutourend

暂无认证

  • 1浏览

    0关注

    661博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

隐私交易基本原则

mutourend 发布时间:2020-06-19 17:00:23 ,浏览量:1

1. 引言

ZCash, Monero, 以及所有基于CryptoNote的coins,都支持confidential transactions 隐私交易。

1.1 Bitcoin transaction

Bitcoin 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。
2. Schnorr Signature

详细可参见博客 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)是否成立。
3. AOS Ring Signatures

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
关注
打赏
1664532908
查看更多评论
立即登录/注册

微信扫码登录

0.0513s