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

doc: Spec of commit public randomness #117

Merged
merged 7 commits into from
Nov 13, 2024
Merged

Conversation

gitferry
Copy link
Member

@gitferry gitferry commented Nov 6, 2024

No description provided.

Copy link
Member

@Lazar955 Lazar955 left a comment

Choose a reason for hiding this comment

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

Nice write-up!


## Commit Process

### Generating a Commit

Choose a reason for hiding this comment

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

I think I would describe here also:

  • full commit message used in Babylon (can be link to Babylon proto file)
  • the format of randomness i.e 32byte public point
  • the merkle tree library used and format of the proof

In general, this spec should have enough details that any body can implement his own randomness committing process.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Added useful links in a73f745

- Construct the merkle tree based on the list of randomness and save the merkle
proof of each randomness to the database indexed by height.
- Construct the commit message based on the root of the merkle tree.
- Sign the commit message and sent a transaction to Babylon.

Choose a reason for hiding this comment

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

I would describe here what data is signed and using which signature algo

@gitferry gitferry force-pushed the gai/docs-commit-pub-rand branch from 66cd184 to a73f745 Compare November 8, 2024 12:10
Copy link

@KonradStaniec KonradStaniec left a comment

Choose a reason for hiding this comment

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

Just a small comment about the fact that spec should be a bit more general, but other than that it looks good.

the request. The details of the generator can be found in [eotsmanager/randgenerator](../eotsmanager/randgenerator/randgenerator.go).
- Construct the merkle tree based on the list of randomness using the CometBFT's [merkle](https://github.com/cometbft/cometbft/tree/main/crypto/merkle)
library.
- Save each randomness along with the merkle

Choose a reason for hiding this comment

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

hmm I think this is to specific to implementation i.e the fact that we store randomnes and merkle proofs in database is how we decided to do things, and not necessary the only way.

Alternative would be to always regenerate randomnes deterministically from the seed at start from the requested height, and keep active merkle tree in the memory.

Given that db is implementation specific, maybe we can commit it from this list ?

In general, given that this is a spec maybe we should generalize this list i.e avoid as many implementation details as possible. Even the fact that we generate randomness using eotsmanager/randgenerator is a bit implementation specific.

Maybe one thing to mention here, is that it is important that one the commitment happens, the committer must be able to always re-create the committed public randomness somehow (and corresponiding private randomness ) as this is later used in EOTS signature and cannot be changed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. Improved at ac29934

@gitferry gitferry merged commit 3de6fd8 into main Nov 13, 2024
12 checks passed
@gitferry gitferry deleted the gai/docs-commit-pub-rand branch November 13, 2024 07:59
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.

3 participants