Zcash中的commitment
1. 引言
commitment scheme为a function,其输入为:
- random commitment trapdoor r r r
- input value s s s
其输出为:
- commitment c m cm cm
commitment scheme 的属性有:
- hiding属性,即不知道 r r r的情况下,不会泄露任何 s s s的信息
- binding属性,即已知 r 和 s r和s r和s,可验证 ( r , s ) (r,s) (r,s)为该commitment的opening,而不能将其open为不同的值。
在Sapling中,额外定义了两个commitment scheme:
- N o t e C o m m i t S a p l i n g NoteCommit^{Sapling} NoteCommitSapling,对应为”Windowed Pedersen commitments“。
- V a l u e C o m m i t S a p l i n g ValueCommit^{Sapling} ValueCommitSapling,对应为”Homomorphic Pedersen commitments“。
2. Windowed Pedersen commitments
注意,其中 s s s为待commit的消息, r r r为random blinding factor,Windowed Pedersen commitments中引入了 P e d e r s e n H a s h T o P o i n t ( " Z c a s h _ P H " , s ) PedersenHashToPoint("Zcash\_PH",s) PedersenHashToPoint("Zcash_PH",s)函数来commit 。
对 n = ( d , p k d , v , r c m ) \mathbf{n}=(d, pk_d, v, rcm) n=(d,pkd,v,rcm) Sapling note的commit计算方式为:
- g d = D i v e r s i f y H a s h S a p l i n g ( d ) g_d=DiversifyHash^{Sapling}(d) gd=DiversifyHashSapling(d)
- 若 g d g_d gd为无效point,则返回 ⊥ \perp ⊥;否则返回 N o t e C o m m i t r c m S a p l i n g ( r e p r J ( g d ) , r e p r J ( p k d ) , v ) NoteCommit_{rcm}^{Sapling}(repr_{\mathbb{J}}(g_d),repr_{\mathbb{J}}(pk_d),v) NoteCommitrcmSapling(reprJ(gd),reprJ(pkd),v)
Windowed Pedersen commitment的计算效率很高,但是不支持同态属性。
在
M
e
r
k
l
e
C
R
H
S
a
p
l
i
n
g
MerkleCRH^{Sapling}
MerkleCRHSapling中也定义了类似的
P
e
d
e
r
s
e
n
H
a
s
h
T
o
P
o
i
n
t
PedersenHashToPoint
PedersenHashToPoint函数,只是其前缀有所不同。
3. Homomorphic Pedersen commitments
对于ValueCommit,需支持同态属性,此处采用Homomorphic Pedersen commitments:
参考资料
[1] Zcash Protocol Specification
Zcash中的commitment
1. 引言
commitment scheme为a function,其输入为:
- random commitment trapdoor r r r
- input value s s s
其输出为:
- commitment c m cm cm
commitment scheme 的属性有:
- hiding属性,即不知道 r r r的情况下,不会泄露任何 s s s的信息
- binding属性,即已知 r 和 s r和s r和s,可验证 ( r , s ) (r,s) (r,s)为该commitment的opening,而不能将其open为不同的值。
在Sapling中,额外定义了两个commitment scheme:
- N o t e C o m m i t S a p l i n g NoteCommit^{Sapling} NoteCommitSapling,对应为”Windowed Pedersen commitments“。
- V a l u e C o m m i t S a p l i n g ValueCommit^{Sapling} ValueCommitSapling,对应为”Homomorphic Pedersen commitments“。
2. Windowed Pedersen commitments
注意,其中 s s s为待commit的消息, r r r为random blinding factor,Windowed Pedersen commitments中引入了 P e d e r s e n H a s h T o P o i n t ( " Z c a s h _ P H " , s ) PedersenHashToPoint("Zcash\_PH",s) PedersenHashToPoint("Zcash_PH",s)函数来commit 。
对 n = ( d , p k d , v , r c m ) \mathbf{n}=(d, pk_d, v, rcm) n=(d,pkd,v,rcm) Sapling note的commit计算方式为:
- g d = D i v e r s i f y H a s h S a p l i n g ( d ) g_d=DiversifyHash^{Sapling}(d) gd=DiversifyHashSapling(d)
- 若 g d g_d gd为无效point,则返回 ⊥ \perp ⊥;否则返回 N o t e C o m m i t r c m S a p l i n g ( r e p r J ( g d ) , r e p r J ( p k d ) , v ) NoteCommit_{rcm}^{Sapling}(repr_{\mathbb{J}}(g_d),repr_{\mathbb{J}}(pk_d),v) NoteCommitrcmSapling(reprJ(gd),reprJ(pkd),v)
Windowed Pedersen commitment的计算效率很高,但是不支持同态属性。
在
M
e
r
k
l
e
C
R
H
S
a
p
l
i
n
g
MerkleCRH^{Sapling}
MerkleCRHSapling中也定义了类似的
P
e
d
e
r
s
e
n
H
a
s
h
T
o
P
o
i
n
t
PedersenHashToPoint
PedersenHashToPoint函数,只是其前缀有所不同。
3. Homomorphic Pedersen commitments
对于ValueCommit,需支持同态属性,此处采用Homomorphic Pedersen commitments:
参考资料
[1] Zcash Protocol Specification