From feec4e5c382b8ab17a1d5adea818ca9f5a389277 Mon Sep 17 00:00:00 2001 From: Clare Laylock Date: Tue, 3 Oct 2023 13:48:48 -0400 Subject: [PATCH] chap 12 tweak --- ch12_mining.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ch12_mining.adoc b/ch12_mining.adoc index d9b5ce29..4271e660 100644 --- a/ch12_mining.adoc +++ b/ch12_mining.adoc @@ -660,9 +660,9 @@ this case to vary the output of the SHA256 commitment to the phrase. To make a challenge out of this algorithm, let's set a target: find a phrase that produces a hexadecimal hash that starts with a zero. -Fortunately, this isn't difficult, as shown in <>: +Fortunately, this isn't difficult, as shown in <>: -[[sha256_example_generator_output]] +[[sha256_example_generator_output2]] .Simple proof-of-work implementation ---- $ for nonce in $( seq 100 ) ; do echo "Hello, world! $nonce" | sha256sum ; done @@ -713,7 +713,7 @@ any possible outcome can be calculated in advance. Therefore, an outcome of specified difficulty constitutes proof of a specific amount of work. ==== -In <>, the winning "nonce" is 32 and +In <>, the winning "nonce" is 32 and this result can be confirmed by anyone independently. Anyone can add the number 32 as a suffix to the phrase "Hello, world!" and compute the hash, verifying that it is less than the target: @@ -740,7 +740,7 @@ below the target. The target and difficulty are inversely related. ==== Bitcoin's Proof-of-Work is very similar to the challenge -shown in <>. The miner constructs a +shown in <>. The miner constructs a candidate block filled with transactions. Next, the miner calculates the hash of this block's header and sees if it is smaller than the current _target_. If the hash is not less than the target, the miner will modify