-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PSET] Add Blinder role #45
Comments
Just a heads-up that we are in the process of revisiting the blinding portion of the PSET process. I'm very excited about the work being done here (used to work with Go a lot and I still like the language!), so I wouldn't want you guys to spend a lot of time on this only to have to redo some of the work later. I would suggest keep an eye on this issue: ElementsProject/elements#879 We're aiming to get a document out with the described new fields etc before we start implementing it in Elements itself, so that you guys know about the changes as soon as possible. |
Hello @stevenroose we merged our initial implementation already because we have couple of products/services that we need this library for. We will adapt in case there would be a any incompatibility. Also, a formal specification of the Blinder Role could help future implementers in other languages/stack too. You can take a look at the integration test in blinder_test.go for an high-level understanding of how it looks like, where a TX with confidential outputs is broadcasted. I will keep an eye on that issues btw |
The blinder role is responsible for taking an unsigned partial transaction (thus it needs to check that every partial input has a empty
PartialSignature
) with unblinded outputs and proceeds to make them confidential by replacing their asset and values with commitments and by adding a nonce, and range and surjection proofs.In this first version of the blinder role, we do not care about blinding issuance inputs since we do not support non-confidential issuance yet.
The process of blinding the outputs of a transaction is composed of the following steps:
1. Unblind tx inputs
First of all, we need to unblind every confidential utxo used as input of the transaction to get their asset/value commitments and blinding factors.
In order to accomplish this, every partial input must have a valid
WitnessUtxo
orNonWitnessUtxo
set, so that we can determine if the utxo it refers to is confidential by checking if it has a range and a surjection proof.Thus, to unblind all the confidential inputs we need the user to provide a list of valid blinding private keys.
Take a look at how this step is implemented in the liquid-js library.
2. Generate blinding factors
The second step is to create asset and value blinding factors for every tx output, except for the fee out that must be kept non-confidential (this output is recognizable because it's the only one in a tx that has an empty script).
Every asset blinding factor is generated randomly by a strong rng function.
Every value blinding factor except for one of the last output is generated randomly by a strong rng function.
The value blinding factor of the last output is generated by calling the
FinalValueBlindingFactor
function, passing the previously unblinded input assets/values and blinding factors, and passing also the output values and the just created random asset/value blinidng factors:Here you can see how this step is implemented in the liquid-js library.
3 Blind tx outputs
Now that we are ready, it's time to effectively blind all tx outputs.
Then, for every output, we create the asset and value commitments from the unblinded asset/value and the respective blinding factors we created before.
We create an ephemeral random private key we need for generating the range proof.
The public key derived from it is used as the output nonce.
Last, we create the range and surjection proofs, check this out for the implementation details for creating the proofs.
The text was updated successfully, but these errors were encountered: