mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-16 04:29:08 +00:00
e3ea32a986
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.
23 lines
683 B
JSON
23 lines
683 B
JSON
{
|
|
"bin_outputs": [
|
|
{
|
|
"amount": 200000000,
|
|
"decred_script_version": 0,
|
|
"script_pubkey": "bc76a914dc1a98d791735eb9a8715a2a219c23680edcedad88ac",
|
|
"decred_tree": 1
|
|
}
|
|
],
|
|
"expiry": 0,
|
|
"inputs": [
|
|
{
|
|
"decred_tree": 1,
|
|
"prev_hash": "569e3a8fe2354abd9ff309dc5f469dd091cbd1de6f394cc212be73fb52bb6fed",
|
|
"prev_index": 0,
|
|
"script_sig": "483045022100da17695ed60f17cc9e8a40d1199654a326e541ed77130983d5c281a21e4d743b022058420d3d905d542f290fd793176e02186e31ba8f294b52d922c5aad5ffd3d2c90121026233f32eb24b0571c703f9a89a7b581921f0379a8bca8f63fa23c033bafa0b48",
|
|
"sequence": 4294967295
|
|
}
|
|
],
|
|
"lock_time": 0,
|
|
"version": 1
|
|
}
|