-
Notifications
You must be signed in to change notification settings - Fork 219
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
fix: recover all known scripts #4397
fix: recover all known scripts #4397
Conversation
known_scripts[index].private_key.clone(), | ||
) | ||
} else { | ||
let key = PrivateKey::random(&mut OsRng); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of this. I understand it was in the previous PR, but surely there's no data needed for this? It's misleading to store a public key without storing the secret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean dont store the private key?
We do, its the script_key. For a Nop, the input stack will then be the public key of that private key.
So for Nop, which the else is, we store a random private key, as the script key(this is the key used to sign the input, aka script, aka K_s)
And then we store the input_data, that's required to "validly" claim the nop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I see it's saved in the db, I had missed that
* development: fix: recover all known scripts (tari-project#4397)
Description
This allows the wallet to recover all known scripts.
Motivation and Context
The wallet stores a list of all known scripts and inputs required to claim them.
This PR allows the wallet to use this lest when searching for outputs to recover.
Fixes: #4231