ZIP 316: Require that `typecode` and `length` are <= 0x2000000.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2021-09-17 13:39:28 +01:00
parent d6a32d4757
commit 460c5b2ccc
1 changed files with 8 additions and 5 deletions

View File

@ -331,6 +331,9 @@ of the consituent Receivers:
* :math:`\mathtt{addr} : \mathtt{byte[length]}` — the Receiver Encoding.
The values of the :math:`\mathtt{typecode}` and :math:`\mathtt{length}`
fields MUST be less than or equal to :math:`\mathtt{0x2000000}.`
A Receiver Encoding is the raw encoding of a Shielded Payment Address,
or the :math:`160\!`-bit script hash of a P2SH address [#P2SH]_, or the
:math:`160\!`-bit validating key hash of a P2PKH address [#P2PKH]_.
@ -423,11 +426,11 @@ Requirements for both Unified Addresses and Unified Viewing Keys
P2SH and P2PKH transparent-only address formats suffice for this
purpose and are already supported by the existing ecosystem.
* The :math:`\mathtt{length}` field is encoded as a
:math:`\mathtt{compactSize}.` [#Bitcoin-CompactSize]_ (Although
existing Receiver Encodings and Viewing Key Encodings are all less
than 256 bytes and so could use a one-byte length field, encodings
for experimental types may be longer.)
* The :math:`\mathtt{typecode}` and :math:`\mathtt{length}` fields are
encoded as :math:`\mathtt{compactSize}.` [#Bitcoin-CompactSize]_
(Although existing Receiver Encodings and Viewing Key Encodings are
all less than 256 bytes and so could use a one-byte length field,
encodings for experimental types may be longer.)
* Each Receiver, UFVK, or UIVK SHOULD represent an Address or
Viewing Key at the ZIP 32 or BIP 44 Account level.