Simple miner implementation in scalajs