But if is constant and known (it is), couldn't someone just pre-calculate
for all reasonable values of and scan the blockchain for those public keys?
Basically, YES!, so we're not done yet.
We need to add randomness to each in/output to prevent a pre-image attack. The basic idea is to do this by adding a second private key to each output.
Input were given their private keys when they were outputs in a previous transaction.
So what if we rewrite the inputs and outputs as follows:
where is a generator on another (specially selected) EC.
This completely blinds the in- and outputs so that no pre-image attack is possible.
(And is called a Pedersen commitment).
Alice now builds a transaction like this:
Since in an honest transaction*
this becomes
*
We'll examine the case where someone is cheating and shortly.
and so we require
Alice sends Bob this transaction information (T1) and lets Bob know that his private
key must be . To prevent Alice from spending Bob's newly earned Tari, he
can choose a new blinding factor and rewrites the transaction as
Notice that the RHS is where is the sum of the transaction values.
The RHS is a valid key on if and only if *`, i.e. Alice has constructed
the transaction without cheating.
More generally, is the sum of all the blinding factors.
*
This is a consequence of how the curves and were selected initially.
Bob signs an empty string with which proves that he knows .This
signature is submitted for inclusion to the blockchain along with the transaction details.
A validator / node then only has to check that
There's still a flaw in this procedure though.
Alice could have spent a 1 Tari output, giving 2 to Bob, and -1 in change to herself,
thus creating 1 Tari out of thin air.
To prevent, this, Alice needs to provide a set of range proofs for each amount
she receives, proving that the (masked) values lie between 0 and (exclusive).
Similarly, Bob provides range proofs for the value he is receiving.
The details of these proofs are beyond the scope of this presentation. But some comments:
A MimbleWimble transaction includes the following: