notes

Personal notes
git clone git://git.laack.co/notes.git
Log | Files | Refs

commit 2b97b374e54f37e636459009ffe63bcf2d78a7e7
parent 3a4350ed191bd4b3f3fda5148ff5117e2e5bd999
Author: Andrew Laack <andrew@laack.co>
Date:   Mon, 18 May 2026 17:20:48 -0500

Took notes on ocw crypto lecture 2

Diffstat:
Adocs/Blockchain.md | 25+++++++++++++++++++++++++
Mdocs/Cryptocurrency.md | 17++++++++++++++++-
Mdocs/Cryptography.md | 16+++++++++++-----
Adocs/DistributedConsensus.md | 17+++++++++++++++++
Adocs/Economics.md | 10++++++++++
Adocs/IndifferenceCurve.md | 5+++++
Mdocs/LamportSignature.md | 6+++---
Mdocs/PoissonProcess.md | 2--
Adocs/ProofOfWork.md | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Adocs/SybilAttack.md | 5+++++
Mdocs/UtilityFunction.md | 2--
Mdocs/index.md | 1+
12 files changed, 142 insertions(+), 13 deletions(-)

diff --git a/docs/Blockchain.md b/docs/Blockchain.md @@ -0,0 +1,25 @@ +# Blockchain + +**Source:** MIT MAS.S62 Cryptocurrency Engineering and Design L2 + +**Definition:** A blockchain is a distributed ledger of transactions that uses cryptographic hashes to link records together. + +## Simple Example + +``` + +message m, nonce r, target t + +hash(m,r) = h; h < t + +m_n = (data, h_n-1) + +``` + +A message is the block, and it has: + +1. previous message hash (pointer) +2. message +3. nonce + +The entire block is hashed, and that is the identifier for it. diff --git a/docs/Cryptocurrency.md b/docs/Cryptocurrency.md @@ -4,8 +4,23 @@ **Definition:** Cryptocurrency is a digital asset that uses a digital ledger for tracking transactions. +## Some properties we'd like + +1. Permissionless + - Money can be spent only if it is owned by the individual + - No authority limiting transactions +2. No double spends +3. Tamper-proof + - Can't take back a spend easily + - Can't tamper with history + +## [Distributed consensus](DistributedConsensus.md) + +To achieve distributed consensus it is frequently useful to have a distributed log of transactions. In Bitcoin this is achieved using [Proof of Work](ProofOfWork.md). + ## Links -- [Coincidence Of Wants](CoincidenceOfWants.md) +- [Coincidence of Wants](CoincidenceOfWants.md) - [Depository](Depository.md) - [Chaumian eCash](ChaumianECash.md) +- [Blockchain](Blockchain.md) diff --git a/docs/Cryptography.md b/docs/Cryptography.md @@ -6,8 +6,14 @@ ## Links -- [Digital Signature](DigitalSignature.md) -- [Blind Signature](BlindSignature.md) -- [Cryptocurrency](Cryptocurrency.md) -- [HashFunction](HashFunction.md) -- [Lamport Signature](LamportSignature.md) +- MIT MAS.S62 Cryptocurrency Engineering and Design + - Lecture 1 + - [Digital Signature](DigitalSignature.md) + - [Blind Signature](BlindSignature.md) + - [Chaumian eCash](ChaumianECash.md) + - [Cryptocurrency](Cryptocurrency.md) + - [HashFunction](HashFunction.md) + - [Lamport Signature](LamportSignature.md) + - Lecture 2 + - [Cryptocurrency](Cryptocurrency.md) + - [Distributed Consensus](DistributedConsensus.md) diff --git a/docs/DistributedConsensus.md b/docs/DistributedConsensus.md @@ -0,0 +1,17 @@ +# Distributed Consensus + +**Source:** MIT MAS.S62 Cryptocurrency Engineering and Design L2 + +**Definition:** Distributed consensus is the problem of trying to get multiple systems to agree on a value in the presence of faults. + +## Crash fault tolerance (CFT) + +CFT algorithms can achieve consensus despite the failure of some network nodes. Despite this, they are not resilient to adversarial nodes on the network, an issue that must be addressed for [Cryptocurrency](Cryptocurrency.md). + +## Byzantine fault tolerance (BFT) + +Byzantine fault tolerant algorithms can achieve consensus even if some network nodes are malicious or malfunctioning. + +Historically, these algorithms have been identity-based, requiring the identity of every node to be known. This could allow adversaries to create many identities, known as a [Sybil attack](SybilAttack.md). + +A possible solution to this problem is to make identity creation cost a scarce resource. diff --git a/docs/Economics.md b/docs/Economics.md @@ -0,0 +1,10 @@ +# Economics + +**Definition:** Economics is the social science that studies markets. + +## Links + +### MIT 14.01 Principles of Microeconomics + +- [Indifference Curve](IndifferenceCurve.md) +- [Utility Function](UtilityFunction.md) diff --git a/docs/IndifferenceCurve.md b/docs/IndifferenceCurve.md @@ -0,0 +1,5 @@ +# Indifference Curve + +**Source:** MIT 14.01 Principles of Microeconomics L2 + +**Definition:** Indifference curves are curves where points on the curve represent indifference between quantities of two independent variables. diff --git a/docs/LamportSignature.md b/docs/LamportSignature.md @@ -51,7 +51,7 @@ for idx in range(hash): - signatures are 8kb - Keys should only be used once - One iteration leaks half of the key - - Two iterations leaks ~3/4 of the keys + - Two iterations leaks ~3/4 of the key - Depending on the message being signed, even more segments may be revealed - ... @@ -124,7 +124,7 @@ func Sign(privateKey Key, message string) [256][32]byte { currentByteString := fmt.Sprintf("%08b", messageHash[index]) for idx := range 8 { currentBit := currentByteString[idx] - if currentBit == '1' { + if currentBit == '0' { signature[(index*8)+idx] = privateKey.firstRow[(index*8)+idx] } else { signature[(index*8)+idx] = privateKey.secondRow[(index*8)+idx] @@ -143,7 +143,7 @@ func Verify(publicKey Key, message string, signature [256][32]byte) bool { currentByteString := fmt.Sprintf("%08b", messageHash[index]) for idx := range 8 { currentBit := currentByteString[idx] - if currentBit == '1' { + if currentBit == '0' { // signature[(index * 8) + idx] = privateKey.firstRow[(index * 8) + idx] if sha256.Sum256(signature[(index*8)+idx][:]) != publicKey.firstRow[(index*8)+idx] { return false diff --git a/docs/PoissonProcess.md b/docs/PoissonProcess.md @@ -2,8 +2,6 @@ Prob L14 - - **Definition:** A poisson process is a continous time version of the [BernoulliProcess](BernoulliProcess.md). A poisson process models continuous time with binary outcomes. Generally, we simply track when the true case occurs. diff --git a/docs/ProofOfWork.md b/docs/ProofOfWork.md @@ -0,0 +1,49 @@ +# Proof of Work + +**Source:** MIT MAS.S62 Cryptocurrency Engineering and Design L2 + +**Definition:** Proof of work is an approach to achieving distributed consensus using work as a form of identity to defend against [Sybil attacks](SybilAttack.md). + +## Characteristics + +- Time consuming +- Deterministic verification +- Scalable + - Constant time verification +- Memoryless + - Proof of work must not be progress-based because the fastest person will always win then + - We want a node to win at a rate proportional to its work relative to the entire network. + +## Examples + +### Hash Cash (1997) + +One posited solution for email spam was to require email senders to add a special X-Hashcash header that followed a specific format including date, resource, bits, and some additional information. The final portion of the heder is the 'counter' field which is a random base-64 formatted number which is used to satisfy the expectation that the hash of the entire header must have some number of 0's as its prefix. + +### Bitcoin + +Bitcoin uses proof-of-work to minimize the likelihood of sybil attacks and to achieve consensus about the order transactions occurred in. This allows PoW to solve the double spend problem. + +## Pros + +- Anonymous +- No signatures involved +- Memoryless + - Every attempt is equally likely + - No progress! + - Poisson process +- Scalable + - Very easy to verify a certificate +- Non-interactive + - Never have to report failed attempts +- Uses real world resources + - It is costly to go back and rewrite history +- Easy to vary difficulty + +## Cons + +- Computationally costly +- Negatively impacts hardware markets +- Irregular block minting + - Impacts guarantees about when transactions will clear +- 51% attacks diff --git a/docs/SybilAttack.md b/docs/SybilAttack.md @@ -0,0 +1,5 @@ +# Sybil Attack + +**Source:** **Source:** MIT MAS.S62 Cryptocurrency Engineering and Design L2 + +**Definition:** A sybil attack is a network attack where an adversary creates lots of identities to take control of an identity based network. diff --git a/docs/UtilityFunction.md b/docs/UtilityFunction.md @@ -2,6 +2,4 @@ Ch 1 - - **Definition:** A utility function is a function from E -> R where E is the set of events, R is the set of real numbers, and the mapping describes how good the event is. diff --git a/docs/index.md b/docs/index.md @@ -11,3 +11,4 @@ - [Note Taking](NoteTaking.md) - [Self Hosting](SelfHosting.md) +- [Economics](Economics.md)