You are viewing a single comment's thread from:

RE: Why was LeoFinance Down For So Long? + miner attack vector

in LeoFinance3 years ago

The random number generation for hive-engine is defined here:
https://github.com/hive-engine/steemsmartcontracts/blob/hive-engine/libs/SmartContracts.js#L134

const rng = seedrandom(`${prevRefHiveBlockId}${refHiveBlockId}${transactionId}`);

the random number function is using rng:
https://github.com/hive-engine/steemsmartcontracts/blob/hive-engine/libs/SmartContracts.js#L180

The mining source code can be found here:
https://github.com/hive-engine/steemsmartcontracts/blob/hive-engine/contracts/mining.js

Sort:  

Ah so it does indeed depend on the block creation of a single witness.
Good to know.
Thanks for sharing this.

Although now I'm wondering which on-chain transactions are used to create inflation as it pertains to the passive mining process.

like the dice game someone abuses a time ago right?

That dice game was EXTREMELY foolish because it only used the signature from the person who was rolling the die. This RNG uses that in addition to the witness signature and blocknum_id and the previous blocknum_id as well.

Ok thanks :D

But is the same with engine miners right?

I'm going to have to recant some of the stuff I said in the OP because the RNG rules for miners are a lot better than I assumed.

OK, thanks.

It's good to know Hive has enough smart tech people to control code :)