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
multi: Add decred staking. #1249
Conversation
c8d2649
to
3ff6b0f
Compare
f634060
to
4705f5e
Compare
1141224
to
35789da
Compare
183f8d4
to
dbf166d
Compare
I think this is where we want functionality as far as core is concerned. Of course we would also like this on legacy... Will try to keep it up-to-date with master. |
I've had a request for custom labels. I apologise but one more change incoming. |
@JoeGruffins after an internal discussion, we decided that we will not accept the "validate staking keys on Trezor" functionality at this time. Feel free to use the However, from the firmware point of view this is a hack: you're relying on a meaningful string for use as a key, which of course means that it can't ever be changed or translated, this would need to be hardcoded both in firmware and any wallets, the mechanism can be adapted but not cleanly reused for other similar usecases. It's a finicky solution at best. So at this time we won't be implementing or accepting the Trezor countepart, so it won't be possible to verify that the staking keys come from the same Trezor. Tagging for product decision, whether to: |
@matejcik Understood and accepted. In that case lets get this wrapped up! Will take one more good look at the tests, and I think that's it from my side, except for rebasing of course. Also, the initial commit's comment no longer reflects reality. |
Just going to put this here for recording purposes. I'm sure none of the devs have anything to do with this. |
is there more to resolve at this point? |
huh, except it is and github is being weird. |
Strange, I also had some problems with seeing that commit, so I squashed everything up to an including 20aa862 and rebased the branch over master. The rebase involved reworking the layouts code, so @matejcik you might want to look at that if you like, but it's probably not necessary. |
one last thing: a changelog entry is missing |
Add two new input and four output script types. Decred ticket purchases consist of a stake submission, op returns, and change addresses. Although change addresses are allowed by consensus, they are no longer used in practice and so have been given the restrictions of a null pubkey and no value. Stake scripts are almost identical to p2pkh or p2sh except for an extra opcode in front. Inputs are currently only used in the form of one input three outputs with the first output, or stake submission, paying to a public key hash, or with two inputs and five outputs with the stake submission paying to a multisig script hash. The op returns are directed to the user in the case of one and the voting service provider and user in the case of two. One of the sstx commitment for a ticket must pay back to the trezor wallet. This is checked and an error is thrown if we don't find the expected public key hash. Because this adds the ability to create new types of outputs once the ticket votes, two new input script types are also needed. A successful vote will lead to a stake generation script that must be spent, and an unsuccessful vote will lead to a revocation script that must be spent. If we allowed stake change scripts to have a valid pubkey, that too would require another op code, but we disallow those for output.
no QA needed - this is a 3rd party feature and we don't have any appropriate scenarios for it |
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add a function that can query trezor for deterministic bytes to be used as the seed for a voting xpriv. The method for retrieving deterministic private data was suggested by Trezor developers: trezor/trezor-firmware#1249 (comment)
Add two new input and four output script types.
Decred ticket purchases consist of a stake submission, op returns, and
change addresses. Although change addresses are allowed by consensus,
they are no longer used in practice and so have been given the
restrictions of a null pubkey and no value. Stake scripts are almost
identical to p2pkh or p2sh except for an extra opcode in front. Inputs
are currently only used in the form of one input three outputs with the
first output, or stake submission, paying to a public key hash, or with
two inputs and five outputs with the stake submission paying to a
multisig script hash. The op returns are directed to the user in the
case of one and the voting service provider and user in the case of two.
One of the sstx commitment for a ticket must pay back to the trezor
wallet. This is checked and an error is thrown if we don't find the
expected public key hash.
Because this adds the ability to create new types of outputs once the
ticket votes, two new input script types are also needed. A successful
vote will lead to a stake generation script that must be spent, and an
unsuccessful vote will lead to a revocation script that must be spent.
If we allowed stake change scripts to have a valid pubkey, that too
would require another op code, but we disallow those for output.