Update messaging and serialization (#163)

* Update messaging and serialization

* Replace collection prefixes with bigsize instead of u16

* add test vectors

* Use old serialization format for oracle messages

* Add temporary contract id to offer message

* Rename leftEndPoint to endPoint

* Update test vectors

* Fix forgotten types

* Replace bigsize with u64 in payout curve and numeric outcome

* Update test vectors

* use bigsize for vector prefix in rounding intervals

* Update test vectors setting base as u16

* Update test vector with fix to precision field

* Update test vectors to include temporary contract id in offer message

* Add protocol version to accept message

* Add protocol version to sign message

* Fix test vectors
This commit is contained in:
Thibaut Le Guilly
2022-06-12 22:36:04 +09:00
committed by GitHub
parent 160eb3628c
commit 8ecdf2aa55
18 changed files with 19521 additions and 149 deletions

View File

@@ -11,55 +11,94 @@ All data fields are unsigned big-endian unless otherwise specified.
- [Connection Handling and Multiplexing](#connection-handling-and-multiplexing)
- [Message Format](#message-format)
- [Wire Messages](#wire-messages)
- [Type-Length-Value](#type-length-value)
- [Sub-types](#sub-types)
- [Plain sub-type](#plain-sub-type)
- [Sibling sub-type](#sibling-sub-type)
- [Optional sub-type](#optional-sub-type)
- [Fundamental Types](#fundamental-types)
- [DLC Specific Types](#dlc-specific-types)
- [The `contract_info` Type](#the-contract_info-type)
- [Version 0 `contract_info`](#version-0-contract_info)
- [Version 1 `contract_info`](#version-1-contract_info)
- [`single_contract_info`](#single_contract_info)
- [`disjoint_contract_info`](#disjoint_contract_info)
- [The `contract_descriptor` Type](#the-contract_descriptor-type)
- [Version 0 `contract_descriptor`](#version-0-contract_descriptor)
- [Version 1 `contract_descriptor`](#version-1-contract_descriptor)
- [`enumerated_contract_descriptor`](#enumerated_contract_descriptor)
- [`numeric_outcome_contract_descriptor`](#numeric_outcome_contract_descriptor)
- [The `oracle_info` Type](#the-oracle_info-type)
- [Version 0 `oracle_info`](#version-0-oracle_info)
- [Version 1 `oracle_info`](#version-1-oracle_info)
- [Version 2 `oracle_info`](#version-2-oracle_info)
- [`single_oracle_info`](#single_oracle_info)
- [`multi_oracle_info`](#multi_oracle_info)
- [The `oracle_params` Type](#the-oracle_params-type)
- [Version 0 `oracle_params`](#version-0-oracle_params)
- [`oracle_params`](#oracle_params)
- [The `negotiation_fields` Type](#the-negotiation_fields-type)
- [Version 0 `negotiation_fields`](#version-0-negotiation_fields)
- [Version 1 `negotiation_fields`](#version-1-negotiation_fields)
- [Version 2 `negotiation_fields`](#version-2-negotiation_fields)
- [`single_negotiation_fields`](#single_negotiation_fields)
- [`disjoint_negotiation_fields`](#disjoint_negotiation_fields)
- [The `funding_input` Type](#the-funding_input-type)
- [Version 0 `funding_input`](#version-0-funding_input)
- [`funding_input`](#funding_input)
- [The `cet_adaptor_signatures` Type](#the-cet_adaptor_signatures-type)
- [Version 0 `cet_adaptor_signatures`](#version-0-cet_adaptor_signatures)
- [`cet_adaptor_signatures`](#cet_adaptor_signatures)
- [The `funding_signatures` Type](#the-funding_signatures-type)
- [Version 0 `funding_signatures`](#version-0-funding_signatures)
- [`funding_signatures`](#funding_signatures)
- [The `event_descriptor` Type](#the-event_descriptor-type)
- [Version 0 `enum_event_descriptor`](#version-0-enum_event_descriptor)
- [Version 0 `digit_decomposition_event_descriptor`](#version-0-digit_decomposition_event_descriptor)
- [`enum_event_descriptor`](#enum_event_descriptor)
- [`digit_decomposition_event_descriptor`](#digit_decomposition_event_descriptor)
- [The `oracle_event` Type](#the-oracle_event-type)
- [Version 0 `oracle_event`](#version-0-oracle_event)
- [`oracle_event`](#oracle_event)
- [The `oracle_announcement` Type](#the-oracle_announcement-type)
- [Version 0 `oracle_announcement`](#version-0-oracle_announcement)
- [`oracle_announcement`](#oracle_announcement)
- [The `oracle_attestation` Type](#the-oracle_attestation-type)
- [Version 0 `oracle_attestation`](#version-0-oracle_attestation)
- [`oracle_attestation`](#oracle_attestation)
- [Authors](#authors)
## Connection Handling and Multiplexing
Implementations MUST use a single connection per peer; contract messages (which include a contract ID) are multiplexed over this single connection.
## Message Format
We reuse the [Lightning Message Format](https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#lightning-message-format) and the [Type-Length-Value Format](https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#type-length-value-format) (TLV).
To be clear, any encoded binary blob that can be sent over the wire will follow the Lightning Message Format
while all sub-types internal to these messages will follow the Type-Length-Value Format.
This means that types on outer-messages will be represented with `u16` integers (defined below) and their length
is omitted from their encoding because the transport layer has the length in a separate unencrypted field.
Meanwhile all typed sub-messages (which follow TLV format) will have their types represented using `bigsize` integers
(defined below) and their lengths (also `bigsize`) are included in their encodings.
We reuse the [Lightning Message Format](https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#lightning-message-format) for messages sent over the wire, the [Type-Length-Value Format](https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#type-length-value-format) (TLV) for message extensibility and extra features support, and a custom format for [sub-types](#sub-types).
Note that contrary to the LN messages, collections of items are prefixed with a `BigSize` and not a `u16`.
Test vectors for serialization are available [here](./test/serialization_test_vectors).
### Wire Messages
Any encoded binary blob that can be sent over the wire will follow the Lightning Message Format.
This means that wire messages are prefixed with a `u16` field (defined below) and their length is omitted from their encoding because the transport layer has the length in a separate un-encrypted field.
### Type-Length-Value
A TLV stream is defined for each wire message, and can be used to extend the protocol and for application specific features.
See the [Type-Length-Value Format section](https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#type-length-value-format) in the LN BOLTs for specifications.
### Sub-types
Wire messages (and sub-types themselves) contain embedded data structures.
These sub-types can have three functions:
* [Plain sub-types](#plain-sub-type) to factor out a number of fields to make specifications clearer,
* [Sibling sub-types](#sibling-sub-type) to support multiple variants of a field,
* [Optional sub-types](#optional-sub-type) to support optional fields.
#### Plain sub-type
Plain sub-types do not have any particular format, and their field can simply be replaced in place where they are used.
For example, the [funding input type](#the-funding_input-type) is a plain sub-type which does not require any particular prefix.
#### Sibling sub-type
Sibling sub-types are prefixed with a `bigsize` type identifier.
The type identifiers are specific to a set of type variants, and can thus be reused across different sub-types.
Type identifiers are defined within the type definitions, starting from `0` and increasing by `1`.
#### Optional sub-type
Optional sub-types are prefixed with a single byte where:
- `0x00` means that the field is absent
- `0x01` means that the field is present
Optional fields are denoted in this specification using the notation `Optional(field_type)` where `field_type` is the type of the optional field.
## Fundamental Types
@@ -103,20 +142,22 @@ The following DLC-specific types are used throughout the specification. All type
This type contains information about a contract's outcomes, their corresponding payouts, and the oracles to be used.
#### Version 0 `contract_info`
#### `single_contract_info`
1. type: 55342 (`contract_info_v0`)
2. data:
1. implements: `contract_info`
1. type: 0
1. data:
* [`u64`:`total_collateral`]
* [`contract_descriptor`:`contract_descriptor`]
* [`oracle_info`:`oracle_info`]
`total_collateral` is the Satoshi-denominated value of the sum of all party's collateral.
#### Version 1 `contract_info`
#### `disjoint_contract_info`
1. type: 55344 (`contract_info_v1`)
2. data:
1. implements: `contract_info`
1. type: 1
1. data:
* [`u64`:`total_collateral`]
* [`bigsize`:`num_disjoint_events`]
* [`contract_descriptor`:`contract_descriptor_1`]
@@ -142,10 +183,11 @@ To save space, only the offerer's payouts are included in this message as the ac
**Validity requirement**
For a contract descriptor to be valid, it is necessary that *a single* payout is defined for any possible outcome that can be attested by the oracle(s).
#### Version 0 `contract_descriptor`
#### `enumerated_contract_descriptor`
1. type: 42768 (`contract_descriptor_v0`)
2. data:
1. implements: `contract_descriptor`
1. type: 0
1. data:
* [`bigsize`:`num_outcomes`]
* [`string`:`outcome_1`]
* [`u64`:`payout_1`]
@@ -155,10 +197,11 @@ For a contract descriptor to be valid, it is necessary that *a single* payout is
This type represents an enumerated outcome contract.
#### Version 1 `contract_descriptor`
#### `numeric_outcome_contract_descriptor`
1. type: 42784 (`contract_descriptor_v1`)
2. data:
1. implements: `contract_descriptor`
1. type: 1
1. data:
* [`u16`:`num_digits`]
* [`payout_function`:`payout_function`]
* [`rounding_intervals`:`rounding_intervals`]
@@ -172,52 +215,44 @@ The type `rounding_intervals` is defined [here](NumericOutcome.md#rounding-inter
This type contains information about the oracles to be used in executing a DLC.
#### Version 0 `oracle_info`
#### `single_oracle_info`
1. type: 42770 (`oracle_info_v0`)
2. data:
1. implements: `oracle_info`
1. type: 0
1. data:
* [`oracle_announcement`:`oracle_announcement`]
This type of oracle info is for single-oracle events.
#### Version 1 `oracle_info`
#### `multi_oracle_info`
1. type: 42786 (`oracle_info_v1`)
2. data:
1. implements: `oracle_info`
1. type: 1
1. data:
* [`u16`:`threshold`]
* [`u16`:`num_oracles`]
* [`bigsize`:`num_oracles`]
* [`oracle_announcement`:`oracle_announcement_1`]
* ...
* [`oracle_announcement`:`oracle_announcement_num_oracles`]
* [`Optional(oracle_params)`: `oracle_params`]
This type of oracle info is for multi-oracle events where all oracles are signing messages chosen
This type of oracle info is for multi-oracle events.
If `oracle_params` is not provided, then all oracles are expected to be signing messages chosen
from a set of messages that exactly corresponds to the set of messages being signed by the other oracles,
and any `threshold` oracles must sign (exactly) corresponding messages for execution to happen.
#### Version 2 `oracle_info`
1. type: 55340 (`oracle_info_v2`)
2. data:
* [`u16`:`threshold`]
* [`u16`:`num_oracles`]
* [`oracle_announcement`:`oracle_announcement_1`]
* ...
* [`oracle_announcment`:`oracle_announcement_num_oracles`]
* [`oracle_params`:`oracle_params`]
If `oracle_params` is provided, allowed differences in the values signed by oracles is specified in `oracle_params`.
The order of the oracle announcements represents a total ordering of preference on the oracles.
This type of oracle info is for multi-oracle numeric events where allowed differences in the values
signed by oracles is specified in `oracle_params`.
### The `oracle_params` Type
Contains information about how oracle information is used in a given contract.
#### Version 0 `oracle_params`
#### `oracle_params`
1. type: 55338 (`oracle_params_v0`)
2. data
1. data
* [`u16`:`maxErrorExp`]
* [`u16`:`minFailExp`]
* [`bool`:`maximize_coverage`]
@@ -229,18 +264,11 @@ multi-oracle numeric outcome DLC with allowed error is the same.
This type contains preferences of the accepter of a DLC which are taken into account during DLC construction.
#### Version 0 `negotiation_fields`
#### `single_negotiation_fields`
1. type: 55334 (`negotiation_fields_v0`)
2. data:
* (empty)
This type signifies that the accepter has no negotiation fields.
#### Version 1 `negotiation_fields`
1. type: 55336 (`negotiation_fields_v1`)
2. data:
1. implements: `negotiation_fields`
1. type: 0
1. data:
* [`rounding_intervals`: `rounding_intervals`]
`rounding_intervals` represents the maximum amount of allowed rounding at any possible oracle outcome
@@ -248,10 +276,11 @@ in a numeric outcome DLC.
The type `rounding_intervals` is defined [here](NumericOutcome.md#rounding-interval-serialization).
#### Version 2 `negotiation_fields`
#### `disjoint_negotiation_fields`
1. type: 55346 (`negotiation_fields_v2`)
2. data:
1. implements: `negotiation_fields`
1. type: 1
1. data:
* [`bigsize`:`num_disjoint_events`]
* [`negotiation_fields`:`negotiation_fields_1`]
* ...
@@ -265,12 +294,11 @@ all of the `negotiation_fields` nested here must be version 0 or 1.
This type contains information about a specific input to be used in a funding transaction, as well as its corresponding on-chain UTXO.
#### Version 0 `funding_input`
#### `funding_input`
1. type: 42772 (`funding_input_v0`)
2. data:
1. data:
* [`u64`:`input_serial_id`]
* [`u16`:`prevtx_len`]
* [`bigsize`:`prevtx_len`]
* [`prevtx_len*byte`:`prevtx`]
* [`u32`:`prevtx_vout`]
* [`u32`:`sequence`]
@@ -297,10 +325,9 @@ byte is for pushing `redeemscript` onto the stack in the script signature.
This type contains CET signatures and any necessary information linking the signatures to their corresponding outcome.
#### Version 0 `cet_adaptor_signatures`
#### `cet_adaptor_signatures`
1. type: 42774 (`cet_adaptor_signatures_v0`)
2. data:
1. data:
* [`bigsize`:`nb_signatures`]
* [`ecdsa_adaptor_signature`:`signature_1`]
* [`dleq_proof`:`dleq_prf_1`]
@@ -308,25 +335,22 @@ This type contains CET signatures and any necessary information linking the sign
* [`ecdsa_adaptor_signature`:`signature_n`]
* [`dleq_proof`:`dleq_prf_n`]
This type should be used with [`contract_info_v0`](#version-0-contract_info) where each indexed signature in the data corresponds to the outcome of the same index.
### The `funding_signatures` Type
This type contains signatures of the funding transaction and any necessary information linking the signatures to their inputs.
#### Version 0 `funding_signatures`
#### `funding_signatures`
1. type: 42776 (`funding_signatures_v0`)
2. data:
* [`u16`:`num_witnesses`]
* [`u16`:`num_witness_elems_1`]
1. data:
* [`bigsize`:`num_witnesses`]
* [`bigsize`:`num_witness_elems_1`]
* [`num_witness_elems_1*witness_element`:`witness_elements_1`]
* ...
* [`u16`:`num_witness_elems_num_witnesses`]
* [`bigsize`:`num_witness_elems_num_witnesses`]
* [`num_witness_elems_num_witnesses*witness_element`:`witness_elements_num_witnesses`]
3. subtype: `witness_element`
4. data:
* [`u16`:`len`]
1. subtype: `witness_element`
1. data:
* [`bigsize`:`len`]
* [`len*byte`:`witness`]
`witness` is the data for a witness element in a witness stack. An empty `witness_stack` is an error,
@@ -339,10 +363,13 @@ Witnesses should be sorted by the `input_serial_id` sent in `funding_input` defi
This type contains information about an event on which a contract is based.
Two types of events are described, see [the oracle specification](./Oracle.md#event-descriptor) for more details.
#### Version 0 `enum_event_descriptor`
**For backward compatibility reasons, this type is currently serialized as a TLV and uses u16 for collection prefix. It is expected to be changed to the new serialization format in a near future.**
1. type: 55302 (`enum_event_descriptor_v0`)
2. data:
#### `enum_event_descriptor`
1. implements: `event_descriptor`
1. type: 55302
1. data:
* [`u16`:`num_outcomes`]
* [`string`:`outcome_1`]
* ...
@@ -352,10 +379,11 @@ This type of event descriptor is a simple enumeration where the value `n` is the
Note that `outcome_i` is the outcome value itself and not its hash that will be signed by the oracle.
#### Version 0 `digit_decomposition_event_descriptor`
#### `digit_decomposition_event_descriptor`
1. type: 55306 (`digit_decomposition_event_descriptor_v0`)
2. data:
1. implements: `event_descriptor`
1. type: 55306
1. data:
* [`bigsize`:`base`]
* [`bool`:`is_signed`]
* [`string`:`unit`]
@@ -367,10 +395,12 @@ Note that `outcome_i` is the outcome value itself and not its hash that will be
This type contains information provided by an oracle on an event that it will attest to.
See [the Oracle specifications](./Oracle.md#oracle-event) for more details.
#### Version 0 `oracle_event`
**For backward compatibility reasons, this type is currently serialized as a TLV and uses u16 for collection prefix. It is expected to be changed to the new serialization format in a near future.**
1. type: 55330 (`oracle_event_v0`)
2. data:
#### `oracle_event`
1. type: 55330
1. data:
* [`u16`:`nb_nonces`]
* [`nb_nonces*x_point`:`oracle_nonces`]
* [`u32`:`event_maturity_epoch`]
@@ -380,12 +410,15 @@ See [the Oracle specifications](./Oracle.md#oracle-event) for more details.
### The `oracle_announcement` Type
This type contains an `oracle_event` and a signature certifying its origination.
As oracle announcements can be broadcast directly, they are encoded as [wire messages](#wire-messages).
See [the Oracle specifications](./Oracle.md#oracle-announcements) for more details.
#### Version 0 `oracle_announcement`
**For backward compatibility reasons, this type is currently serialized as a TLV and uses u16 for collection prefix. It is expected to be changed to the new serialization format in a near future.**
1. type: 55332 (`oracle_announcement`)
2. data:
#### `oracle_announcement`
1. type: 55332
1. data:
* [`signature`:`annoucement_signature`]
* [`x_point`:`oracle_public_key`]
* [`oracle_event`:`oracle_event`]
@@ -395,12 +428,15 @@ where `signature` is a Schnorr signature over a sha256 hash of the serialized `o
### The `oracle_attestation` Type
This type contains information about the outcome of an event and the signature(s) over its outcome value(s).
As oracle attestations can be broadcast directly, they are encoded as [wire messages](#wire-messages).
See [the Oracle specifications](./Oracle.md#oracle-attestations) for more details.
#### Version 0 `oracle_attestation`
**For backward compatibility reasons, this type is currently serialized as a TLV and uses u16 for collection prefix. It is expected to be changed to the new serialization format in a near future.**
1. type: 55400 (`oracle_attestation_v0`)
2. data:
#### `oracle_attestation`
1. type: 55400
1. data:
* [`string`:`event_id`]
* [`x_point`:`oracle_public_key`]
* [`u16`: `nb_signatures`]

View File

@@ -66,18 +66,17 @@ up in the case of a tie.
#### Rounding Interval Serialization
1. type: 42788 (`rounding_intervals_v0`)
2. data:
* [`u16`:`num_rounding_intervals`]
* [`bigsize`:`begin_interval_1`]
* [`bigsize`:`rounding_mod_1`]
1. data:
* [`bigsize`:`num_rounding_intervals`]
* [`u64`:`begin_interval_1`]
* [`u64`:`rounding_mod_1`]
* ...
* [`bigsize`:`begin_interval_num_rounding_intervals`]
* [`bigsize`:`rounding_mod_num_rounding_intervals`]
* [`u64`:`begin_interval_num_rounding_intervals`]
* [`u64`:`rounding_mod_num_rounding_intervals`]
`num_rounding_intervals` is the number of rounding intervals specified in this function and can be
zero in which case a rounding modulus of `1` is used everywhere.
Each serialized rounding interval consists of two `bigsize` integers.
Each serialized rounding interval consists of two `u64` integers.
The first integer is called `begin_interval` and refers to the x-coordinate (`event_outcome`) at which this range begins.
The second integer is called `rounding_mod` and contains the rounding modulus to be used in this range.

View File

@@ -65,24 +65,23 @@ interpolation points.
In this section we detail the TLV serialization for a general `payout_function`.
#### Version 0 payout_function
#### payout_function
1. type: 42790 (`payout_function_v0`)
2. data:
* [`u16`:`num_pieces`]
* [`bigsize`:`endpoint_0`]
* [`bigsize`:`endpoint_payout_0`]
1. data:
* [`bigsize`:`num_pieces`]
* [`u64`:`endpoint_0`]
* [`u64`:`endpoint_payout_0`]
* [`u16`:`extra_precision_0`]
* [`payout_curve_piece`:`piece_1`]
* [`bigsize`:`endpoint_1`]
* [`u64`:`endpoint_1`]
* ...
* [`payout_curve_piece`:`piece_num_pieces`]
* [`bigsize`:`endpoint_num_pieces`]
* [`bigsize`:`endpoint_payout_num_pieces`]
* [`u64`:`endpoint_num_pieces`]
* [`u64`:`endpoint_payout_num_pieces`]
* [`u16`:`extra_precision_num_pieces`]
`num_pieces` is the number of `payout_curve_pieces` which make up the payout curve along with their endpoints.
Each endpoint consists of a two `bigsize` integers and a `u16`.
Each endpoint consists of a two `u64` and a `u16`.
The first integer is called `endpoint` and contains the actual `event_outcome` which corresponds to an x-coordinate
on the payout curve which is a boundary between curve pieces.
@@ -158,15 +157,16 @@ where a spline is made up of polynomial pieces so that the resulting interpolati
#### Polynomial Serialization
1. type: 42792 (`polynomial_payout_curve_piece`)
2. data:
* [`u16`:`num_pts`]
* [`bigsize`:`event_outcome_1`]
* [`bigsize`:`outcome_payout_1`]
1. implements: `payout_curve_piece`
1. type: 0
1. data:
* [`bigsize`:`num_pts`]
* [`u64`:`event_outcome_1`]
* [`u64`:`outcome_payout_1`]
* [`u16`:`extra_precision_1`]
* ...
* [`bigsize`:`event_outcome_num_pts`]
* [`bigsize`:`outcome_payout_num_pts`]
* [`u64`:`event_outcome_num_pts`]
* [`u64`:`outcome_payout_num_pts`]
* [`u16`:`extra_precision_num_pts`]
`num_pts` is the number of midpoints specified in this curve piece which will be used along with the surrounding `endpoint`s to perform interpolation.
@@ -206,31 +206,33 @@ set `f_1 = b = c = 0, a = 1, d = constant, f_2 = constant'`.
#### Hyperbola Serialization
1. type: 42794 (`hyperbola_payout_curve_piece`)
2. data:
1. implements: `payout_curve_piece`
1. type: 1
1. data:
* [`bool`:`use_positive_piece`]
* [`bool`:`translate_outcome_sign`]
* [`bigsize`:`translate_outcome`]
* [`u64`:`translate_outcome`]
* [`u16`:`translate_outcome_extra_precision`]
* [`bool`:`translate_payout_sign`]
* [`bigsize`:`translate_payout`]
* [`u64`:`translate_payout`]
* [`u16`:`translate_payout_extra_precision`]
* [`bool`:`a_sign`]
* [`bigsize`:`a`]
* [`u64`:`a`]
* [`u16`:`a_extra_precision`]
* [`bool`:`b_sign`]
* [`bigsize`:`b`]
* [`u64`:`b`]
* [`u16`:`b_extra_precision`]
* [`bool`:`c_sign`]
* [`bigsize`:`c`]
* [`u64`:`c`]
* [`u16`:`c_extra_precision`]
* [`bool`:`d_sign`]
* [`bigsize`:`d`]
* [`u64`:`d`]
* [`u16`:`d_extra_precision`]
If `use_positive_piece` is set to true, then `y_1` is used, otherwise `y_2` is used.
Then there are six numeric values represented as a `bool` sign set to true for positive numbers and false for negative ones, a `bigsize` integer, and a `u16` extra precision.
Then there are six numeric values represented as a `bool` sign set to true for positive numbers and false for negative ones, a `u64` integer, and a `u16` extra precision.
To be precise, the numbers used should be: (`num_sign`)( `num + double(num_extra_precision) >> 16`).
The fields `translate_outcome` and `translate_payout` correspond to the values `f_1` and `f_2` respectively.

View File

@@ -66,14 +66,16 @@ the funding transaction and CETs.
1. type: 42778 (`offer_dlc_v0`)
2. data:
* [`u32`: `protocol_version`]
* [`byte`:`contract_flags`]
* [`chain_hash`:`chain_hash`]
* [`32*byte`:`temporary_contract_id`]
* [`contract_info`:`contract_info`]
* [`point`:`funding_pubkey`]
* [`spk`:`payout_spk`]
* [`u64`:`payout_serial_id`]
* [`u64`:`offer_collateral_satoshis`]
* [`u16`:`num_funding_inputs`]
* [`bigsize`:`num_funding_inputs`]
* [`num_funding_inputs*funding_input`:`funding_inputs`]
* [`spk`:`change_spk`]
* [`u64`:`change_serial_id`]
@@ -81,6 +83,12 @@ the funding transaction and CETs.
* [`u64`:`feerate_per_vb`]
* [`u32`:`cet_locktime`]
* [`u32`:`refund_locktime`]
* [`offer_tlvs`: `tlvs`]
[//]: # (TODO: `protocol_version` should be advertised by DLC nodes in the future)
The `protocol_version` value denotes the version of the protocol that the offering node is proposing.
If the receiving node does not support the requested version, it should ignore the message.
The current protocol version is `1`.
No bits of `contract_flags` are currently defined, this field should be ignored.
@@ -90,6 +98,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).
The `temporary_contract_id` is used to identify the contract on a per-peer basis until the funding transaction is established, at which point it is replaced by the contract_id, which is derived from the funding transaction.
`contract_info` specifies the contract to be constructed and the oracles to be used.
`funding_pubkey` is the public key in the 2-of-2 multisig script of
@@ -123,7 +133,8 @@ The sending node MUST:
- set undefined bits in `contract_flags` to 0.
- ensure the `chain_hash` value identifies the chain it wishes to open the contract within.
- set `payout_spk` and `change_spk` to a [standard script pubkey](#script-pubkey-standardness-definition)
- set `temporary_contract_id` to a random value.
- set `payout_spk` and `change_spk` to a [standard script pubkey](#script-pubkey-standardness-definition).
- set `funding_pubkey` to a valid secp256k1 pubkey in compressed format.
- set `offer_collateral_satoshis` to a value greater than or equal to 1000.
- set `cet_locktime` and `refund_locktime` to either both be UNIX timestamps, or both be block heights as distinguished [here](https://en.bitcoin.it/wiki/NLockTime).
@@ -142,6 +153,7 @@ The sending node SHOULD:
The receiving node MUST:
- ensure that the `temporary_contract_id` is unique from any other contract ID with the same peer.
- ignore undefined bits in `contract_flags`.
The receiving node MAY reject the contract if:
@@ -156,6 +168,7 @@ The receiving node MAY reject the contract if:
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 `temporary_contract_id` is not unique from any other contract ID with the same peer.
- the `contract_info` refers to events unknown to the receiver.
- the `contract_info` refers to an oracle unknown or inaccessible to the receiver.
- `payout_spk` or `change_spk` are not a [standard script pubkey](#script-pubkey-standardness-definition).
@@ -176,25 +189,28 @@ and closing transactions.
1. type: 42780 (`accept_dlc_v0`)
2. data:
* [`u32`: `protocol_version`]
* [`32*byte`:`temporary_contract_id`]
* [`u64`:`accept_collateral_satoshis`]
* [`point`:`funding_pubkey`]
* [`spk`:`payout_spk`]
* [`u64`:`payout_serial_id`]
* [`u16`:`num_funding_inputs`]
* [`bigsize`:`num_funding_inputs`]
* [`num_funding_inputs*funding_input`:`funding_inputs`]
* [`spk`:`change_spk`]
* [`u64`:`change_serial_id`]
* [`cet_adaptor_signatures`:`cet_adaptor_signatures`]
* [`signature`:`refund_signature`]
* [`negotiation_fields`:`negotiation_fields`]
* [`negotiation_fields`:`negotiation_fields`] (Optional: 1)
* [`accept_tlvs`: `tlvs`]
#### Requirements
The `temporary_contract_id` MUST be the SHA256 hash of the `offer_dlc` message.
The `temporary_contract_id` MUST be the same as the `temporary_contract_id` in the `offer_contract` message.
The sender MUST:
- set `protocol_version` to the same value as the one in the received `offer_dlc` message.
- set `accept_collateral_satoshis` to equal the `offer_dlc`'s `contract_info` `total_collateral` minus the `offer_collateral_satoshis`.
- set `payout_spk` and `change_spk` to a [standard script pubkey](#script-pubkey-standardness-definition)
- 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.
@@ -243,15 +259,18 @@ This message introduces the [`contract_id`](#definition-of-contract_id) to ident
1. type: 42782 (`sign_dlc_v0`)
2. data:
* [`u32`: `protocol_version`]
* [`contract_id`:`contract_id`]
* [`cet_adaptor_signatures`:`cet_adaptor_signatures`]
* [`signature`:`refund_signature`]
* [`funding_signatures`:`funding_signatures`]
* [`sign_tlvs`: `tlvs`]
#### Requirements
The sender MUST:
- set `protocol_version` to the same value as the one in the sent `offer_dlc` message.
- set `contract_id` by exclusive-OR of the `funding_txid`, the `funding_output_index` and the `temporary_contract_id` 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.
- include an adaptor signature in `cet_adaptor_signatures` for every event specified in the `offer_dlc`'s `contract_info`.

View File

@@ -0,0 +1,210 @@
{
"offer_message": {
"message": {
"protocolVersion": 1,
"contractFlags": 0,
"chainHash": "06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f",
"temporaryContractId": "3f62c0b0d2e58985b50312d79f567c1e24e73c9020e39bb55e35b2a78cbc8916",
"contractInfo": {
"singleContractInfo": {
"totalCollateral": 200000000,
"contractInfo": {
"contractDescriptor": {
"enumeratedContractDescriptor": {
"payouts": [
{
"outcome": "a",
"localPayout": 200000000
},
{
"outcome": "b",
"localPayout": 0
},
{
"outcome": "c",
"localPayout": 200000000
},
{
"outcome": "d",
"localPayout": 0
}
]
}
},
"oracleInfo": {
"multi": {
"threshold": 3,
"oracleAnnouncements": [
{
"announcementSignature": "40dd8917551273b0995586415ea0d1cd563fe09ee7c23ef71e7f3d597e08b9d5563a626b5edcfa7ba3d5b169bf3b9b5b430c17fa92d9e1cf573a5fb72b6e1ada",
"oraclePublicKey": "b97e84e1988de11297b4f2088a723a8904e8bde65bbb06fdb8852254c8cc2c4f",
"oracleEvent": {
"oracleNonces": [
"381efae1b4b83eb060d0468c018d685f6c915f2c48e37114a90f9541964ed2af"
],
"eventMaturityEpoch": 1623133104,
"eventDescriptor": {
"enumEvent": {
"outcomes": [
"a",
"b",
"c",
"d"
]
}
},
"eventId": "Test"
}
},
{
"announcementSignature": "5bbc6f506e27cb14cc1dcd633da10e9c946bb872fbc483c9287dafd693c3a2ddf9b6a5b399facb899e96949658e8e733ff5b6b678cf6624869d7fb77182b509d",
"oraclePublicKey": "ef68ed382aad934c786739302d131ac3cc7257004b32c9fe361fe01ed404d639",
"oracleEvent": {
"oracleNonces": [
"08298599cb25d5efa5924024a7c35801cc1ac5d284f8ecfb99d3db67262c1a33"
],
"eventMaturityEpoch": 1623133104,
"eventDescriptor": {
"enumEvent": {
"outcomes": [
"a",
"b",
"c",
"d"
]
}
},
"eventId": "Test"
}
},
{
"announcementSignature": "b61e9ad9ab7205bb37740ec2f75db8f48a66ed29fc7e9a08a33e6e9a12f8a1f63e2edadad892293b7efb5d9691f73e1fbcbf134e1dc60ff57536f765c9a5ba4a",
"oraclePublicKey": "7ef162d300c7454fd86403b9c73e79b84839653c2c6a144c794df289fd66303d",
"oracleEvent": {
"oracleNonces": [
"6b0962ff4e444806f0fbc588ba6250514bf26b6323cdc16a8b8d5f0b0b4e630d"
],
"eventMaturityEpoch": 1623133104,
"eventDescriptor": {
"enumEvent": {
"outcomes": [
"a",
"b",
"c",
"d"
]
}
},
"eventId": "Test"
}
}
],
"oracleParams": null
}
}
}
}
},
"fundingPubkey": "02abea992869cb905be0f6fde98ce2448741504b3d2a2ae8933064f7371ea0267e",
"payoutSpk": "0014d34ff7f9a8fc804ff05e20e7a29a4eeada9e51e5",
"payoutSerialId": 3105154226838036862,
"offerCollateral": 100000000,
"fundingInputs": [
{
"inputSerialId": 16924049837702443162,
"prevTx": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03520101ffffffff0200f2052a01000000160014cc6a78085a467c442acb8140ff33d1fbd61ba9bc0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"prevTxVout": 0,
"sequence": 4294967295,
"maxWitnessLen": 107,
"redeemScript": ""
}
],
"changeSpk": "0014f8140840d6ef2a7d63e749e9c0d8fc35a59ce8c3",
"changeSerialId": 1268814263800591591,
"fundOutputSerialId": 18023717729201319151,
"feeRatePerVb": 2,
"cetLocktime": 1623133104,
"refundLocktime": 1623737904
},
"serialized": "a71a000000010006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f3f62c0b0d2e58985b50312d79f567c1e24e73c9020e39bb55e35b2a78cbc891600000000000bebc20000040161000000000bebc200016200000000000000000163000000000bebc2000164000000000000000001000303fdd8249d40dd8917551273b0995586415ea0d1cd563fe09ee7c23ef71e7f3d597e08b9d5563a626b5edcfa7ba3d5b169bf3b9b5b430c17fa92d9e1cf573a5fb72b6e1adab97e84e1988de11297b4f2088a723a8904e8bde65bbb06fdb8852254c8cc2c4ffdd822390001381efae1b4b83eb060d0468c018d685f6c915f2c48e37114a90f9541964ed2af60bf0bb0fdd8060a000401610162016301640454657374fdd8249d5bbc6f506e27cb14cc1dcd633da10e9c946bb872fbc483c9287dafd693c3a2ddf9b6a5b399facb899e96949658e8e733ff5b6b678cf6624869d7fb77182b509def68ed382aad934c786739302d131ac3cc7257004b32c9fe361fe01ed404d639fdd82239000108298599cb25d5efa5924024a7c35801cc1ac5d284f8ecfb99d3db67262c1a3360bf0bb0fdd8060a000401610162016301640454657374fdd8249db61e9ad9ab7205bb37740ec2f75db8f48a66ed29fc7e9a08a33e6e9a12f8a1f63e2edadad892293b7efb5d9691f73e1fbcbf134e1dc60ff57536f765c9a5ba4a7ef162d300c7454fd86403b9c73e79b84839653c2c6a144c794df289fd66303dfdd8223900016b0962ff4e444806f0fbc588ba6250514bf26b6323cdc16a8b8d5f0b0b4e630d60bf0bb0fdd8060a0004016101620163016404546573740002abea992869cb905be0f6fde98ce2448741504b3d2a2ae8933064f7371ea0267e00160014d34ff7f9a8fc804ff05e20e7a29a4eeada9e51e52b17b951477be17e0000000005f5e10001eade4da8f142f09aa8020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03520101ffffffff0200f2052a01000000160014cc6a78085a467c442acb8140ff33d1fbd61ba9bc0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9012000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff006b000000160014f8140840d6ef2a7d63e749e9c0d8fc35a59ce8c3119bbbd9b7c874e7fa211bc7ecf46cef000000000000000260bf0bb060c84630"
},
"accept_message": {
"message": {
"protocolVersion": 1,
"temporaryContractId": "3f62c0b0d2e58985b50312d79f567c1e24e73c9020e39bb55e35b2a78cbc8916",
"acceptCollateral": 100000000,
"fundingPubkey": "02daed087a6471a29fca4ea91c4beb6c63f33c2a9b3fde4d4f31bbc38bdf762d93",
"payoutSpk": "00146a2a24f1bc1ca8089aa46b0580d670fe6e496d93",
"payoutSerialId": 18025622004646536656,
"fundingInputs": [
{
"inputSerialId": 7941682260973188694,
"prevTx": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0200f2052a010000001600141734d1e9e7a3a71bc29351adaecedfae81448d2c0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"prevTxVout": 0,
"sequence": 4294967295,
"maxWitnessLen": 107,
"redeemScript": ""
}
],
"changeSpk": "001428bfc5a1aecf18a72b07b3e2d8240a3250ca1c92",
"changeSerialId": 5037010087475615394,
"cetAdaptorSignatures": {
"ecdsaAdaptorSignatures": [
{
"signature": "0203eacd8558aa21dc2abee2258ccd378107ce5574b11d6a6d66d094d1621c0db703f7d940734982583d49f506d4d6f240249279b381c4e90e5dc0a43d00cd256ba51ed50113e62d97581eec95266c859732fa78b5e5d0b5ac4b5d212c3bdf540d0f8be03a9431fe5285164f34f983dec10caf05b4cb262626a2f73c9b5efd4fc0dfbff8482149ab1a220c3833a80943a8ecf2c0144b58b0fa75436a0f7272b8f2c0"
},
{
"signature": "023be9e5673347b7c94ce624e96232bc4c16bc90f51b1e1e987a2e5481318ce86f020ca7c932e4cbcc86110ab00fc5b013cf14195de7256c97d7da06da41d320f28f5d62b0cc39e16bf060d1b23c5d654bbd59eb084d7cabe85174239bbbba3ba6c9f069643a5b8e3ca460f31911184159a3d135a3edf7a77cc3488dd5fc96b5b665097a30e6771b1feda3ebad0df01694e1f4d5a556013cb2a4fc01f2363e789315"
},
{
"signature": "03a82d463a83e5f529d42de1c60dcc9ff8250040e6967059ab6856145e22b53f8f032a17d885f89d20d13d220beac06fc4317f1a6db9fc181ccc744907e2e4e8f7bc36adebb773ac25266b2c838ba339a8e5409810723f4d9125f972b5edab7d6a1f679fc00cba68a5c201049431de5fb76ae8796d18a6c8900c33bfbc1df3a1d5c4ac2c4f68f5cc3ab8eb8050221b50fb15155b42fcdb94caa81f761606d4ef08b3"
},
{
"signature": "03735bc03310fa75002f8adba9a9ea5535ba06b48eb431d824dabdf19c03d1b25d0231633344fe710a1d3975101817aaeebb2d8398205b625eeba00780f62b430ea44c983c4210b39391416508eb8e0839673da67321c908e530b6d78a78d2945e90d7b65d2e6b5107ff72141316ae0163cbb2510024729b7c8bade9e14ae0ad2451c15f4d177c11436bf27fafd565401484c5dfa4ec250d011596f877ad39e4b650"
}
]
},
"refundSignature": "304402206331b94cc58975d10a6c4fc2bb2c80df0ffe53a04ba79fee9def143647bd680e022017eeba656ee796e33f3f5df6715836731c3a67fb94019637ef6dbe16b055bc23",
"negotiationFields": null
},
"serialized": "a71c000000013f62c0b0d2e58985b50312d79f567c1e24e73c9020e39bb55e35b2a78cbc89160000000005f5e10002daed087a6471a29fca4ea91c4beb6c63f33c2a9b3fde4d4f31bbc38bdf762d93001600146a2a24f1bc1ca8089aa46b0580d670fe6e496d93fa27dfb59a6be5d0016e3685f08453f656a8020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0200f2052a010000001600141734d1e9e7a3a71bc29351adaecedfae81448d2c0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9012000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff006b00000016001428bfc5a1aecf18a72b07b3e2d8240a3250ca1c9245e70dfcc20b16a2040203eacd8558aa21dc2abee2258ccd378107ce5574b11d6a6d66d094d1621c0db703f7d940734982583d49f506d4d6f240249279b381c4e90e5dc0a43d00cd256ba51ed50113e62d97581eec95266c859732fa78b5e5d0b5ac4b5d212c3bdf540d0f8be03a9431fe5285164f34f983dec10caf05b4cb262626a2f73c9b5efd4fc0dfbff8482149ab1a220c3833a80943a8ecf2c0144b58b0fa75436a0f7272b8f2c0023be9e5673347b7c94ce624e96232bc4c16bc90f51b1e1e987a2e5481318ce86f020ca7c932e4cbcc86110ab00fc5b013cf14195de7256c97d7da06da41d320f28f5d62b0cc39e16bf060d1b23c5d654bbd59eb084d7cabe85174239bbbba3ba6c9f069643a5b8e3ca460f31911184159a3d135a3edf7a77cc3488dd5fc96b5b665097a30e6771b1feda3ebad0df01694e1f4d5a556013cb2a4fc01f2363e78931503a82d463a83e5f529d42de1c60dcc9ff8250040e6967059ab6856145e22b53f8f032a17d885f89d20d13d220beac06fc4317f1a6db9fc181ccc744907e2e4e8f7bc36adebb773ac25266b2c838ba339a8e5409810723f4d9125f972b5edab7d6a1f679fc00cba68a5c201049431de5fb76ae8796d18a6c8900c33bfbc1df3a1d5c4ac2c4f68f5cc3ab8eb8050221b50fb15155b42fcdb94caa81f761606d4ef08b303735bc03310fa75002f8adba9a9ea5535ba06b48eb431d824dabdf19c03d1b25d0231633344fe710a1d3975101817aaeebb2d8398205b625eeba00780f62b430ea44c983c4210b39391416508eb8e0839673da67321c908e530b6d78a78d2945e90d7b65d2e6b5107ff72141316ae0163cbb2510024729b7c8bade9e14ae0ad2451c15f4d177c11436bf27fafd565401484c5dfa4ec250d011596f877ad39e4b6506331b94cc58975d10a6c4fc2bb2c80df0ffe53a04ba79fee9def143647bd680e17eeba656ee796e33f3f5df6715836731c3a67fb94019637ef6dbe16b055bc2300"
},
"sign_message": {
"message": {
"protocolVersion": 1,
"contractId": "f125a70271584b7997be574e4bc8bc23853c94676f5edec21fad67277b11f61a",
"cetAdaptorSignatures": {
"ecdsaAdaptorSignatures": [
{
"signature": "021275449eb0179dcae72a32b0fdf43eea60947e70c5ecea46732a622d12127f0a022d16d14d93ef1544d620bd42442a4c80fd9918e5286dc15da983ebf389b2cf78d1d5bd5b14ebdf46279186df9f5beb878b746897275a94ac12676dc0e16fab81608cd1be9a79bc75155c4234a061a743621e0b64ff7acea8063acdd6792d0ae8ab066d3d9d23a882e12c73c54fbf448d417ad8b3198b3a6223e3ea14ab57bf3d"
},
{
"signature": "0264aad8093af3fdbc572b4f9b433964408d7130149ef256c3d80007a33271eead02bb086d6db46c9425a437ff23a5d199fffbf69e0ee1e2235fb85350605dca94f6d88a4e7ea616314d6e7cb45c7c5bd88f0bf48e8779bf2c91494646bbf1578bc4f496e1c69d2ab551b13e0900e95695b1c28a2309ab9e2de26f0bbb0a2293a68c71c554b052bdc5d9499426604467ad95ef5c54f664d7c7469736ce81b51023da"
},
{
"signature": "0295ec0840b663fb7e8c00193cfa52d7cb64c6b623af8e83a09e772e22dbc1ae45039200ea68e3f229303b5f6768810bd94e85a789d0cea10a7f64a8fa912b14b2dfc28f1f77134db2a63e0abab82e009bbf06ca38b6a7b038ee789b3301f69537c3b13a9533b971a8e1da6d4317e1a9e546aebb5f23c3097c3d03dc7c734e73e0171d27fd1eafd1fc9b98c0373922844ddc5eba071185a10a0674399c3b9d164453"
},
{
"signature": "022d45bd6be2784e003925c65224279be3a7e0dd068d9e1d1d00aa5c90282c0af00312c7e385dc3fe65590339f5feb0630869799d7edd652e7e71e88ed51eca67c849d0d26f0ad08e7cd2ce392db5af194221ec5e0f57a1a7c44ac8f6f7146a5d2149b1577429d1a1d71524f625a0b58ae68675162f2e3e40b3b9b02af57f0cc045526236e6944d6b2786f5e18888864cc486eebd3d16701cf44d687203c48ac9418"
}
]
},
"refundSignature": "304402205ae12fe9aa1ba16503137d81c95e462bd28b0e1b421a78934226d7e42487f9830220388952f814a81d8b6f98c2052940f14ade4feca72a14f6dc98e5d9d46e521d32",
"fundingSignatures": {
"fundingSignatures": [
{
"witnessElements": [
{
"witness": "304402200a3eb011cde10ab37b97e6cc3d8abd63852d676e96123f04252518e3e0d4eb8b02207685ec55656ea7bc98374707199d33890735561cbf371fe4421605ced01e2b1801"
},
{
"witness": "037867483e5f4222e4f1fa6f4a279fa8d56436cb7a28e39acd40eaf9bc1a6cd3c6"
}
]
}
]
}
},
"serialized": "a71e00000001f125a70271584b7997be574e4bc8bc23853c94676f5edec21fad67277b11f61a04021275449eb0179dcae72a32b0fdf43eea60947e70c5ecea46732a622d12127f0a022d16d14d93ef1544d620bd42442a4c80fd9918e5286dc15da983ebf389b2cf78d1d5bd5b14ebdf46279186df9f5beb878b746897275a94ac12676dc0e16fab81608cd1be9a79bc75155c4234a061a743621e0b64ff7acea8063acdd6792d0ae8ab066d3d9d23a882e12c73c54fbf448d417ad8b3198b3a6223e3ea14ab57bf3d0264aad8093af3fdbc572b4f9b433964408d7130149ef256c3d80007a33271eead02bb086d6db46c9425a437ff23a5d199fffbf69e0ee1e2235fb85350605dca94f6d88a4e7ea616314d6e7cb45c7c5bd88f0bf48e8779bf2c91494646bbf1578bc4f496e1c69d2ab551b13e0900e95695b1c28a2309ab9e2de26f0bbb0a2293a68c71c554b052bdc5d9499426604467ad95ef5c54f664d7c7469736ce81b51023da0295ec0840b663fb7e8c00193cfa52d7cb64c6b623af8e83a09e772e22dbc1ae45039200ea68e3f229303b5f6768810bd94e85a789d0cea10a7f64a8fa912b14b2dfc28f1f77134db2a63e0abab82e009bbf06ca38b6a7b038ee789b3301f69537c3b13a9533b971a8e1da6d4317e1a9e546aebb5f23c3097c3d03dc7c734e73e0171d27fd1eafd1fc9b98c0373922844ddc5eba071185a10a0674399c3b9d164453022d45bd6be2784e003925c65224279be3a7e0dd068d9e1d1d00aa5c90282c0af00312c7e385dc3fe65590339f5feb0630869799d7edd652e7e71e88ed51eca67c849d0d26f0ad08e7cd2ce392db5af194221ec5e0f57a1a7c44ac8f6f7146a5d2149b1577429d1a1d71524f625a0b58ae68675162f2e3e40b3b9b02af57f0cc045526236e6944d6b2786f5e18888864cc486eebd3d16701cf44d687203c48ac94185ae12fe9aa1ba16503137d81c95e462bd28b0e1b421a78934226d7e42487f983388952f814a81d8b6f98c2052940f14ade4feca72a14f6dc98e5d9d46e521d32010247304402200a3eb011cde10ab37b97e6cc3d8abd63852d676e96123f04252518e3e0d4eb8b02207685ec55656ea7bc98374707199d33890735561cbf371fe4421605ced01e2b180121037867483e5f4222e4f1fa6f4a279fa8d56436cb7a28e39acd40eaf9bc1a6cd3c6"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,164 @@
{
"offer_message": {
"message": {
"protocolVersion": 1,
"contractFlags": 0,
"chainHash": "06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f",
"temporaryContractId": "50a38b0f6bc6627a330f93ef62b1685e45d390f0c2e008784a494ae3f77e0475",
"contractInfo": {
"singleContractInfo": {
"totalCollateral": 200000000,
"contractInfo": {
"contractDescriptor": {
"enumeratedContractDescriptor": {
"payouts": [
{
"outcome": "a",
"localPayout": 200000000
},
{
"outcome": "b",
"localPayout": 0
},
{
"outcome": "c",
"localPayout": 200000000
},
{
"outcome": "d",
"localPayout": 0
}
]
}
},
"oracleInfo": {
"single": {
"oracleAnnouncement": {
"announcementSignature": "288a4ac72f3f627ceecf61753f94c437f9e761950ce1dd4ad787cdf6f525ce11b6cea81689ad41511d4366db5fb591b40864f59c4e9e0cf2c7dac89224d98c55",
"oraclePublicKey": "3d563caec479d618bad3cb0e844f57dcd977f23e5d6d84e1e3be51bb33133cb0",
"oracleEvent": {
"oracleNonces": [
"5c1785f8ab4273d56ac67d4b0429c40107cec5875246a2b68872792c2096e3a7"
],
"eventMaturityEpoch": 1623133104,
"eventDescriptor": {
"enumEvent": {
"outcomes": [
"a",
"b",
"c",
"d"
]
}
},
"eventId": "Test"
}
}
}
}
}
}
},
"fundingPubkey": "0284014ca41f49f56553b01d7da4f6c19afed76ac5d2fecde0bab6a878b57092ed",
"payoutSpk": "00148ac3370f8bb5840112756ec4a48d4f417c958b68",
"payoutSerialId": 4891480442309882974,
"offerCollateral": 100000000,
"fundingInputs": [
{
"inputSerialId": 5330895180221467292,
"prevTx": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03520101ffffffff0200f2052a01000000160014dbd4ce44e8f4db05f35ca1c16378c56017b0582b0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"prevTxVout": 0,
"sequence": 4294967295,
"maxWitnessLen": 107,
"redeemScript": ""
}
],
"changeSpk": "0014b742726c4817779988527052274d2a6f95c2cfb1",
"changeSerialId": 15716098011649384884,
"fundOutputSerialId": 9046284180399923145,
"feeRatePerVb": 2,
"cetLocktime": 1623133104,
"refundLocktime": 1623737904
},
"serialized": "a71a000000010006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f50a38b0f6bc6627a330f93ef62b1685e45d390f0c2e008784a494ae3f77e047500000000000bebc20000040161000000000bebc200016200000000000000000163000000000bebc2000164000000000000000000fdd8249d288a4ac72f3f627ceecf61753f94c437f9e761950ce1dd4ad787cdf6f525ce11b6cea81689ad41511d4366db5fb591b40864f59c4e9e0cf2c7dac89224d98c553d563caec479d618bad3cb0e844f57dcd977f23e5d6d84e1e3be51bb33133cb0fdd8223900015c1785f8ab4273d56ac67d4b0429c40107cec5875246a2b68872792c2096e3a760bf0bb0fdd8060a0004016101620163016404546573740284014ca41f49f56553b01d7da4f6c19afed76ac5d2fecde0bab6a878b57092ed001600148ac3370f8bb5840112756ec4a48d4f417c958b6843e2078bcda6b45e0000000005f5e1000149fb24ec0ff14a9ca8020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03520101ffffffff0200f2052a01000000160014dbd4ce44e8f4db05f35ca1c16378c56017b0582b0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9012000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff006b000000160014b742726c4817779988527052274d2a6f95c2cfb1da1acbdfc795a1b47d8adb8865f91fc9000000000000000260bf0bb060c84630"
},
"accept_message": {
"message": {
"protocolVersion": 1,
"temporaryContractId": "50a38b0f6bc6627a330f93ef62b1685e45d390f0c2e008784a494ae3f77e0475",
"acceptCollateral": 100000000,
"fundingPubkey": "02ccce3c8cbe1967575f842c2e2cec30544e538b2bbbf70c1d8addd9cc7a88d313",
"payoutSpk": "00147e55961083dcce1e327fbb196a8c5018212ff271",
"payoutSerialId": 11737905950571233819,
"fundingInputs": [
{
"inputSerialId": 4569206667490474259,
"prevTx": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0200f2052a0100000016001443ee3f9efb953a807a2b6b2ade822ed00e97620b0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000",
"prevTxVout": 0,
"sequence": 4294967295,
"maxWitnessLen": 107,
"redeemScript": ""
}
],
"changeSpk": "0014c7fdaa6779e2c5845d6f5034c4830cedf3b3fb17",
"changeSerialId": 13981087499650180058,
"cetAdaptorSignatures": {
"ecdsaAdaptorSignatures": [
{
"signature": "03a6413efb4b1c27f42230c16fca661e32cfd7da73695abbcfc6d1f300c97255a702ccf9d57a60f445d00ca6f640ba5aa1561faaf4c8542a92dce60fa11ffe3726de8087673c9ca83320b28c974819089e599794cd4a5c9702c0fc77fff62db208ceec6e09492e20a3e6a6b58e3bdd5dcb279b151b13c8bc33c178c210054ad9aa522c98f3ccbdbbbc1a4226214aa5a03db358e0331f64731a7ea2a7bf5785596d3d"
},
{
"signature": "03303735fb8d39465519ce0d474a298ef9b9561401c5c69c182a053b032eebda3e021bf934cd86039649169ee8a55a6796fa7a8a5f53ddfb12ae9586dbfee133221aa8bbe19cd239babbd1cb1554a39f3751aaa1f0848fcb0e9ef559403db443f4adca06e22dfc88e5100e742775ce6c43e563ef80f882b5307018f704ec85ea46c8b07f19f5990fbb3dbd8a4406480d7961e067e4789a54f4f25ef78c01c6f0b372"
},
{
"signature": "0391e9c21152564e49dcdc32e574f4b39822d9f959ed24111735355cb6916be2e50271533f1d9314b2bc04cbc511c69378d704e376df8fbdd5ebf8b17814475d0004ea6b9ee32f3939816222e887b90f2233f88a9ea313564e34c075a170b7b28a78e7d2976419e74a8a44763c1a14652d436b79a26af0a3105e7bcbd7e0839e1cf2841fa9914a880906be18432bfc5e886d19e72e9027171d67f384d703f2bb6535"
},
{
"signature": "03dd02a7b411a3e7f5a511baf880b8d75a68f8b861aac6815617282cd73a2ea6b102a353d67381ab4cb233ee6596c3f3e17bca06070aea52927b9571835968b1ac42633976c3466bdfc07244080d4e4061a9d794e14c432cae021ebd433b9ea00b788a4d0ec1a4c30443560afa2fcd75815472d082141d27b087a13bb85e33a17af9753dac8a626bbe648fd6e6ce06000d0b93f081af3b6469d8ecb2161a998ae445"
}
]
},
"refundSignature": "304402203a6439522713098d312856a32de541692ea73c5eb5308e29d6e2387a3bc7f7960220672fa4b5cd0f347c7b8ede876c275412402ed42781137bb195fe7da04b0f3abf",
"negotiationFields": null
},
"serialized": "a71c0000000150a38b0f6bc6627a330f93ef62b1685e45d390f0c2e008784a494ae3f77e04750000000005f5e10002ccce3c8cbe1967575f842c2e2cec30544e538b2bbbf70c1d8addd9cc7a88d313001600147e55961083dcce1e327fbb196a8c5018212ff271a2e56b459ebe021b013f691541611db913a8020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0200f2052a0100000016001443ee3f9efb953a807a2b6b2ade822ed00e97620b0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9012000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff006b000000160014c7fdaa6779e2c5845d6f5034c4830cedf3b3fb17c206cd01864da3da0403a6413efb4b1c27f42230c16fca661e32cfd7da73695abbcfc6d1f300c97255a702ccf9d57a60f445d00ca6f640ba5aa1561faaf4c8542a92dce60fa11ffe3726de8087673c9ca83320b28c974819089e599794cd4a5c9702c0fc77fff62db208ceec6e09492e20a3e6a6b58e3bdd5dcb279b151b13c8bc33c178c210054ad9aa522c98f3ccbdbbbc1a4226214aa5a03db358e0331f64731a7ea2a7bf5785596d3d03303735fb8d39465519ce0d474a298ef9b9561401c5c69c182a053b032eebda3e021bf934cd86039649169ee8a55a6796fa7a8a5f53ddfb12ae9586dbfee133221aa8bbe19cd239babbd1cb1554a39f3751aaa1f0848fcb0e9ef559403db443f4adca06e22dfc88e5100e742775ce6c43e563ef80f882b5307018f704ec85ea46c8b07f19f5990fbb3dbd8a4406480d7961e067e4789a54f4f25ef78c01c6f0b3720391e9c21152564e49dcdc32e574f4b39822d9f959ed24111735355cb6916be2e50271533f1d9314b2bc04cbc511c69378d704e376df8fbdd5ebf8b17814475d0004ea6b9ee32f3939816222e887b90f2233f88a9ea313564e34c075a170b7b28a78e7d2976419e74a8a44763c1a14652d436b79a26af0a3105e7bcbd7e0839e1cf2841fa9914a880906be18432bfc5e886d19e72e9027171d67f384d703f2bb653503dd02a7b411a3e7f5a511baf880b8d75a68f8b861aac6815617282cd73a2ea6b102a353d67381ab4cb233ee6596c3f3e17bca06070aea52927b9571835968b1ac42633976c3466bdfc07244080d4e4061a9d794e14c432cae021ebd433b9ea00b788a4d0ec1a4c30443560afa2fcd75815472d082141d27b087a13bb85e33a17af9753dac8a626bbe648fd6e6ce06000d0b93f081af3b6469d8ecb2161a998ae4453a6439522713098d312856a32de541692ea73c5eb5308e29d6e2387a3bc7f796672fa4b5cd0f347c7b8ede876c275412402ed42781137bb195fe7da04b0f3abf00"
},
"sign_message": {
"message": {
"protocolVersion": 1,
"contractId": "c4b20c1093c2a0e9abf1292339b4c74a46a8c086e7b0020229f58469257f3b27",
"cetAdaptorSignatures": {
"ecdsaAdaptorSignatures": [
{
"signature": "03cc5007225e2faba8558693e7114528d336b88e4eef545fe50eb1cc802c163863034b900a603964017e3c5f1e7042c19b806f143ac23099a28944b9296163379b9f18a9579128b0bac67d7cdc33b11660a282c47e58419ddf83f1820d9e9093b77e0be83c99e041f8c76bbfc88adc3b21bd77649854b794c702fc507dd3ba6981bdb2f080598af23b7a2d0282f174838848c4924bcc800521a2486ab699900124d1"
},
{
"signature": "0321552df9fe5dc1ddafc0f570470013ffeae11da4d2b3d46d8af64dc398b637de02ebe8d05cde0786f7493b36903fbc3973cee897b5b52795550021c3cf536d7770d8c25016716f7b320718e70e637f422417d231be34ffcfca6acfa408f6d46d58b105156c3bdec9d03926eb3a6153760dd2826b330654228a8430f7c447872e006efc633bd0070e6b5abe583f6c6e01a7c8588b6918bbd7217764e1bfd12ecb53"
},
{
"signature": "02ce8463621bfadd4cd23f814621c6d50f1ab7bb7e4089b0b4c2b4da89187150a0023728622f07e9c54f957a9581f81b6f55ed4b2f8e8d792fb90ce5b4a56e91b10c96c3005e43a689733b4d0efabc0040c9e625677e8913b978c39ff494159382c91087629f0a7a6a38893d8861f55bdc777536e2569852d1f3adfe204cc542790611c4d0686752dd6f4fdcce504d981a91ac610365d2ae8508ed14a8667b7de923"
},
{
"signature": "03edb6aa6b1372676377e3188fc5aa9178e57e5fff54283b637c3231685eb4d0680368d5ab2fa22a76aa64d8402391cc8d75d6d149f9c8968c3982b20baedbd79aa644541bd8bb9885be99a7890dd882608f628dab6c1bb0e27d23ddb672db3523194839313be2efa73d945c87ee54bc41cda58c0520b7fb9493113660bfaeb5e37b15626265fd54499a81574800970980cb2b55e596e8395c8c4fdeac1c265e1124"
}
]
},
"refundSignature": "3044022066d4efff70aabf694350e9edcb2028a6fe2e800b1e2383cbbf60e54a987164a502202374952071694c79cc1a86351e8f184fb678b344eb2a9daa2eefcac850b2f4aa",
"fundingSignatures": {
"fundingSignatures": [
{
"witnessElements": [
{
"witness": "3044022006879b1f367adf6ed2d727c9a27660ece53a8cb6ab1cff48d1d573815fdd5e65022049ae6c3a3c62196a26276afd06e2af251790d13015beb188d2c0a4f6cdaac5dc01"
},
{
"witness": "027b48d902e88b706d54f4518395db235c83f1adba64c6c1d290cb1369c09abeb2"
}
]
}
]
}
},
"serialized": "a71e00000001c4b20c1093c2a0e9abf1292339b4c74a46a8c086e7b0020229f58469257f3b270403cc5007225e2faba8558693e7114528d336b88e4eef545fe50eb1cc802c163863034b900a603964017e3c5f1e7042c19b806f143ac23099a28944b9296163379b9f18a9579128b0bac67d7cdc33b11660a282c47e58419ddf83f1820d9e9093b77e0be83c99e041f8c76bbfc88adc3b21bd77649854b794c702fc507dd3ba6981bdb2f080598af23b7a2d0282f174838848c4924bcc800521a2486ab699900124d10321552df9fe5dc1ddafc0f570470013ffeae11da4d2b3d46d8af64dc398b637de02ebe8d05cde0786f7493b36903fbc3973cee897b5b52795550021c3cf536d7770d8c25016716f7b320718e70e637f422417d231be34ffcfca6acfa408f6d46d58b105156c3bdec9d03926eb3a6153760dd2826b330654228a8430f7c447872e006efc633bd0070e6b5abe583f6c6e01a7c8588b6918bbd7217764e1bfd12ecb5302ce8463621bfadd4cd23f814621c6d50f1ab7bb7e4089b0b4c2b4da89187150a0023728622f07e9c54f957a9581f81b6f55ed4b2f8e8d792fb90ce5b4a56e91b10c96c3005e43a689733b4d0efabc0040c9e625677e8913b978c39ff494159382c91087629f0a7a6a38893d8861f55bdc777536e2569852d1f3adfe204cc542790611c4d0686752dd6f4fdcce504d981a91ac610365d2ae8508ed14a8667b7de92303edb6aa6b1372676377e3188fc5aa9178e57e5fff54283b637c3231685eb4d0680368d5ab2fa22a76aa64d8402391cc8d75d6d149f9c8968c3982b20baedbd79aa644541bd8bb9885be99a7890dd882608f628dab6c1bb0e27d23ddb672db3523194839313be2efa73d945c87ee54bc41cda58c0520b7fb9493113660bfaeb5e37b15626265fd54499a81574800970980cb2b55e596e8395c8c4fdeac1c265e112466d4efff70aabf694350e9edcb2028a6fe2e800b1e2383cbbf60e54a987164a52374952071694c79cc1a86351e8f184fb678b344eb2a9daa2eefcac850b2f4aa0102473044022006879b1f367adf6ed2d727c9a27660ece53a8cb6ab1cff48d1d573815fdd5e65022049ae6c3a3c62196a26276afd06e2af251790d13015beb188d2c0a4f6cdaac5dc0121027b48d902e88b706d54f4518395db235c83f1adba64c6c1d290cb1369c09abeb2"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long