Questions tagged [randomness]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
2 answers
104 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 ...
Amiya Behera's user avatar
5 votes
1 answer
104 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 ...
AlastairHolmes's user avatar
4 votes
2 answers
249 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 ...
Sacha Lansky's user avatar
  • 2,610
4 votes
1 answer
67 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, ...
Luke Schoen's user avatar
  • 2,292
4 votes
1 answer
74 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 ...
JelliedOwl - Paul's user avatar
3 votes
2 answers
214 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, ...
forgetso's user avatar
  • 1,462
3 votes
1 answer
53 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/...
Chralt's user avatar
  • 503
1 vote
1 answer
55 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:/...
Chralt's user avatar
  • 503
0 votes
0 answers
39 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 ...
Boleng's user avatar
  • 413