From d641e941519efc8cacd5e2ddabcaaf1722aa0797 Mon Sep 17 00:00:00 2001 From: Justin Drake Date: Thu, 27 Jun 2019 11:30:23 +0100 Subject: [PATCH] Cleanups --- specs/simple-serialize.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/specs/simple-serialize.md b/specs/simple-serialize.md index 53c5649ed..97b1d560c 100644 --- a/specs/simple-serialize.md +++ b/specs/simple-serialize.md @@ -43,7 +43,7 @@ ### Composite types * **container**: ordered heterogeneous collection of values - * python dataclass notation with key-type pairs, e.g. + * python dataclass notation with key-type pairs, e.g. ```python class ContainerExample(Container): foo: uint64 @@ -53,12 +53,12 @@ class ContainerExample(Container): * notation `Vector[type, N]`, e.g. `Vector[uint64, N]` * **list**: ordered variable-length homogeneous collection of values, with maximum length `N` * notation `List[type, N]`, e.g. `List[uint64, N]` +* **bitvector**: ordered fixed-length collection of `boolean` values + * notation `Bitvector[N]` +* **bitlist**: ordered variable-length collection of `boolean` values, with maximum length `N` + * notation `Bitlist[N]` * **union**: union type containing one of the given subtypes * notation `Union[type_1, type_2, ...]`, e.g. `union[null, uint64]` -* **Bitvector**: a fixed-length list of `boolean` values - * notation `Bitvector[N]` -* **Bitlist**: a variable-length list of `boolean` values with maximum length `N` - * notation `Bitlist[N]` ### Variable-size and fixed-size @@ -193,7 +193,6 @@ as_integer = sum([value[i] << i for i in range(len(value))]) return mix_in_length(merkleize(as_integer.to_bytes((N + 7) // 8, "little")), len(value)) ``` - ## Self-signed containers Let `value` be a self-signed container object. The convention is that the signature (e.g. a `"bytes96"` BLS12-381 signature) be the last field of `value`. Further, the signed message for `value` is `signing_root(value) = hash_tree_root(truncate_last(value))` where `truncate_last` truncates the last element of `value`.