From 686ac19aa078f1e52db013e939460e8556c2e4d8 Mon Sep 17 00:00:00 2001 From: nkohen Date: Wed, 14 Oct 2020 16:07:09 -0500 Subject: [PATCH 1/2] Replaced oracle_info with oracle_announcement --- Messaging.md | 15 --------------- Protocol.md | 14 +++++++------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/Messaging.md b/Messaging.md index 54cf2bf..4780538 100644 --- a/Messaging.md +++ b/Messaging.md @@ -15,8 +15,6 @@ All data fields are unsigned big-endian unless otherwise specified. * [DLC Specific Types](#dlc-specific-types) * [The `contract_info` Type](#the-contract_info-type) * [Version 0 `contract_info`](#version-0-contract_info) - * [The `oracle_info` Type](#the-oracle_info-type) - * [Version 0 `oracle_info`](#version-0-oracle_info) * [The `funding_input` Type](#the-funding_input-type) * [Version 0 `funding_input`](#version-0-funding_input) * [The `cet_adaptor_signatures` Type](#the-cet_adaptor_signatures-type) @@ -100,19 +98,6 @@ This type contains information about a contracts outcomes and their correspondin This type of contract info is a simple enumeration where the value `n` is omitted from being explicitly included as it can be derived from the length field of the TLV. -### The `oracle_info` Type - -This type contains information about the oracle(s) to be used in executing a DLC, and possibly the outcomes possible if these are not specified in the corresponding `contract_info`. - -#### Version 0 `oracle_info` - -1. type: 42770 (`oracle_info_v0`) -2. data: - * [`x_point`:`oracle_public_key`] - * [`x_point`:`oracle_nonce`] - -This type of oracle info is for single-oracle, single signature (and hence single nonce) events. - ### The `funding_input` Type This type contains information about a specific input to be used in a funding transaction, as well as its corresponding on-chain UTXO. diff --git a/Protocol.md b/Protocol.md index 73174d9..6cd8529 100644 --- a/Protocol.md +++ b/Protocol.md @@ -67,8 +67,8 @@ the funding transaction and CETs. 2. data: * [`byte`:`contract_flags`] * [`chain_hash`:`chain_hash`] + * [`oracle_announcement`:`oracle_announcement`] * [`contract_info`:`contract_info`] - * [`oracle_info`:`oracle_info`] * [`point`:`funding_pubkey`] * [`spk`:`payout_spk`] * [`u64`:`total_collateral_satoshis`] @@ -87,8 +87,8 @@ The existence of the `chain_hash` allows nodes to open contracts across many distinct blockchains as well as have contracts within multiple blockchains opened to the same peer (if it supports the target chains). -`contract_info` specifies the sender's payouts for all events. `oracle_info` -specifies the oracle(s) to be used as well as their commitments to events. +`oracle_announcment` specifies the oracle(s) to be used as well as their +commitments to events. `contract_info` specifies the sender's payouts for all events. `funding_pubkey` is the public key in the 2-of-2 multisig script of the funding transaction output. `payout_spk` specifies the script @@ -133,7 +133,7 @@ The receiving node MAY reject the contract if: - it does not agree to the terms in `contract_info`. - the `contract_info` is missing relevant events. - - it does not want to use the oracle(s) specified in `oracle_info`. + - it does not want to use the oracle(s) specified in `oracle_announcement`. - `total_collateral_satoshis` is too small. - `feerate_per_vb` is too small. - `feerate_per_vb` is too large. @@ -142,7 +142,7 @@ The receiving node MUST reject the contract if: - the `chain_hash` value is set to a hash of a chain that is unknown to the receiver. - the `contract_info` refers to events unknown to the receiver. - - the `oracle_info` refers to an oracle unknown or inaccessible to the receiver. + - the `oracle_announcement` refers to an oracle unknown or inaccessible to the receiver. - it considers `feerate_per_vb` too small for timely processing or unreasonably large. - `funding_pubkey` is not a valid secp256k1 pubkey in compressed format. - `funding_inputs` do not contribute at least `total_collateral_satohis` plus full [fee payment](Transactions.md#fee-payment). @@ -173,7 +173,7 @@ The `temporary_contract_id` MUST be the SHA256 hash of the `offer_dlc` message. The sender MUST: - set `total_collateral_satoshis` sufficiently large so that the sum of both parties' total collaterals is at least as large as the largest payout in the `offer_dlc`'s `contract_info`. - - set `cet_adaptor_signatures` to valid adaptor signatures, using its `funding_pubkey` for each CET, as defined in the [transaction specification](Transactions.md#contract-execution-transaction) and using signature public keys computed using the `offer_dlc`'s `contract_info` and `oracle_info` as adaptor points. + - set `cet_adaptor_signatures` to valid adaptor signatures, using its `funding_pubkey` for each CET, as defined in the [transaction specification](Transactions.md#contract-execution-transaction) and using signature public keys computed using the `offer_dlc`'s `contract_info` and `oracle_announcement` as adaptor points. - include an adaptor signature in `cet_adaptor_signatures` for every event specified in the `offer_dlc`'s `contract_info`. - set `refund_signature` to the valid signature, using its `funding_pubkey` for the refund transaction, as defined in the [transaction specification](Transactions.md#refund-transaction). @@ -213,7 +213,7 @@ This message introduces the [`contract_id`](#definition-of-contract_id) to ident The sender MUST: - set `contract_id` by exclusive-OR of the `funding_txid` and the `funding_output_index` from the `offer_dlc` and `accept_dlc` messages. - - set `cet_adaptor_signatures` to valid adaptor signatures, using its `funding_pubkey` for each CET, as defined in the [transaction specification](Transactions.md#contract-execution-transaction) and using signature public keys computed using the `offer_dlc`'s `contract_info` and `oracle_info` as adaptor points. + - set `cet_adaptor_signatures` to valid adaptor signatures, using its `funding_pubkey` for each CET, as defined in the [transaction specification](Transactions.md#contract-execution-transaction) and using signature public keys computed using the `offer_dlc`'s `contract_info` and `oracle_announcement` as adaptor points. - include an adaptor signature in `cet_adaptor_signatures` for every event specified in the `offer_dlc`'s `contract_info`. - set `refund_signature` to the valid signature, using its `funding_pubkey` for the refund transaction, as defined in the [transaction specification](Transactions.md#refund-transaction). - set `funding_signatures` to contain valid witnesses for every funding input specified in the `offer_dlc` message and in the same order. From ee69d8dab1973cdc2dad95321bf2aa068387adaa Mon Sep 17 00:00:00 2001 From: nkohen Date: Wed, 14 Oct 2020 16:11:04 -0500 Subject: [PATCH 2/2] Fixed contract_info --- Messaging.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Messaging.md b/Messaging.md index 4780538..87d9e6b 100644 --- a/Messaging.md +++ b/Messaging.md @@ -86,17 +86,18 @@ The following DLC-specific types are used throughout the specification. All type This type contains information about a contracts outcomes and their corresponding payouts. To save space, only one side's POV is included in this message as the other can be derived using `remote_payout = total_collateral - local_payout`. -#### Version 0 `contract_info` +#### Version 0 `enum_contract_info` -1. type: 42768 (`contract_info_v0`) +1. type: 42768 (`enum_contract_info_v0`) 2. data: - * [`sha256`:`outcome_1`] * [`u64`:`outcome_1_local_payout`] * ... - * [`sha256`:`outcome_n`] * [`u64`:`outcome_n_local_payout`] -This type of contract info is a simple enumeration where the value `n` is omitted from being explicitly included as it can be derived from the length field of the TLV. +This type of contract info is a simple enumeration where the value `n` is omitted from being +explicitly included as it can be derived from the length field of the TLV and should already be +known from the corresponding `oracle_announcement`. +The order of payouts matches the order of the outcomes in the `oracle_announcement`. ### The `funding_input` Type