-
Notifications
You must be signed in to change notification settings - Fork 16
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
Improve Proof building tool #229
Commits on Aug 24, 2022
-
remove unnecessary StakeSigner
In the previous Proof format, the stake key used to sign the proofid, which depended on the whole list of stakes. So we needed to keep a list of stake signers, and sign the stake only when they were all added. The new proof format is now designed to allow adding new stakes to an existing proof without requiring all the stake signatures to be updated. The stake key no longer signs all the other stakes. We can now sign the stakes as soon as they are added.
Configuration menu - View commit details
-
Copy full SHA for 0feff0b - Browse repository at this point
Copy the full SHA 0feff0bView commit details -
rename Proof.stakes to Proof.signed_stakes, to remove any ambiguity
There is a Stake and a SignedStake object. This makes it clear that the list contains the latter.
Configuration menu - View commit details
-
Copy full SHA for f094998 - Browse repository at this point
Copy the full SHA f094998View commit details -
implement ProofBuilder.from_proof
This allows to create a proofbuilder with exact same parameters and same existing stakes, and than add more stakes. The master private key must be provided again, as only the corresponding public key is available in the proof. Add a test (test result generated using the node buildavalancheproof RPC).
Configuration menu - View commit details
-
Copy full SHA for 0cbf200 - Browse repository at this point
Copy the full SHA 0cbf200View commit details -
add methods to verify signatures in SignedStake and Proof
Add also a stake_commitment attribute to the `Proof` class, so it is easy to verify the stakes in that proof.
Configuration menu - View commit details
-
Copy full SHA for 65d7249 - Browse repository at this point
Copy the full SHA 65d7249View commit details -
add a test for the address to/from payout_script conversion
This adds sanity checks to ensure the current code and tests are good, before changing the ProofBuilder to take an address rather than a script in the next commit.
Configuration menu - View commit details
-
Copy full SHA for 59b1329 - Browse repository at this point
Copy the full SHA 59b1329View commit details -
make the proof builder take an Address instead of an output script
This is in line with the buildavalancheproof RPC. If we ever need to support arbitrary scripts or pubkeys in the future, it is already possible using a ScriptOutput or a PublicKey object, even though the "payout_address" name does not really reflect this (fixme).
Configuration menu - View commit details
-
Copy full SHA for 6c01889 - Browse repository at this point
Copy the full SHA 6c01889View commit details -
[Proof editor] move code to add utxo to separate method
Instead of passing utxos to the widget's __init__, add utxos using a dedicated method. This will enable adding additional coins once the widget is already built.
Configuration menu - View commit details
-
Copy full SHA for 70bdc2f - Browse repository at this point
Copy the full SHA 70bdc2fView commit details -
[Proof editor] refactor dialog to pass utxos with a dedicated method
This allows to remove the weird overloading of exec_ and the special do_execute flag, as we no longer need to test the utxos in __init__. Also rename AvalancheProofWidget to AvalancheProofEditor
Configuration menu - View commit details
-
Copy full SHA for b7d48cf - Browse repository at this point
Copy the full SHA b7d48cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for ce2f0d8 - Browse repository at this point
Copy the full SHA ce2f0d8View commit details -
[Proof editor] add a checkbox to disable proof expiration
Disabling the expiration time will cause it to be 0 in the proof. The calendar and timestamp combobox will be disabled.
Configuration menu - View commit details
-
Copy full SHA for a412882 - Browse repository at this point
Copy the full SHA a412882View commit details -
[Proof editor] add an "Add coins" button
This loads coins from a json file.
Configuration menu - View commit details
-
Copy full SHA for c53eec7 - Browse repository at this point
Copy the full SHA c53eec7View commit details -
[proof builder] add a method to add a stake when there is a signature…
… available This is useful for adding stakes extracted from an existing proof, without need to find the private key again and redo the signature. This will be especially useful when building proofs collaboratively, with different wallets adding their stakes to a proof templates, and later merging the proof in a master wallet that does not have the utxo keys.
Configuration menu - View commit details
-
Copy full SHA for 5c37d1e - Browse repository at this point
Copy the full SHA 5c37d1eView commit details -
[Proof editor] implement load proof in proof editor
This implements loading an existing proof.
Configuration menu - View commit details
-
Copy full SHA for f12491a - Browse repository at this point
Copy the full SHA f12491aView commit details -
[proof builder] add a sign_and_add_stake method
It makes more sense than the add_utxo method which has basically weak typing for parameters.
Configuration menu - View commit details
-
Copy full SHA for 019e2cc - Browse repository at this point
Copy the full SHA 019e2ccView commit details -
[proof editor] Don't fail on proofs with no stakes
We want to be able to build proofs with no stake to be used as proof templates for other wallets to load and stakes.
Configuration menu - View commit details
-
Copy full SHA for f92e3ba - Browse repository at this point
Copy the full SHA f92e3baView commit details -
[proof editor] don't load coins with no block height at all
Previously we loaded them to show them in red in the utxo table, and later ignored them when building the proof. Excluding them early is easier, and will allow storing Stake objects directly instead of vaguely defined dictionaries.
Configuration menu - View commit details
-
Copy full SHA for 8377fdc - Browse repository at this point
Copy the full SHA 8377fdcView commit details -
[proof editor] store SignedStake or Stake + Key internally
This removes boilerplate code attempting to analyze the dict objects used previously. Now, the dict object will only be used initially when loading coins from a file or building from coins in this wallet, and it will be converted internally into a Stake + Key (we need to wait for the rest of the proof data to be final before signing the stake). Remove also the coin freezing feature on proof building. The coins will likely not belong to the wallet building the proof.
Configuration menu - View commit details
-
Copy full SHA for 16356b2 - Browse repository at this point
Copy the full SHA 16356b2View commit details -
[Proof editor] change "build proof from coins file" action into "Aval…
…anche proof editor" The new workflow is not to open the proof editor, then click the "load coins" button.
Configuration menu - View commit details
-
Copy full SHA for b4b20be - Browse repository at this point
Copy the full SHA b4b20beView commit details -
[proof editor] add a save proof button
This saves a proof to file, in hexadecimal text format. Also change the buttons layout to be horizontal below the proof display. Also use a regular button for the "generate delegation" button. The link looks weird.
Configuration menu - View commit details
-
Copy full SHA for 0feb66e - Browse repository at this point
Copy the full SHA 0feb66eView commit details -
[Proof builder] enable building proof without master private key (wit…
…h invalid sig) This changes the proof builder to make it accept a master pub instead of a master private key. The resulting signature will be invalid. This is to allow people to add signed stakes to a proof without knowledge of the master key. Such an invalid proof can be used to gather stakes from multiple users, and merge all the proofs in the master wallet (who can then produce a correct signature).
Configuration menu - View commit details
-
Copy full SHA for 9cfb368 - Browse repository at this point
Copy the full SHA 9cfb368View commit details -
[Proof editor] allow building of proof when private key is not available
In such a case, if the public key is available, a proof can be produced with an invalid signature. This is useful for gathering signed stakes in invalid proofs (from other wallets) and later merging the resulting proofs in the master wallet.
Configuration menu - View commit details
-
Copy full SHA for 4cac6cd - Browse repository at this point
Copy the full SHA 4cac6cdView commit details -
[Proof editor] add a merge stakes buttons
This should enable merging proofs with identical stake commitment data (master key and expiration time) but different stakes. The use case is: - a master wallet creates a proof template with no stakes (but all other data otherwise correct) and save it to a .proof file - multiple other wallets load this proof and add signed stakes to it from coin files, and save the result to a .proof file. - the master wallet loads one of the proof files (possibly the initial template), and then merge the stakes from all other files.
Configuration menu - View commit details
-
Copy full SHA for 51c117f - Browse repository at this point
Copy the full SHA 51c117fView commit details -
[Proof editor] replace "ok" and "dismiss" buttons by single "Close" b…
…utton There is no need for a "reject" status for these dialogs for now, they are pretty independant from the main window.
Configuration menu - View commit details
-
Copy full SHA for 00a0f0c - Browse repository at this point
Copy the full SHA 00a0f0cView commit details -
[Proof editor] improve warnings when generating a proof without a pri…
…vate master key Creating an unsigned proof is a standard procedure when signing the stakes with a different wallet, for the proof to be signed again later in the master wallet. So make the warnings less alarming, mention that it is OK to just sign stakes.
Configuration menu - View commit details
-
Copy full SHA for c58bfaa - Browse repository at this point
Copy the full SHA c58bfaaView commit details -
[Proof editor] add information about signatures status
Print good signatures in green, bad signatures in red. Add labels indicating the status of signatures below the proof display.
Configuration menu - View commit details
-
Copy full SHA for d897cf2 - Browse repository at this point
Copy the full SHA d897cf2View commit details -
[Proof editor] add option to load a proof from string
In the proof editor, the "load proof" button now load a dialog accepting a copy-pasted string or loading from a .proof file. In the delegation tool, there is now a button "Load from file" to open a .proof file.
Configuration menu - View commit details
-
Copy full SHA for fce829b - Browse repository at this point
Copy the full SHA fce829bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 03fd29f - Browse repository at this point
Copy the full SHA 03fd29fView commit details -
[Proof editor] fix rich text proof
In the serialization, I forgot to encode the number of stakes and the pubkey length. Fix this and add an assertion to avoid regressions.
Configuration menu - View commit details
-
Copy full SHA for 991ae5f - Browse repository at this point
Copy the full SHA 991ae5fView commit details -
[Proof editor] add "-unsigned" to the default proof filename when app…
…licable When signing stakes in a different wallet than the wallet controlling the master key, the proof signature will be all 0s. Reflect this in the file name when saving the proof, to help with managing the files during the multi-step signing procedure.
Configuration menu - View commit details
-
Copy full SHA for 9e48764 - Browse repository at this point
Copy the full SHA 9e48764View commit details