The EarthBucks block header is reminiscent of the block header from Bitcoin, but with significant changes.
The fields in the first EarthBucks block header are:
version
: 8-bit value specifying the version of the block header, starting at
0.prev_block_id
: 256-bit double blake3 hash of the previous block header.merkle_root
: 256-bit double blake3 hash constituting the root of the Merkle
tree of transactions in the block.n_transactions
: 64-bit value specifying the number of transactions in the
block.timestamp
: 64-bit value specifying the time of the block in milliseconds
since the Unix epoch.block_num
: 64-bit value specifying the block number, starting at 0.target
: 256-bit unsigned integer specifying the target for the proof-of-work
algorithm. The ID of the block must be less than this value.nonce
: A 256-bit value that can be adjusted to make the block ID less than
the target.work_ser_algo
: A 16-bit value specifying a serial proof-of-work algorithm.work_ser_hash
: A 256-bit hash of the serial work (CPU).work_par_algo
: A 16-bit value specifying a parallel proof-of-work algorithm.work_par_hash
: A 256-bit hash of the parallel work (GPU).The very first EarthBucks blog post talked about GPU mining because that is central to the thesis of EarthBucks: Everybody should be able to mine EarthBucks on their consumer device competitively with professionals.
By designing a GPU mining algorithm specifically for consumer devices, I am discouraging the development of custom ASICs (application-specific integrated circuits), which are designed and developed by professionals only. Part of the plan is to constantly adjust the algorithm with time to make sure that the algorithm continues to match consumer hardware. The best mining experience should always be with off-the-shelf (albeit premium) consumer devices.
To best adjust the algorithm regularly and to minimize disruption to the ecosystem every time the algorithm is changed, I have included two new fields in the EarthBucks block header, one for “parallel work” (on a GPU) and one for “serial work” (on a CPU). The purpose of including both parameters is to make each of them independently adjustable. With time, the proof-of-work algorithms can be independently adjusted as needed to match a typical (top-shelf) consumer device.
The fields in the block header for proof-of-work (PoW) are:
work_ser_algo
: A 16-bit value specifying a serial PoW algorithm (such as
repeated hashes).work_ser_hash
: A 256-bit hash of the serial work.work_par_algo
: A 16-bit value specifying a parallel PoW algorithm (such as
matrix multiplication).work_par_hash
: A 256-bit hash of the parallel work.Mining can be incentivized to be performed on a CPU by performing a hash of a hash of a hash and so on, which must be done in serial because each step depends on the previous step. Meanwhile, mining can be incentivized on the GPU by performing a matrix multiplication, which can be done in parallel.
The first CPU algorithm is blake3_3
, which means running blake3 on the block
header, and then blake3 on that, and then blake3 on that. This is a simple
proof-of-concept (PoC) of a CPU-bound PoW algorithm. There isn’t much reason to
put this on a GPU, because it is done in serial and does not benefit from the
massive parallelization of a GPU.
Meanwhile, the first GPU algorithm is algo1627
, which is basically a large
integer matrix multiplication of size 1627 based on pseudorandom block header
data. It also includes the addition of deterministic floating point operations.
It is designed to perform very well on a typical consumer GPU, which can perform
all the matrix operations in parallel. In a sense, modern GPUs are already ASICs
for this kind of operation, so no one should have a reason to build a custom
ASIC for this algorithm.
Because both algorithms are specified in the block header, they can change with time. The idea is that as consumer devices change, we can update both algorithms independently as needed. If it is discovered that anyone is designing an ASIC, we can simply update the algorithms to make any ASICs obsolete.
The mining algorithm differs from Bitcoin in that extra work is included in every header. The way mining on EarthBucks works is as follows:
Bitcoin only has a nonce and has no notion of “serial work” or “parallel work”.
It is intended that the work algorithms can be upgraded with time by putting new
algorithms into the block header at a specified block number. For instance,
early on, we may choose block number 10,000 to upgrade the serial work algorithm
to blake3_4
and the parallel work algorithm to algo1637
. This would be done
by including the new algorithms in the block header at block number 10,000. The
new algorithms would be used for mining starting at block number 10,000. Future
algorithms have yet to be decided. They will be intentionally undecided and
unannounced until the time comes to upgrade the algorithms.
The remainder of the fields should be self-explanatory to anyone involved in Bitcoin. There are a few differences:
The EarthBucks block header is designed to change with time to accommodate new CPU and GPU mining algorithms independently to maximize the utility of consumer devices and discourage the development of custom ASICs. The block header also includes a few other fields that are not included in the Bitcoin block header, which I believe are useful for non-mining nodes. The EarthBucks block header is designed to be a flexible and useful data structure for the future of EarthBucks.