Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web tweaks #65

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
14 changes: 7 additions & 7 deletions a_defective_system.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ If I did print money---a ◊strong{lot} of money---and spent it like this, what

For starters, if I just kept the money without spending it, nothing would change:

◊img[#:src "/images/counterfeiting1.png" #:alt "The counterfeiter can print a large stash of cash."]{
◊img[#:src "/images/counterfeiting1.png" #:alt "The counterfeiter can print a large stash of cash, but other people would not benefit."]{
The counterfeit money is colored yellow and the real money is green.
}

Then if I decided to buy a bunch of LEGO®, the store would get some of my money:

◊img[#:src "/images/counterfeiting2.png" #:alt "The counterfeiter buys LEGO."]{}
◊img[#:src "/images/counterfeiting2.png" #:alt "The counterfeiter buys LEGO, sharing the wealth with the store."]{}

After a while the store would use the counterfeited money to pay their supplier:

◊img[#:src "/images/counterfeiting3.png" #:alt "Money further trickles down to the supplier, but not to everyone."]{}
◊img[#:src "/images/counterfeiting3.png" #:alt "Money further trickles down to the supplier, but not to everyone. The poor people did not get more money than they had before, and now they're even poorer relative to the others."]{}

Who in turn will use it to buy other stuff, and in this way the counterfeited money slowly trickles out into the rest of the economy. This extra money has two important effects:

Expand Down Expand Up @@ -356,7 +356,7 @@ While taking out debt to fuel investments was only supposed to be a temporary me

◊; Actual source
◊; https://fred.stlouisfed.org/graph/?id=GFDEBTN,
◊img[#:src "images/usa-debt.svg" #:link #t #:alt "The federal debt of the United States, measure in trillions of dollars, since 1966."]{
◊img[#:src "images/usa-debt.svg" #:link #t #:alt "The federal debt of the United States figure"]{
The ◊link[usa-national-debt]{federal debt of the United States}, measure in trillions of dollars, since 1966.
After the ◊link[financial_crisis]{2008 financial crisis} the amount of debt skyrocketed, signifying a shift in economic policy.
During the COVID-19 pandemic the debt explosively increased at a pace unseen before.
Expand Down Expand Up @@ -444,18 +444,18 @@ It seems like we're moving away from the original Keynesian ideas to something e

There's a worrying trend in the world: ◊link[global-inequality]{global inequality is rising}. The rich get richer and the poor get... poorer.

◊img[#:src "images/income-inequality-world.svg" #:link #t #:alt "Top 10% income share between 1980 and 2015."]{
◊img[#:src "images/income-inequality-world.svg" #:link #t #:alt "World income share figure"]{
Top 10% income share between 1980 and 2015.
Source ◊link[inequality-data]{World Inequality Database}.
}

The inequality is on the rise in nearly every country. If we take a closer look at the United States, it paints a gloomy picture:◊mn{report}

◊img[#:src "images/income-inequality.svg" #:link #t #:alt "Income share in the United States between 1962 and 2014."]{
◊img[#:src "images/income-inequality.svg" #:link #t #:alt "United States income share figure"]{
Income share in the United States between 1962 and 2014.
Source ◊link[inequality-data]{World Inequality Database}.
}
◊img[#:src "images/wealth-inequality.svg" #:link #t #:alt "Net personal wealth in the United States between 1962 and 2014."]{
◊img[#:src "images/wealth-inequality.svg" #:link #t #:alt "Net personal wealth figure"]{
Net personal wealth in the United States between 1962 and 2014.
Source ◊link[inequality-data]{World Inequality Database}.
}
Expand Down
4 changes: 2 additions & 2 deletions antifragile.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ Cryptocurrencies work the same way. When a weakness is discovered developers wil

While you can argue that an individual cryptocurrency is antifragile, antifragility also applies to the cryptocurrency concept itself. People like to point at the thousands of cryptocurrencies as some sort of drawback, but it's actually the opposite. Cryptocurrencies being created and then dying off en mass is good as each time one fails we might learn something new and use that to improve the survivors.

◊img[#:src "/images/btc-hydra.png" #:alt "A hydra with one Bitcoin head"]{
◊img[#:src "/images/btc-hydra.png" #:alt "A hydra with one head looking like the Bitcoin logo."]{
Cryptocurrencies are like a Hydra.
}

◊img[#:src "/images/bch-xmr-hydra.png" #:alt "A hydra with two heads, one Bitcoin Cash and one Monero"]{
◊img[#:src "/images/bch-xmr-hydra.png" #:alt "A hydra with three heads; one cut off, one like the Bitcoin Cash logo and one like the Monero logo."]{
Cut off one head, two more shall take its place.
}

Expand Down
2 changes: 1 addition & 1 deletion are_cryptocurrencies_money.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ We've looked at the properties---but how well do they function as money, today?

The valuation is highly speculation driven and has been notoriously volatile.◊mn{sov} ◊note-pos{sov}

◊img[#:src "images/btc-valuation.svg" #:link #t #:alt "Bitcoin closing price per month, between 2010 and 2019."]{
◊img[#:src "images/btc-valuation.svg" #:link #t #:alt "Bitcoin closing price per month, between 2010 and 2020."]{
◊link[btc-valuation]{Bitcoin price per week up to the beginning of 2020}.
The price peaked in December 2017 to $19,870, and some exchanges had it even higher. A year later the price had dropped to $3,177, a drop of over 84%.
}
Expand Down
6 changes: 3 additions & 3 deletions challenges.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ Bitcoin, like most cryptocurrencies, uses a public ledger where all transactions
"https://www.chainalysis.com/"
"Chainalysis: The Blockchain Analysis Company"))

◊img[#:src "/images/coin-tracing.png" #:alt "Paying someone with allows you to see their funds."]{
◊img[#:src "/images/coin-tracing.png" #:alt "Image of John's address that has sent 1 BTC to the merchant and 13 BTC to another address."]{
After the merchant receives a payment from John, the merchant can see that John has sent 13 BTC to another address, out of an initial 40 BTC.
John appears to be quite rich.
}

◊img[#:src "/images/coin-tracing2.png" #:alt "You can trace coins back in history."]{
◊img[#:src "/images/coin-tracing2.png" #:alt "Image of how John's 40 BTC originates from a hacked exchange."]{
It's possible to trace coins further back in history. Here we see that John's coins come from a hacked exchange, whose address is known. It might mean John is the hacker or, more probably, that John has received ◊em{tainted} coins (coins associated with illegal behavior).
}

Expand All @@ -119,7 +119,7 @@ You can explore the Bitcoin blockchain, and see all transactions and addresses,

In an attempt to make Bitcoin more private "mixing" services such as ◊link[coinjoin]{CoinJoin} can be used. They work by mixing together your coins with the coins of others, in an attempt to obscure where the coins are coming from:

◊img[#:src "/images/coinjoin.png" #:alt "Obfuscation by mixing coins with other addresses."]{
◊img[#:src "/images/coinjoin.png" #:alt "Image of mixing coins by sending them to and from various addresses."]{
A mixing service makes several addresses send to each other, in order to obfuscate the history. Although not shown here, because it would be too messy, all addresses and amounts are still visible.
}

Expand Down
29 changes: 15 additions & 14 deletions chapter.html.p
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,32 @@
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
</head>
<body>
<article class="◊|article-class|">
<main class="◊|article-class|">
<nav class="where">
<a href="/toc.html" tilte="Table of contents" class="home">Why Cryptocurrencies?</a>
◊when/splice[parent-page]{
<span class="divider">/</span>
◊(ref parent-page parent-title parent-title)
}
</nav>
<header>
<h1>◊|title|</h1>
<h2>◊|subtitle|</h2>
◊(when side-space? (->html
`(div ((class "date"))
(span ((class "published")) ,published)
,(if updated
`(span ((class "updated")) ,updated)
""))))
</div>
</header>
<article>
<header>
<h1>◊|title|</h1>
<h2>◊|subtitle|</h2>
◊(when side-space? (->html
`(div ((class "date"))
(span ((class "published")) ,published)
,(if updated
`(span ((class "updated")) ,updated)
""))))
</header>

◊(->html doc #:splice? #t)
◊(->html doc #:splice? #t)
</article>

◊(->html (make-section-nav #:section-header? section-chapters-headers?
here))
</article>
</main>

◊(when side-space? (->html `(div ((class "side-space")))))

Expand Down
2 changes: 1 addition & 1 deletion cryptography.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ You ◊em{encrypt} a message by placing it in the mailbox, this way nobody but t
This is where our mailbox metaphor breaks down a bit. It may seem that it's more inconvenient to sign a message than to encrypt one, but digitally they're both straightforward.
}

◊img[#:src "/images/encrypted_mailbox.png" #:alt "Placing a letter in the mailbox."]{
◊img[#:src "/images/encrypted_mailbox.png" #:alt "A letter is placed in the mailbox."]{
Placing a message inside the mailbox ensures that only the one with the key can read it.
}

Expand Down
17 changes: 7 additions & 10 deletions darknet_markets.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,13 @@ There's a concept we need to have in mind while looking at darknet markets: some

Here's a table to illustrate the problem:

◊(define sbr
`(br))

◊table-body[#:class "legal-moral"]{
◊tr{◊td{} ◊ths{Legal} ◊ths{Illegal}}
◊tr{◊tds{Moral} ◊good{Self defense
Free speech}
◊mo-il{Some types of sex
Starving child steals food}}
◊tr{◊tds{Immoral} ◊im-le{Mass surveillance
Civil asset forfeiture}
◊bad{Slavery
Murder}}
◊tr{◊td{} ◊ths{Legal} ◊ths{Illegal}}
◊tr{◊tds{Moral} ◊good{Self defense◊|sbr|Free speech} ◊mo-il{Some types of sex◊|sbr|Starving child steals food}}
◊tr{◊tds{Immoral} ◊im-le{Mass surveillance◊|sbr|Civil asset forfeiture} ◊bad{Slavery◊|sbr|Murder}}
}

It's actually quite hard to classify things as legal or illegal and moral or immoral; they both change depending on the country, the time period and who you ask. For instance most would agree that slavery is immoral and should be illegal, but it was legal and viewed as normal for thousands of years. Similarly today in the western world we take free speech for granted, but that's not the case in all countries.
Expand Down Expand Up @@ -152,7 +149,7 @@ So if none of those things are available, what can you buy on a darknet market?

The following example, based on a real-life story I read a few years ago, illustrates why darknet markets aren't purely evil.

div[#:class "story"]{
section[#:class "story"]{

Tom met the love of his life five years ago, when he went to get some of his teeth removed. Hardly the most romantic meeting, with her drilling into his aching teeth, but it was love at first sight.

Expand Down
6 changes: 3 additions & 3 deletions for_the_unbanked.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ There are ◊strong{◊link[findex-report]{1.7 billion adults}} without a bank a
◊; #df65b0 36-60
◊; #dd1c77 61-80
◊; #980043 81-100
◊img[#:src "images/unbanked-map.png" #:class "fullwidth" #:link #t #:alt "Adults without a bank account, 2017."]{
◊img[#:src "images/unbanked-map.png" #:class "fullwidth" #:link #t #:alt "A world map showing the fraction of adults without a bank account in each country, 2017."]{
Adults without a bank account, 2017.
Source ◊link[findex-report]{Global Findex database}.
}
Expand All @@ -63,7 +63,7 @@ Another way to look at the world is to visualize the raw number of unbanked in e
◊;#43a2ca 50 - 100 mil
◊; 100 - 150 mil (no country!)
◊;#0868ac > 150 mil
◊img[#:src "images/unbanked-count-map.png" #:class "fullwidth" #:link #t #:alt "The number of adults without a bank account, 2017."]{
◊img[#:src "images/unbanked-count-map.png" #:class "fullwidth" #:link #t #:alt "A world map showing the number of adults without a bank account in each country, 2017."]{
The number of adults without a bank account, 2017.
Source ◊link[findex-report]{Global Findex database} (◊link[findex-interactive]{interactive}).
}
Expand All @@ -81,7 +81,7 @@ The ◊link[findex-report]{Global Findex database} also tried to examine why peo
If this is interesting to you I suggest you ◊link[findex-report]{give the report a read}. There are tons of different statistics and I only refer to a fraction of the data available.
}

◊img[#:src "images/why-unbanked.svg" #:link #t #:alt "Reported reason for adults not having a bank account, 2017."]{
◊img[#:src "images/why-unbanked.svg" #:link #t #:alt "Reported reasons table."]{
Reported reason for adults not having a bank account, 2017. More than one reason could be given.
Source ◊link[findex-report]{Global Findex database}.
}
Expand Down
2 changes: 1 addition & 1 deletion freezing_of_merchant_accounts.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This chapter continues on the same idea as the ◊link[prev]{previous one}, but

Imagine coming in to work one day and having this conversion with your boss:

div[#:class "story"]{
section[#:class "story"]{
◊trow{I'm sorry John, but we'll pay you in 6 months.}
◊trow{What?}
◊trow{Don't worry, you'll still get your full salary, but we'll pay it in 6 months.}
Expand Down
2 changes: 1 addition & 1 deletion global_currency.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

◊(clear-sidenotes)

◊img[#:src "/images/global.png" #:alt "You can send coins all over the world."]{}
◊img[#:src "/images/global.png" #:alt "You can send coins all over the world." #:decorative #t]{}

Cryptocurrencies don't have any borders. They allow you to send and receive money from anywhere in the world; to bypass sanctions and border control; opt-out of local monetary policies; and use a currency that's global to an extent we've never seen before.

Expand Down
8 changes: 4 additions & 4 deletions how_do_cryptocurrencies_work.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For example, Sneaky Steve wants to buy a computer from Honest Harry and wants to
What Sneaky Steve tries to do is send ◊sans-tnum{1 BTC} to the merchant, Honest Harry, and then send a copy of ◊sans-tnum{1 BTC} to his other address: ◊sans-tnum{Sneaky Steve 2}. (It's possible to have as many addresses as you want---a consequence of the permissionless nature of Bitcoin.)

◊img[#:src "/images/double-spend.png"
#:alt "Double spending by sending a coin to someone and back to himself."]{Sneaky Steve sends a digital coin both to Honest Harry and himself.}
#:alt "Double spending figure"]{Sneaky Steve sends a digital coin both to Honest Harry and himself.}

If we didn't prevent this, the ledger might look like this:

Expand Down Expand Up @@ -269,7 +269,7 @@ When a miner finds a solution, she can update the ledger by adding a block to th

A blockchain is what it sounds like: a chain of blocks where a new block builds on previous blocks. When a miner searches for a solution, she must target a block on a specific height---the POW problem includes a reference to the previous block and it only fits at a specific position in the chain. When a new block is added, all miners need to work on a new problem targeting that block.

◊img[#:src "/images/add_block.png" #:alt "A new block is added by linking it with a POW solution."]{
◊img[#:src "/images/add_block.png" #:alt "A new block is added by linking it to the previous block with a POW solution."]{
The blocks in the blockchain are linked with a key obtained by solving the POW problem.
}

Expand Down Expand Up @@ -344,7 +344,7 @@ The blockchain is duplicated, stored, and maintained by many different people; y
What happens if two miners find a block at the same height? For example, one where Sneaky Steve sends money to Honest Harry and one where Sneaky Steve sends money to himself?

◊img[#:src "/images/double_spend_fork.png"
#:alt "Two blocks can be added at the same height."]{
#:alt "Two blocks can be added at the same height, even if they contain different transactions."]{
Two blocks at the same height with different transactions.
}

Expand Down Expand Up @@ -388,7 +388,7 @@ It works like this:
}
}

◊img[#:src "/images/reversal1.png" #:alt "Sneaky Steve pays Honest Harry."]{
◊img[#:src "/images/reversal1.png" #:alt "Sneaky Steve paying Honest Harry, and a block with two confirmations."]{
Sneaky Steve pays Honest Harry and they wait until the transaction has two confirmations.
}
◊img[#:src "/images/reversal3.png" #:alt "Honest Harry gives Sneaky Steve jeans."]{
Expand Down
2 changes: 1 addition & 1 deletion pollen.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

(provide (all-defined-out))

(define block-tags (append '(img table tbody tr dt dd dl) default-block-tags))
(define block-tags (append '(img table thead tbody tr dt dd dl) default-block-tags))

;; Use our own publish script instead...
;; Ignore stuff during 'raco pollen publish'
Expand Down
8 changes: 4 additions & 4 deletions properties_of_a_cryptocurrency.html.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ The important difference between a cryptocurrency and the digital payments we ha

Sending money to people via your bank isn't peer-to-peer as you rely on your bank to send it for you. VISA, PayPal, Swish, Apple Pay, and other digital payments have the same problem, all except cryptocurrencies.

◊img[#:src "images/give_cash.png" #:alt "Cash is given directly from hand to hand."]{
◊img[#:src "images/give_cash.png" #:alt "Giving cash figure"]{
Cash is given directly from hand to hand.
}
◊img[#:src "images/send_bank.png" #:alt "Regular digital payments are sent through a bank or different payment processors."]{
◊img[#:src "images/send_bank.png" #:alt "Payments through a bank figure"]{
Regular digital payments are sent through a bank or different payment processors.
}
◊img[#:src "images/send_crypto.png" #:alt "Cryptocurrencies are sent directly from device to device."]{
◊img[#:src "images/send_crypto.png" #:alt "Sent between devices figure"]{
Cryptocurrencies are sent directly from device to device.
}

Expand Down Expand Up @@ -87,7 +87,7 @@ Problems with counterfeit coins and bills go far back. From biting coins to test

With cryptocurrencies, anyone can independently verify the integrity of the coins you send and receive. Details on how is in the ◊link[next-chapter]{next chapter} but I assure you no biting is needed. You cannot counterfeit coins and you cannot send the same coin to multiple people ◊em{(double-spend)}. This is what allows cryptocurrencies to operate without a trusted third-party.

◊img[#:src "/images/double-spend.png" #:alt "Double spending by sending a coin to someone and back to himself."]{
◊img[#:src "/images/double-spend.png" #:alt "Double spending figure"]{
A double spending occurs when someone sends the same coin both to a merchant and back to himself.
}

Expand Down
12 changes: 10 additions & 2 deletions rkt/refs.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,13 @@
(regexp-match #rx"^mailto:" x))))

(define (to-name x)
(string-replace (string-downcase x) " " "-"))

(regexp-replace #rx"[?%#]"
(string-replace (string-downcase x) " " "-")
""))

(module+ test
(require rackunit)
(check-equal? (to-name "What is this?") "what-is-this")
(check-equal? (to-name "50%") "50")
(check-equal? (to-name "a#b") "ab")
)
Loading