Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
130 views

How does randomBytes or extra entropy effect in wallet generation using ethers?

I'm trying to generate new wallet using ethers.js From the examples I got online, randomBytes(16) is used. I wonder if I put randomBytes(128) make any difference. Does it make the wallet generation ...
bbnn's user avatar
  • 236
0 votes
2 answers
77 views

What are the best up-to-date secure approaches of generating pseudorandom number in Solidity? [duplicate]

I am thinking about creating a lottery with more than one winner and one round for users. Please don't consider usual 'commit-reveal' scheme. However, person can claim rewards on their own at the end ...
Victor's user avatar
  • 13
2 votes
0 answers
171 views

Is there any natural source of entropy when running `forge test`?

I'm looking for a pseudo-random value that is different each time the command is run. Either forge test or forge script.
Paul Razvan Berg's user avatar
2 votes
0 answers
223 views

Is there an alternative to Chainlink to get a random number in a solidity contract?

I'm trying to create an NFT that selects at random between 3 json metadata files. The only way I know of to do this is to use Chainlink. I've seen one tutorial that implements "@chainlink/...
ChristianOConnor's user avatar
0 votes
2 answers
264 views

How to generate secure and pure Randomness number without Chainlink VRF?

I found that the Chainlink VRF do not really support all the networks. So, I am considering to use off-chain and make my oracle to generate random number. I have a vague idea just down below Create a ...
DHC's user avatar
  • 387
6 votes
1 answer
2k views

Using block.prevrandao as randomness for Miller-Rabin Primality test

I am interested in using the new PREVRANDAO value as a source of pseudo-randomness in calculating the Miller-Rabin probabilistic primality test on-chain. Chainlink VRF is an option but ideally I would ...
riordant's user avatar
2 votes
3 answers
610 views

How to generate random number and get it at the same time using Chainlink VRFv2?

I need to generate random number, on a single function hit and get it there only. I am not able to do that, due to block confirmations required which is set to min. 3. Is there any way to get this or ...
Manav Notnani's user avatar
1 vote
1 answer
16 views

Link tokens required on Avg for random number generation

Can someone tell how much link tokens are required on an avg. to generate random number via VRF chainlink method??
Manav Notnani's user avatar
2 votes
1 answer
203 views

Can I generate multiple random uint8 from a uint256?

The chainlink VRF returns a uint256, for my application I need a uint8. If I utilize one uint256 and break it up into separate uint8 is that still secure as a source of randomness? Also, what's the ...
Danny B's user avatar
  • 333
1 vote
0 answers
178 views

Random number generator

I am trying to hack a random number generator contract as follows : // SPDX-License-Identifier: MIT pragma solidity 0.8.0; contract Guess { uint256 private randNonce; uint256 private result;...
Ashish kumar's user avatar
1 vote
1 answer
332 views

What is the max number of inputs that can be entered in a keccak256(abi.encodePacked()) function?

I'm learning to use the keccak function on an online Solidity tutorial, and seeing that this function takes three inputs: uint(keccak256(abi.encodePacked(now, msg.sender, randNonce))) made me wonder ...
user avatar
0 votes
2 answers
24 views

How does delaying on-chain randomness effect the security of number guessing games?

Say a number guessing game allows users to submit their guess before block N and reveals the winning number N + 100 games later, which is random number based on the block hashes of block N until block ...
tomwassing's user avatar
2 votes
1 answer
312 views

Randomizing values in mintable NFTs

I've read and written simple smart contracts in the past yet I'm relatively new to getting random data in a transaction, which seems to be harder than I've thought, due to the nature of determinism of ...
Can Poyrazoğlu's user avatar
0 votes
1 answer
458 views

Commit reveal scheme with random number -- user chooses when to reveal... possible?

I've researched commit reveal schemes, but am not sure the following is possible... User mints a playing card. The number of card is hidden. At anytime, the user can choose to reveal the card number. (...
p0pps's user avatar
  • 298
0 votes
2 answers
571 views

On-chain Random Number Generator

I've been doing some research on gasleft() (used to be msg.gas but is now deprecated) and was unable to find any specifics on how or where this value is defined. I was able to find another detailed ...
Sullivan Xiong's user avatar
1 vote
1 answer
2k views

Chainlink VRF fulfillRandomness doesn't use enough gas to perform function - how to get it to use more?

Chainlink VRF allows users to get a random number by calling requestRandomness and then waiting for the fulfillRandomness callback to be called by the Chainlink contract. I have a function ...
greentriangles1's user avatar
0 votes
0 answers
356 views

Alternatives to get LINK tokens in Ropsten, for RNG

Sorry if this question sounds like very newbie (and maybe it is. I'm developing a Smart Contract which needs a random number generation, and after researching some time it seems that ChainLink VRF ...
Alexander Herranz's user avatar
0 votes
1 answer
556 views

Minereum Lucky Draw claims 100% Safe randomness on a smart contract without oracles, is it really possible? [duplicate]

Is the way Minereum Lucky Draw game works really safe 100% onchain RNG and verifiable on smart contract? They claim yes but I would like to know expert technical answer for this, if so, isn't this a ...
Manu's user avatar
  • 9
0 votes
1 answer
601 views

Blockhash Minus-256 Problem [duplicate]

What is meant by Blockhash Minus-256 Problem? I am reading an article at: Bad Randomness It talks about Blockhash Minus-256 problem but does not explain much about it. As a result I can’t ...
zak100's user avatar
  • 1,416
1 vote
1 answer
308 views

How can I convert an element of a byte32 array to number?

The array contains an SHA256 hash. I want to add up 2 hexadecimal values, and later multiply them by 1.125 (only keeping integer). The resulted number would represent an alphanumerical character, it ...
Imestin's user avatar
  • 35