Commit Graph

62 Commits

Author SHA1 Message Date
Daira Emma Hopwood 8ea921667d Daira Hopwood -> Daira Emma Hopwood.
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-03-02 12:13:07 +00:00
Daira Hopwood 54359a8809 Update the status of all NU5 ZIPs to Final.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-06-22 22:21:35 +01:00
Jack Grigg 4075c18cc4 ZIP 244: Fix ill-defined commitments for shielded coinbase
In zcash/zips#577 we altered ZIP 244 to have shielded signatures commit
to the same data as transparent inputs, in transactions that contain
transparent components. However, the edge case of shielded coinbase was
not correctly handled; they contain both a consensus-required "dummy"
transparent input, and binding signatures which would be required to
commit to a `CTxOut` that does not exist.

We resolve this by partially reverting one of the zcash/zips#577 changes,
by having S.2 for coinbase transactions be identical to T.2. This reverts
binding signatures in coinbase transactions to effectively signing the
transaction ID.

At the same time, we also revert the same change for transactions with no
transparent inputs but some transparent outputs; these also now revert to
using the transaction ID for all shielded signatures (like fully-shielded
transactions). The hardware wallet edge case does not apply here, as all
input values are shielded and therefore directly committed to.
2022-01-24 22:46:41 +00:00
Daira Hopwood 2ae8fc6cec Minor wording nits.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-01-13 14:29:30 +00:00
Jack Grigg 1b30e57bde ZIP 244: Commit to scriptPubKey in txin_sig_digest instead of scriptCode
This is a no-op for every scriptPubKey format except P2SH, where we now
commit to the digest of the redeemScript instead instead of redeemScript
directly.
2022-01-12 22:08:22 +00:00
Jack Grigg 509b7a2b0c ZIP 244: Rename script_codes_sig_digest to scriptpubkeys_sig_digest 2022-01-12 16:00:23 +00:00
Jack Grigg 8e74c62a21 ZIP 244: Fix numbering of BIP 341 references
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-01-12 15:58:51 +00:00
Deirdre Connolly a3a86b4a44
Update zip-0244.rst
Co-authored-by: str4d <thestr4d@gmail.com>
2022-01-06 13:54:49 -05:00
Daira Hopwood bdfe15bb3f Apply suggestions from code review
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2022-01-05 17:37:33 +00:00
Jack Grigg 68b6147c02 ZIP 244: Reverse order of value and script_code in txin_sig_digest
This matches the order in which they are committed to in BIP 341 (and
also at the transaction level in S.2).
2022-01-04 00:52:07 +00:00
Jack Grigg 89f46c2d99 ZIP 244: Add hash_type to the S.2 digest input
This was committed to by the ZIP 143 and ZIP 243 transaction digest
algorithms, but had been accidentally omitted from ZIP 244. It is not a
security issue because the encoding of each layer uses sentinel values,
meaning we were indirectly committing to hash_type (unlike BIP 341, which
conditionally omits commitments based on hash_type and therefore needs to
directly commit to it). But not committing directly to hash_type would
complicate security analysis of the digest, and including it keeps the
transparent part of ZIP 244 closer to BIP 341.

We additionally import two new consensus rules from BIP 341 that apply
to hash_type.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Kris Nuttycom <nuttycom@electriccoin.co>
2022-01-04 00:45:47 +00:00
Jack Grigg c2585a4fc9 ZIP 244: Extend S.2 to be used for shielded signatures
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-03 23:49:04 +00:00
Jack Grigg daac926497 ZIP 244: Add new S.2 commitments to input amounts and scriptCodes
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-03 23:47:13 +00:00
Jack Grigg 2442192519 ZIP 244: Change semantics of `sequence_sig_digest`
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-03 22:39:38 +00:00
Daira Hopwood abb898f484 ZIP 244: fix heading levels for Orchard digests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-12-30 10:05:16 +00:00
Daira Hopwood dfd7a5a561 ZIP 244: add Jack Grigg to authors.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-12-30 10:03:12 +00:00
Daira Hopwood 5ced374bf1 Update references to protocol spec from process and consensus ZIPs (0 to 252 inclusive, and 1014).
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-10-02 00:46:17 +01:00
Daira Hopwood 11b8688a1d Correct references to the title of ZIP 200.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-08-15 23:47:48 +01:00
Daira Hopwood 604c40a5c0 ZIP 244: add a note that the empty authorization data tree cannot occur.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-06-15 15:24:09 +01:00
Kris Nuttycombe f0c438de9b Clarify contruction of `hashAuthDataRoot`.
This changes the specification of hashAuthDataRoot to state that leaves
of the Merkle tree used to construct hashAuthDataRoot should have the
null hash value, while empty internal nodes should be hashes of empty
leaves. It also defines an all-FFs placeholder value to be used for
pre-v5 transactions in this tree.

