From bc5a1bf01b1f9a2c81024d9eb505ba8f4f4a5d89 Mon Sep 17 00:00:00 2001 From: Brandon Kite Date: Fri, 1 Jul 2022 15:02:03 -0700 Subject: [PATCH] Formalize Double-spend Validation We already implemented these checks, but they are missing from the specs. --- specs/protocol/tx_format.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specs/protocol/tx_format.md b/specs/protocol/tx_format.md index 21dc6013..a9149d94 100644 --- a/specs/protocol/tx_format.md +++ b/specs/protocol/tx_format.md @@ -62,9 +62,12 @@ Transaction is invalid if: - `inputsCount > MAX_INPUTS` - `outputsCount > MAX_OUTPUTS` - `witnessesCount > MAX_WITNESSES` -- No inputs are of type `InputType.Coin` +- No inputs are of type `InputType.Coin` or `InputType.Message` - More than one output is of type `OutputType.Change` for any asset ID in the input set - Any output is of type `OutputType.Change` for any asset ID not in the input set +- More than one input of type `InputType.Coin` for any [Coin ID](./identifiers.md#coin-id) in the input set +- More than one input of type `InputType.Contract` for any [Contract ID](./identifiers.md#contract-id) in the input set +- More than one input of type `InputType.Message` for any [Input Message ID](./identifiers.md#input-message-id) in the input set When serializing a transaction, fields are serialized as follows (with inner structs serialized recursively):