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

[Framework] Random Number on-chain solution #759

Open
2 tasks
Tracked by #420
jolestar opened this issue Sep 6, 2023 · 6 comments
Open
2 tasks
Tracked by #420

[Framework] Random Number on-chain solution #759

jolestar opened this issue Sep 6, 2023 · 6 comments
Assignees
Labels
skill::move Need the Move language skill to complete the issue skill::rust Need the rust language skill to complete the issue status::design The issue need to do more detail design tasks Task lists issue
Milestone

Comments

@jolestar
Copy link
Contributor

jolestar commented Sep 6, 2023

@jolestar jolestar added status::design The issue need to do more detail design tasks Task lists issue skill::move Need the Move language skill to complete the issue skill::rust Need the rust language skill to complete the issue labels Sep 6, 2023
@jolestar jolestar added this to the Rooch v0.3 milestone Sep 6, 2023
@jolestar jolestar mentioned this issue Sep 6, 2023
14 tasks
@pause125
Copy link
Collaborator

pause125 commented Sep 6, 2023

How about generating random seed in Rust and stored in TxContext, and then read it in contract?

@jolestar
Copy link
Contributor Author

jolestar commented Sep 6, 2023

How about generating random seed in Rust and stored in TxContext, and then read it in contract?

It is unverifiable

@pause125
Copy link
Collaborator

pause125 commented Sep 7, 2023

How about generating random seed in Rust and stored in TxContext, and then read it in contract?

It is unverifiable

May the verifiable feature is not required unless we have consensus mechanism?
We can emit an event every query a random number.

@jolestar
Copy link
Contributor Author

jolestar commented Sep 8, 2023

May the verifiable feature is not required unless we have consensus mechanism?

The transaction needs to be synced to another executor or proposer node, so the execution result must be determinate. Maybe we can put the sequencer's transaction witness data in the TxContext, and sync the transaction and witness data together. #771

@feliciss feliciss self-assigned this Oct 17, 2023
@jolestar jolestar mentioned this issue Oct 19, 2023
12 tasks
@MaggieNgWu
Copy link

ZK-VRF please refer:

https://github.com/zkvrf/zkvrf
https://github.com/jae-cuz/zk-draw

@jolestar
Copy link
Contributor Author

A simple solution:

  1. Let the sequencer generate a random seed and add it to TransactionSequenceInfo.
  2. Include the seed in the data of the sequencer signature.
  3. In the future, we can improve the random seed by zkVRF.
pub struct TransactionSequenceInfo {
    /// The tx order
    pub tx_order: u128,
    /// The tx order signature, it is the signature of the sequencer to commit the tx order.
    pub tx_order_signature: Authenticator,
    /// The tx accumulator root after the tx is append to the accumulator.
    pub tx_accumulator_root: H256,
}

Or can we directly use the tx_order_signature as the random seed?

@jolestar jolestar modified the milestones: Rooch v0.3, Rooch v0.4 Dec 8, 2023
@jolestar jolestar modified the milestones: Rooch v0.5, Rooch v0.6 May 14, 2024
@jolestar jolestar modified the milestones: Rooch v0.6, Rooch v0.7 Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skill::move Need the Move language skill to complete the issue skill::rust Need the rust language skill to complete the issue status::design The issue need to do more detail design tasks Task lists issue
Projects
Status: No status
Development

No branches or pull requests

4 participants