Skip to content

Add some validity checks for offer messages and oracle announcements#193

Open
Tibo-lg wants to merge 1 commit intodiscreetlogcontracts:masterfrom
Tibo-lg:more-validity-checks
Open

Add some validity checks for offer messages and oracle announcements#193
Tibo-lg wants to merge 1 commit intodiscreetlogcontracts:masterfrom
Tibo-lg:more-validity-checks

Conversation

@Tibo-lg
Copy link
Copy Markdown
Member

@Tibo-lg Tibo-lg commented Apr 22, 2022

Title says it all

Comment thread Protocol.md Outdated
- set `change_serial_id` and `fund_output_serial_id` to different values
- use valid [contract descriptor(s)](./Messaging.md#The-contract_descriptor-Type) within `contract_info`.
- use valid [contract descriptor(s)](./Messaging.md#The-contract_descriptor-Type) within `contract_info`
- set `cet_locktime` to the earliest `event_maturity_epoch` amongst all `oracle_event` used included in the `contract_info`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this strictly necessary? I feel like any time before the earliest oracle announcement is fine (including current block height) so as to avoid any UX issues? (I agree that refund_locktime should be about a week after latest contract execution option)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point thanks! Updated to "less than or equal"

Comment thread Protocol.md Outdated
- The `fund_output_serial_id` and `change_serial_id` are not set to different value
- Any input in `funding_inputs` is not a BIP141 (Segregated Witness) input.
- invalid [contract descriptor(s)](./Messaging.md#The-contract_descriptor-Type) are used within `contract_info`.
- `cet_locktime` is not set to the earliest maturity time of all included oracle events.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I said above, I feel like cet_locktime doesn't need to be so strict (and refund locktime should be far enough away from the latest possible execution)

@Tibo-lg Tibo-lg force-pushed the more-validity-checks branch from f072b0e to bcb97ba Compare April 24, 2022 11:29
Comment thread Protocol.md
- set `refund_locktime` sufficiently long after the latest possible release of oracle signatures added to all other delays to closing the contract.
- set `payout_spk` to a previously unused script public key.
- set `change_spk` to a previously unused script public key.
- set `refund_locktime` to a value not too big that both party can be expected to be refunded in a reasonable time-frame (recommended not more than latest contract maturity + 86400 * 14 meaning 2 weeks after latest contract maturity).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it'd be good to have a recommendation for minimum as well (i.e. recommended no less than 2 days after the latest contract maturity) to give the oracle time to attest in case there are any infrastructure issues

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that cover here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep you're right, looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants