Module roles_logic_sv2::utils

source ·

Structs§

Enums§

Functions§

  • this function utilizes the equation used in hash_rate_to_target, but translated to solve for hash_rate given a target: h = (2^256-t)/s(t+1) where s is seconds_between_two_consecutive_shares and t is target
  • The pool set a target for each miner. Each target is calibrated on the hashrate of the miner. The following function takes as input a miner hashrate and the shares per minute requested by the pool. The output t is the target (in big endian) for the miner with that hashrate. The miner that mines with target t produces the requested number of shares per minute.
  • It takes a coinbase transaction, a list of transactions, and a list of indices, and returns the merkle root of the transactions at the given indices
  • target = u256_max * (shar_per_min / 60) * (2^32 / hash_per_second) target = u128_max * ((shar_per_min / 60) * (2^32 / hash_per_second) * u128_max)