Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for ASSERT_MY_BIRTH_HEIGHT and ASSERT_MY_BIRTH_SECONDS #144

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Mar 1, 2023

These conditions ensure that the coin asserting were confirmed at a specific block height, or in a block with a specific timestamp.

The condition codes are:

pub const ASSERT_MY_BIRTH_SECONDS: ConditionOpcode = 74;
pub const ASSERT_MY_BIRTH_HEIGHT: ConditionOpcode = 75;

Since this validation can't be done in the parsing step, it's forwarded in the Spend object as two new optional integers.

There are a few cases that need to be validated however. If the same spend asserts different heights or different timestamps, that's an immediate failure.

If the same spend asserts the same height multiple times, that's fine, we just forward that one height (or timestamp).

@arvidn arvidn changed the title add support for ASSERT_MY_HEIGHT and ASSERT_MY_SECONDS add support for ASSERT_MY_BIRTH_HEIGHT and ASSERT_MY_BIRTH_SECONDS Mar 1, 2023
@arvidn arvidn force-pushed the assert-my-birth branch 2 times, most recently from ec1bdf7 to 00ea27f Compare March 1, 2023 16:33
@arvidn arvidn marked this pull request as ready for review March 1, 2023 17:57
Copy link
Contributor

@richardkiss richardkiss left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants