Skip to content

Commit aac9127

Browse files
committed
fixed images in Ouroboros chapter
1 parent 27b7710 commit aac9127

12 files changed

+23
-10
lines changed

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.1.0

build-epub.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ set -euo pipefail
33

44
# ── book specific ────────────────────────────────────────────────────
55
FILENAME="mastering-cardano"
6-
VERSION="v1.0.0"
6+
VERSION="$(cat VERSION)"
7+
8+
echo "building EPUB for version $VERSION"
79

810
# ── locate toolchain (absolute) ──────────────────────────────────────
911
TNGROOT="$(realpath tools/docbook-xslTNG-2.5.0)"

build-pdf.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ set -euo pipefail
33

44
# ── Book Settings ─────────────────────────────────────────────────
55
FILENAME="mastering-cardano"
6-
VERSION="v1.0.0"
6+
VERSION="$(cat VERSION)"
7+
8+
echo "building PDF for version $VERSION"
79

810
rm -rf dist/images-processed
911
mkdir -p dist/images-processed

chapters/chapter-04-how-cardano-works/ouroboros-consensus.adoc

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ The fundamental reasons boil down to simple facts of nature:
3030

3131
For example, imagine setting up a financial system that settles transactions worldwide, with a server located on every continent.
3232

33-
image::ouroboros_distributed_system.png[A global distributed system]
33+
.A global distributed system
34+
image::ouroboros_distributed_system.png[]
3435

3536
You would want to ensure:
3637

@@ -63,7 +64,8 @@ Else,
6364
choose between low latency or consistency.
6465
____
6566

66-
image::ouroboros_pcaelc_theorem.png[PCAELC theorem]
67+
.PCAELC theorem
68+
image::ouroboros_pcaelc_theorem.png[]
6769

6870

6971
In our example of a global financial system,
@@ -94,7 +96,8 @@ they can differ slightly due to network latency and topology, or policy differen
9496
Miners select transactions from their mempool when building a new block,
9597
often prioritizing those with higher transaction fees.
9698

97-
image::ouroboros_mempool.png[Each validator (miner/SPO) has its own mempool]
99+
.Each validator (miner/SPO) has its own mempool
100+
image::ouroboros_mempool.png[]
98101

99102
Network participants (miners) [in Cardano — stake pool operators (SPOs)] independently assemble candidate blocks from their mempool
100103
and _compete_ to solve a cryptographic puzzle (proof of work) [in Cardano — proof of stake(((proof-of-stake)))].
@@ -111,12 +114,14 @@ until it is assumed that a block has been immutably added to the blockchain fore
111114
Eventually, one branch of the fork becomes longer as more blocks are added,
112115
and it is that longer branch that will be adopted by all nodes.
113116

114-
image::ouroboros_longest_chain.png[Longest chain]
117+
.Longest chain
118+
image::ouroboros_longest_chain.png[]
115119

116120
All honest nodes converge on this _longest chain_, discarding blocks from shorter forks.
117121
Transactions in the discarded blocks may be re-added to the mempool if they haven’t already been confirmed in some block in the longest chain.
118122

119-
image::ouroboros_longest_chain_consensus.png[validators continue in the longest chain]
123+
.Validators continue in the longest chain
124+
image::ouroboros_longest_chain_consensus.png[]
120125

121126
At this point, it is important to mention how similar the original Nakamoto consensus(((Nakamoto, Consensus))) and the Ouroboros consensus are.
122127
In fact, Ouroboros is Nakamoto consensus(((Nakamoto, Consensus))).
@@ -136,19 +141,22 @@ Proof of work(((proof-of-work))) is then like a hurdle race, where there is only
136141

137142
We can see a block of the Bitcoin network as a data structure with the following fields:
138143

139-
image::ouroboros_basic_block_structure.png[Basic block structure]
144+
.Basic block structure
145+
image::ouroboros_basic_block_structure.png[]
140146

141147
And then, the 'race' is about trying to calculate the hash function that given the data and the nonce(((nonce))),
142148
returns a current block hash(((current block hash))) that has the desired number of leading zeros ('0000') -- this can also be thought about as finding a current block hash that is less than a desired threshold.
143149

144150
But in order to calculate the current block hash(((current block hash))), the only way is to try nonce numbers at random.
145151
Like in this image, we try with 0, 17... and so on.
146152

147-
image::ouroboros_trying_with_nonce.png[Different attempts to find a nonce]
153+
.Different attempts to find a nonce
154+
image::ouroboros_trying_with_nonce.png[]
148155

149156
Until, finally, we find the nonce that produces the correct current block hash:
150157

151-
image::ouroboros_valid_nonce.png[Found a nonce that Works]
158+
.Found a nonce that Works
159+
image::ouroboros_valid_nonce.png[]
152160

153161
As you can imagine, this approach of randomly generating a nonce(((nonce))) and testing whether the resulting hash meets the desired difficulty is very computationally intensive.
154162

1.07 MB
Loading
552 KB
Loading
173 KB
Loading
173 KB
Loading
233 KB
Loading
253 KB
Loading

0 commit comments

Comments
 (0)