Skip to content

Commit 54adabd

Browse files
authored
Merge pull request #1037 from nuttycom/clarify_zip246_sighash_version_motivation
ZIP 246: Add motivation for sighash algorithm versioning.
2 parents ab8ca7d + c24b402 commit 54adabd

File tree

1 file changed

+44
-21
lines changed

1 file changed

+44
-21
lines changed

zips/zip-0246.rst

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,58 @@ field, as specified in section 7.1 of the Zcash protocol specification
3232
Abstract
3333
========
3434

35-
This ZIP defines the digest algorithms associated with the v6 transaction format.
36-
37-
This proposal also defines the new concept of "sighash versioning": where previously
38-
each transaction version had a single associated digest algorithm, going forward it
39-
will be possible for signers to use any digest algorithm within the closed set
40-
specified for a given transaction version (and made available in consensus via network
41-
upgrades).
35+
This ZIP defines the sighash algorithms associated with the v6 transaction
36+
format.
4237

38+
This proposal also defines the new concept of "sighash algorithm versioning":
39+
where previously each transaction version had a single associated sighash
40+
algorithm, going forward it will be possible for signers to use any sighash
41+
algorithm within the closed set specified for a given transaction version (and
42+
made available in consensus via network upgrades).
4343

4444
==========
4545
Motivation
4646
==========
4747

48-
TBD
49-
50-
TODO: Motivate sighash versioning
48+
The motivation for sighash algorithm versioning is that we want to be able to
49+
specify the V6 transaction format and signatures without knowing what the
50+
signatures for atomic swaps in action bundles will need to commit to. This
51+
allows for future signature hash algorithms to be specified for V6 transactions
52+
that support signing parts of a transaction while leaving the remainder of the
53+
transaction malleable, or that commit to additional state that nodes may start
54+
tracking in a future upgrade and that is not part of an individual transaction
55+
being signed.
5156

57+
Being able to remove support for sighash algorithm versions makes it possible
58+
to respond effectively in the case that a bug is found in a previously deployed
59+
sighash algorithm.
5260

5361
============
5462
Requirements
5563
============
5664

57-
- Continue to support existing functionality of the protocol (multisig,
65+
- Continue to support existing functionality of the protocol (e.g. multisig and
5866
signing modes for transparent inputs).
5967

60-
- It should be possible to update this ZIP with additional digest versions after the first
61-
version has been deployed in a network upgrade.
68+
- It should be possible to update this ZIP with additional sighash algorithm
69+
versions that might have divergent behavior with respect to previous
70+
versions, after previous versions have been deployed in network upgrades.
71+
72+
- It should be possible to disable support for sighash algorithm versions in
73+
network upgrades.
6274

75+
- At the time that one is making a signature, the set of valid sighash
76+
algorithm versions is known to consensus.
77+
78+
- Sighash version information is present alongside the signature.
6379

6480
================
6581
Non-requirements
6682
================
6783

68-
TBD
69-
84+
- Sighash algorithm versioning as defined in this ZIP does not need to
85+
constrain how signature hashes are constructed for future transaction
86+
versions.
7087

7188
=============
7289
Specification
@@ -79,21 +96,27 @@ Sighash versioning
7996
Rough summary:
8097

8198
- Sighash versions are numbered starting from 0 for each tx version.
82-
- v0 is by convention the "commit to everything" sighash digest. Other versions can commit to whatever makes sense for desired functionality within that tx version.
83-
- Have a single byte encoded alongside the signature (not appended the way transparent does) that permits the signer to specify which sighash version they are using.
84-
- Consensus rules choose the digest algorithm for each signer based on that byte.
99+
- v0 is by convention the "commit to all effecting data" sighash algorithm. Other
100+
versions can commit to whatever makes sense for desired functionality within
101+
that tx version.
102+
- Have a single byte encoded alongside the signature (not appended in the manner
103+
of transparent sighash types) that permits the signer to specify which sighash
104+
algorithm version they are using.
105+
- Consensus rules choose the digest algorithm for each signer based on that
106+
byte.
85107

86108
----------
87109
v0 Digests
88110
----------
89111

90-
The v0 digests are based on the v5 transaction digest algorithm defined in ZIP 244 [#zip-0244]_.
112+
The v0 digests are based on the v5 transaction digest algorithm defined in
113+
ZIP 244 [#zip-0244]_.
91114

92115
TxId Digest
93116
===========
94117

95-
The overall structure of the TxID digest is as follows; each name referenced here will either be
96-
referenced or described in detail below::
118+
The overall structure of the TxID digest is as follows; each name referenced
119+
here will either be referenced or described in detail below::
97120

98121
txid_digest
99122
├── header_digest *

0 commit comments

Comments
 (0)