The transaction amount is encrypted using Pedersen commitment with a random value r.
The amount is encrypted using the shared secret rA
and committed to in a Pederson commitment.
Amount encryption:
b = n xor8 Hs(“amount”|Hs(rA|i))
Where n
here denotes the unencrypted amount, rA
is the shared secret, i
is the output index, |
is concatenation, Hs
is hash to scalar and b
is the final encrypted amount.
Then the Pedersen commitment C
:
y = Hs(“commitment mask”|Hs(rA|i))
C = yG + bH
So one either needs r
or a
(private terms of the shared secret) and either R
or A
respectively, the public terms. R
is rG
, the tx public key and A
is the receivers public view key. Thus with a
(the receivers private key) and the tx public key R
, one can decode the amount. As can the sender as they have r
and A
. This is because rA == aR
.
Can I see the transaction amount if I only have the public view key?
No. You need some secret information, either r
or a
.
What is the relationship between view key and the random r value in Pedersen commitment?
See above.