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

Spec. Leader Coin Evolution #65

Merged
merged 5 commits into from
Feb 6, 2024
Merged

Spec. Leader Coin Evolution #65

merged 5 commits into from
Feb 6, 2024

Conversation

davidrusu
Copy link
Contributor

  • Coin's now have a nonce
  • api to evolve coins: Coin.evolve() which evolves the coins nonce
  • LeaderProofs now have a evolved_commitment which are added to the set of eligible commitments.
  • LedgerState now maintains two sets of commitments:
    • commitments_spend for commitments that are eligible for spending
    • commitments_lead for commitments that are eligible for leading
  • LeaderProofs are coin commitments are verified against two sets, it's eligible if
    • it's in the previous blockscommitments_to_lead ledger_state
    • or it's in the the EpochState's stake distribution snapshot's spendable commitments.


h = blake2b(digest_size=32)
h.update(b"coin-evolve")
h.update(sk_bytes)
Copy link
Contributor

Choose a reason for hiding this comment

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

curious why we include the secret key here

Copy link
Contributor Author

@davidrusu davidrusu Feb 6, 2024

Choose a reason for hiding this comment

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

From the spec, the PRF is keyed by root_c:
Screenshot 2024-02-06 at 9 15 02 PM

Where root_c is the root of the coin's merkle-tree (aka, the secret key)


@property
def pk(self):
return self.sk
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's just a mock, not really important right now. Do you want something like hash(sk)?

Copy link
Contributor

Choose a reason for hiding this comment

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

no need to

@@ -9,7 +9,7 @@ CONTENT-SIZE = U32
BLOCK-DATE = BLOCK-SLOT
BLOCK-SLOT = U64
PARENT-ID = HEADER-ID
MOCK-LEADER-PROOF = COMMITMENT NULLIFIER
MOCK-LEADER-PROOF = COMMITMENT NULLIFIER COMMITMENT
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add a comment explaining which commitment is for what

@davidrusu davidrusu merged commit 0c44788 into master Feb 6, 2024
1 check failed
@davidrusu davidrusu deleted the evolve-leader-coin branch February 6, 2024 21:53
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.

None yet

2 participants