Co-authored-by: Kris Nuttycom <nuttycom@electriccoin.co>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-06-15 15:14:44 +01:00
Kris Nuttycombe 9ccd44743f
Apply suggestions from code review
Make the specification of the cases in which empty hashes are produced more
explicit, and less dependent upon how these rules are scoped.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-05-18 08:16:00 -06:00
Kris Nuttycombe 12fa6ffa8e Remove trailing whitespace. 2021-05-18 08:05:07 -06:00
Kris Nuttycombe 8d21457112 Add a note about the signedness of `value` 2021-05-18 07:53:40 -06:00
Kris Nuttycombe becbec175c Fix rendering of txin_sig_digest 2021-05-11 08:16:33 -06:00
Kris Nuttycombe d023ef8220
Update zip-0244.rst
Co-authored-by: str4d <jack@electriccoin.co>
2021-05-10 17:42:51 -06:00
Kris Nuttycombe 622179e574
Apply suggestions from code review
Co-authored-by: teor <teor@riseup.net>
2021-05-10 14:14:39 -06:00
Kris Nuttycombe f22a6d4151 Clarify hashes over authorizing data. 2021-05-06 16:06:03 -06:00
Kris Nuttycombe eea56aa173 The roots of empty transaction hash subtrees are now uniformly committed to with empty hashes. 2021-05-06 15:49:50 -06:00
Daira Hopwood 21d3c13d4f Update references to the protocol spec for all NU5-related ZIPs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-23 22:33:56 +01:00
Kris Nuttycombe 827637cc17 Correct the description of the outputs_digest hash. 2021-04-23 08:20:20 -06:00
Deirdre Connolly 4c081eaa54 Make a note that the post-memo 'suffix' is the AEAD tag 2021-04-20 18:08:59 -04:00
teor ef5f47ca08
ZIP-244: Clarify sapling shared anchor hashing (#490)
* ZIP-244: Clarify sapling shared anchor hashing

Unlike the orchard shared anchor, the sapling v5 transaction shared anchor
is hashed into *each* spend.

* Uppercase Sapling and Spend

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2021-04-20 18:08:12 -04:00
Daira Hopwood 31e8b03491 ZIP 244: update link to protocol spec.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-03-30 20:19:33 +01:00
Daira Hopwood b0c65971d7
Merge pull request #467 from nuttycom/zip_225-ncc_fixes
Fixes for ZIP 225 issues identified by the NCC audit.
2021-03-30 20:10:43 +01:00
Kris Nuttycombe f7461d62e5
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-03-30 10:45:49 -06:00
teor 96efd54702
Be explicit about hashBlockCommitments activation 2021-03-29 14:14:12 +10:00
Kris Nuttycombe 4b2af700ef Add non-requirement for non-malleable transaction IDs for v4 transactions. 2021-03-26 16:37:30 -06:00
Kris Nuttycombe f202b83a9d Remove Sprout commitments from ZIP 244; include flagsOrchard in txid. 2021-03-26 16:37:30 -06:00
Daira Hopwood 5df826f0f6 ZIP 244: formatting fix.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-03-07 19:34:11 +00:00
Kris Nuttycombe 62dca39483 Separate Sapling effecting data from authorizing data in the transaction format.
This change restructures the wire format of Sapling spend and output
descriptions to segregate authorizing data from the data describing the
effects of the transaction in a similar fashion as has been done for
Orchard. The result is now symmetric between Sapling and Orchard, and
also simplifies slightly the description of the computation of the
authorizing data commitment in ZIP 244.
2021-03-01 10:55:11 -07:00
Kris Nuttycombe 267bced55a Draft of ZIP 225 2021-02-28 12:32:29 -07:00
Daira Hopwood 4b5ce259d1 Move ZIP 244 to Proposed and ZIP 245 to Draft.
Also fix an rst syntax error in ZIP 245.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-15 20:52:40 +00:00
Kris Nuttycombe 566be18f40 Rename signature digests to clarify differences wrt txid digests. 2021-02-15 09:59:01 -07:00
Kris Nuttycombe a779c1043d
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-02-15 09:52:53 -07:00
Kris Nuttycombe cdb7144519
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-02-09 08:06:00 -07:00
Kris Nuttycombe 62331bbbb6 Add decoupling of wire format from consensus rules to motivation. 2021-02-08 11:19:14 -07:00
Kris Nuttycombe a424153462 Clarify rationale for personalization changes.
Also clarify terminology around signature hash flags vs. types.
2021-02-04 10:59:51 -07:00
Kris Nuttycombe 4b8a78c51b Specify exclusion of spend authorization sigs from txid. 2021-02-02 14:11:09 -07:00
Kris Nuttycombe 90e83ad754
Note number of underscores in hash personalization strings.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-02-02 13:22:02 -07:00
Kris Nuttycombe 4da60ce58b Fix authorizing commitment to include spend_auth_sigs 2021-02-02 13:06:43 -07:00