From afb9a1d7c06d80bfeef3fec6c73433b4078bb773 Mon Sep 17 00:00:00 2001 From: protolambda Date: Tue, 3 Dec 2019 21:34:48 +0100 Subject: [PATCH] move signed envelopes --- specs/core/0_beacon-chain.md | 59 +++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index cde426c03..fca21994f 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -33,20 +33,21 @@ - [`DepositMessage`](#depositmessage) - [`DepositData`](#depositdata) - [`BeaconBlockHeader`](#beaconblockheader) - - [`SignedBeaconBlockHeader`](#signedbeaconblockheader) - [Beacon operations](#beacon-operations) - [`ProposerSlashing`](#proposerslashing) - [`AttesterSlashing`](#attesterslashing) - [`Attestation`](#attestation) - [`Deposit`](#deposit) - [`VoluntaryExit`](#voluntaryexit) - - [`SignedVoluntaryExit`](#signedvoluntaryexit) - [Beacon blocks](#beacon-blocks) - [`BeaconBlockBody`](#beaconblockbody) - [`BeaconBlock`](#beaconblock) - - [`SignedBeaconBlock`](#signedbeaconblock) - [Beacon state](#beacon-state) - [`BeaconState`](#beaconstate) + - [Signed envelopes](#signed-envelopes) + - [`SignedVoluntaryExit`](#signedvoluntaryexit) + - [`SignedBeaconBlock`](#signedbeaconblock) + - [`SignedBeaconBlockHeader`](#signedbeaconblockheader) - [Helper functions](#helper-functions) - [Math](#math) - [`integer_squareroot`](#integer_squareroot) @@ -374,14 +375,6 @@ class BeaconBlockHeader(Container): body_root: Root ``` -#### `SignedBeaconBlockHeader` - -```python -class SignedBeaconBlockHeader(Container): - message: BeaconBlockHeader - signature: BLSSignature -``` - ### Beacon operations #### `ProposerSlashing` @@ -426,14 +419,6 @@ class VoluntaryExit(Container): validator_index: ValidatorIndex ``` -#### `SignedVoluntaryExit` - -```python -class SignedVoluntaryExit(Container): - message: VoluntaryExit - signature: BLSSignature -``` - ### Beacon blocks #### `BeaconBlockBody` @@ -461,14 +446,6 @@ class BeaconBlock(Container): body: BeaconBlockBody ``` -#### `SignedBeaconBlock` - -```python -class SignedBeaconBlock(Container): - message: BeaconBlock - signature: BLSSignature -``` - ### Beacon state #### `BeaconState` @@ -505,6 +482,34 @@ class BeaconState(Container): finalized_checkpoint: Checkpoint ``` +### Signed envelopes + +Some messages in the protocol are wrapped in an envelop to better facilitate adding/pruning the signature and to `hash_tree_root` the `message` separate from the signature. + +#### `SignedVoluntaryExit` + +```python +class SignedVoluntaryExit(Container): + message: VoluntaryExit + signature: BLSSignature +``` + +#### `SignedBeaconBlock` + +```python +class SignedBeaconBlock(Container): + message: BeaconBlock + signature: BLSSignature +``` + +#### `SignedBeaconBlockHeader` + +```python +class SignedBeaconBlockHeader(Container): + message: BeaconBlockHeader + signature: BLSSignature +``` + ## Helper functions *Note*: The definitions below are for specification purposes and are not necessarily optimal implementations.