Questions tagged [randomness]
The randomness tag has no usage guidance.
9
questions
0
votes
0
answers
27
views
How to generate random number of a specific length in Substrate pallet
I want to generate random number of a specific length. I can't use insecure-randomness-collective-flip because it's not recommended for production.
I also can't use rand package because it doesn't ...
3
votes
1
answer
58
views
Why doesn't Substrate implement a CSPRNG (Cryptographically Secure Pseudorandom Number Generator)?
In the Rust documentation here it says that the hashing function that a Rust HashMap uses is SipHash. It says SipHash can provide resistance to DoS attacks involving hash tables, not that it will, ...
1
vote
1
answer
49
views
How to implement a production randomness pallet?
Hey valuable community member,
I am currently on a randomness pallet which can be used as a production counterpart to the insecure randomness-collective-flip pallet.
This is my current version:
https:/...
3
votes
1
answer
52
views
What does `no particular order` mean for storage iterations?
I am always curious what the documentation for the storage means when I see the following.
Enumerate all elements in the map in no particular order.
https://paritytech.github.io/substrate/master/...
2
votes
2
answers
196
views
How can I generate a random seed now that self.env.random() is removed in ink?
We were using self.env.random() in our contract to generate a random number. The calling user's AccountId was used to give additional entropy to the random generation.
fn get_random_number(&self, ...
5
votes
1
answer
103
views
Removing randomness-collective-flip pallet from runtime
We recently tried to remove pallet-randomness-collective-flip from our runtime. This pallet has been in our runtime since it was created as it was included in the template-node-runtime, but we never ...
3
votes
2
answers
234
views
How can I use BABE's randomness in my parachain?
I would like to use BABE's randomness for some on-chain logic. IIUC using BABE inside a parachain's runtime is not recommended good practice because there's no fallback for producing blocks if no ...
6
votes
2
answers
102
views
Test is not generating random number
I am trying to generate random number using the tutorial:
#[pallet::config]
pub trait Config: frame_system::Config {
type Event: From<Event<Self>> + IsType<<Self as ...
4
votes
1
answer
73
views
On-chain pseudo-random numbers - agreed by all
I'm looking for a source of random numbers - doesn't need to be cryptographically secure, just hard to predict in advance but agreed by and visible to all participants. I'm thinking about using the ...