Podcast
Questions and Answers
How do cryptocurrencies ensure security without relying on a central authority?
How do cryptocurrencies ensure security without relying on a central authority?
- By relying on legal frameworks and international agreements.
- By using central banks to control the money supply.
- By enforcing security rules purely technologically through cryptography. (correct)
- By adding anti-counterfeiting features to physical currency.
What is a fundamental property of a cryptographic hash function?
What is a fundamental property of a cryptographic hash function?
- It is efficiently computable. (correct)
- It produces a variable-size output depending on the input.
- It requires significant computational resources for every input.
- It can only accept fixed-length inputs.
For a hash function to be considered cryptographically secure, which property is essential?
For a hash function to be considered cryptographically secure, which property is essential?
- Output predictability
- Computational complexity
- Collision-resistance (correct)
- Input size variability
What does collision-resistance in a hash function ensure?
What does collision-resistance in a hash function ensure?
Why does the existence of methods to find collisions not necessarily negate the usefulness of collision-resistant hash functions?
Why does the existence of methods to find collisions not necessarily negate the usefulness of collision-resistant hash functions?
What does the 'hiding' property of a cryptographically secure hash function ensure?
What does the 'hiding' property of a cryptographically secure hash function ensure?
How can the 'hiding' property be achieved when an input is not spread out?
How can the 'hiding' property be achieved when an input is not spread out?
In the context of hash functions, what is 'min-entropy'?
In the context of hash functions, what is 'min-entropy'?
What is the purpose of a commitment scheme in cryptography?
What is the purpose of a commitment scheme in cryptography?
What are the two security properties that a commitment scheme should hold?
What are the two security properties that a commitment scheme should hold?
If H is a hash function that is collision-resistant and hiding, what property does a commitment scheme using H have?
If H is a hash function that is collision-resistant and hiding, what property does a commitment scheme using H have?
What is required to find x such that $H(k||x) = y$ in a puzzle-friendly hash function for every possible n-bit output value y?
What is required to find x such that $H(k||x) = y$ in a puzzle-friendly hash function for every possible n-bit output value y?
In the context of a 'search puzzle', what determines the difficulty of the puzzle?
In the context of a 'search puzzle', what determines the difficulty of the puzzle?
What does SHA-256 use to convert a fixed-length collision-resistant compression function into a hash function that accepts arbitrary-length inputs?
What does SHA-256 use to convert a fixed-length collision-resistant compression function into a hash function that accepts arbitrary-length inputs?
What is the block size used by SHA-256?
What is the block size used by SHA-256?
What is a hash pointer?
What is a hash pointer?
How does a hash pointer enhance the security of a data structure?
How does a hash pointer enhance the security of a data structure?
What is the primary characteristic of a blockchain data structure?
What is the primary characteristic of a blockchain data structure?
What makes a blockchain a tamper-evident log?
What makes a blockchain a tamper-evident log?
How can tampering with data in a blockchain be detected?
How can tampering with data in a blockchain be detected?
What is the 'genesis block' in a blockchain?
What is the 'genesis block' in a blockchain?
What is a Merkle tree?
What is a Merkle tree?
In a Merkle tree, how are data blocks organized?
In a Merkle tree, how are data blocks organized?
If there are n nodes in a Merkle tree, approximately how many items need to be shown to prove membership of a data block?
If there are n nodes in a Merkle tree, approximately how many items need to be shown to prove membership of a data block?
What is the purpose of a 'sorted Merkle tree'?
What is the purpose of a 'sorted Merkle tree'?
What is a primary property of a digital signature?
What is a primary property of a digital signature?
What is an important consideration when using digital signatures related to the signed document?
What is an important consideration when using digital signatures related to the signed document?
In the context of digital signature algorithms, what does the function generateKeys(keysize)
produce?
In the context of digital signature algorithms, what does the function generateKeys(keysize)
produce?
What does the property 'existentially unforgeable' mean in the context of digital signatures?
What does the property 'existentially unforgeable' mean in the context of digital signatures?
Why is a good 'source of randomness' critical for digital signatures?
Why is a good 'source of randomness' critical for digital signatures?
Why do digital signature schemes often sign the hash of a message rather than the message itself?
Why do digital signature schemes often sign the hash of a message rather than the message itself?
What is the purpose of ECDSA in Bitcoin?
What is the purpose of ECDSA in Bitcoin?
What is the estimated security level (in bits) provided by the elliptic curve "secp256k1" used in Bitcoin's ECDSA?
What is the estimated security level (in bits) provided by the elliptic curve "secp256k1" used in Bitcoin's ECDSA?
Why is using a hash of a public key as an identity practical?
Why is using a hash of a public key as an identity practical?
What are Bitcoin identities called, which are a hash of a public key?
What are Bitcoin identities called, which are a hash of a public key?
What is a potential weak point in real systems regarding decentralized identity management?
What is a potential weak point in real systems regarding decentralized identity management?
What is a major privacy concern in Bitcoin despite not requiring explicit real-world identity?
What is a major privacy concern in Bitcoin despite not requiring explicit real-world identity?
In GoofyCoin, who can create new coins?
In GoofyCoin, who can create new coins?
What is required for Goofy to create a new coin?
What is required for Goofy to create a new coin?
In GoofyCoin, how is the transfer of a coin accomplished?
In GoofyCoin, how is the transfer of a coin accomplished?
What is the main vulnerability of GoofyCoin?
What is the main vulnerability of GoofyCoin?
In ScroogeCoin, what is the role of Scrooge?
In ScroogeCoin, what is the role of Scrooge?
How does ScroogeCoin attempt to prevent double-spending?
How does ScroogeCoin attempt to prevent double-spending?
What is a key component that Scrooge digitally signs in the ScroogeCoin blockchain?
What is a key component that Scrooge digitally signs in the ScroogeCoin blockchain?
What happens if Scrooge attempts to alter a past transaction in ScroogeCoin?
What happens if Scrooge attempts to alter a past transaction in ScroogeCoin?
One significant drawback of ScroogeCoin is...
One significant drawback of ScroogeCoin is...
Flashcards
Fiat Currencies
Fiat Currencies
Organizations like central banks control the money supply.
Cryptocurrencies security rules
Cryptocurrencies security rules
The need to be enforced without a central authority.
Cryptography
Cryptography
Secures the rules of a cryptocurrency system within the system itself.
Hash function
Hash function
Signup and view all the flashcards
Hash function input
Hash function input
Signup and view all the flashcards
Hash function output size
Hash function output size
Signup and view all the flashcards
Efficiently computable
Efficiently computable
Signup and view all the flashcards
Cryptographically secure hash function
Cryptographically secure hash function
Signup and view all the flashcards
Collision in hash function
Collision in hash function
Signup and view all the flashcards
Collision-resistance
Collision-resistance
Signup and view all the flashcards
Hiding property
Hiding property
Signup and view all the flashcards
Hiding property requirement
Hiding property requirement
Signup and view all the flashcards
Min-entropy
Min-entropy
Signup and view all the flashcards
Concatenation to achieve hiding
Concatenation to achieve hiding
Signup and view all the flashcards
What is a commitment scheme?
What is a commitment scheme?
Signup and view all the flashcards
verify(com, msg, nonce)
verify(com, msg, nonce)
Signup and view all the flashcards
Hiding property in commitment scheme
Hiding property in commitment scheme
Signup and view all the flashcards
Hash function properties for commitment scheme
Hash function properties for commitment scheme
Signup and view all the flashcards
Puzzle friendliness
Puzzle friendliness
Signup and view all the flashcards
puzzle-ID
puzzle-ID
Signup and view all the flashcards
SHA-256 components
SHA-256 components
Signup and view all the flashcards
Compression function
Compression function
Signup and view all the flashcards
Technique used to convert compression function into hash function
Technique used to convert compression function into hash function
Signup and view all the flashcards
IV
IV
Signup and view all the flashcards
Blockchain
Blockchain
Signup and view all the flashcards
Hash pointer
Hash pointer
Signup and view all the flashcards
The head of the list
The head of the list
Signup and view all the flashcards
Tamper-evident log
Tamper-evident log
Signup and view all the flashcards
Tampering with the data
Tampering with the data
Signup and view all the flashcards
Genesis block
Genesis block
Signup and view all the flashcards
Merkle tree
Merkle tree
Signup and view all the flashcards
Blocks containing data comprise...
Blocks containing data comprise...
Signup and view all the flashcards
Building the new data structure.
Building the new data structure.
Signup and view all the flashcards
How to identify a message
How to identify a message
Signup and view all the flashcards
GoofyCoin: the first rule
GoofyCoin: the first rule
Signup and view all the flashcards
Goofy generates a coin
Goofy generates a coin
Signup and view all the flashcards
Goofy signs the string
Goofy signs the string
Signup and view all the flashcards
GoofyCoin double-spending attack
GoofyCoin double-spending attack
Signup and view all the flashcards
ScroogeCoin
ScroogeCoin
Signup and view all the flashcards
ScroogeCoin: What each block has.
ScroogeCoin: What each block has.
Signup and view all the flashcards
Study Notes
Course Outline
- Teams code is xmwxbzp
- References can be found on the Teams post
- Grading breakdown:
- Midterm: 15%
- Quizzes: 10%
- Assignments: 20%
- Attendance: 5%
- Final: 50%
Introduction
- In fiat currencies, central banks control the money supply and add anti-counterfeiting measures
- Cryptocurrencies must enforce security rules technologically without relying on a central authority
- Cryptography allows for securely encoding cryptocurrency rules within the system
Cryptographic Hash Functions
- A hash function is a mathematical function with specific properties:
- Input can be any size string
- Produces a fixed-size output (e.g., 256-bit)
- Efficiently computable
- Cryptographically secure hash function properties:
- Collision-resistance
- Hiding
- Puzzle-friendliness
Collision Resistance
- Collision: When two distinct inputs produce the same output
- Collision-resistance means it is infeasible to find two different inputs, x and y, where x ≠ y, but H(x) = H(y)
- The input space (infinite) is larger than the output space (finite), requiring some input strings to map to the same output string
- There are methods that guarantee collisions can be found
- For a 256-bit output size, picking 2^256 + 1 distinct values ensures two outputs are equal when hashed.
- Choosing 2^130 + 1 inputs results in a 99.8% chance of collision
- Birthday Paradox: Collision likelihood examined roughly the square root of possible outputs; with 10,000 hashes per second, finding a collision to 2^128 hashes would take over 10^27 years
- Some functions have efficient collision detection methods, like H(x) = x mod 2^256 with a collision occurring between 3 and 3 + 2^256
- There are no collision-resistant functions
- Cryptographic hash functions are relied on in practice
Property 2: Hiding
- Hiding: With the hash function output y = H(x), finding the input, x, is infeasible
- x has to be chosen from a set that’s very spread out
- Inputs that are not spread can be hidden by concatenating it with another input that is spread out.
- With secret value r from high min-entropy distribution, then finding x given H(r || x) is infeasible
- Min-entropy in information theory describes outcome predictability
Application: Commitment
- A commitment scheme utilizes two algorithms:
com := commit(msg, nonce)
verify(com, msg, nonce)
returns TRUE ifcom == commit(msg, nonce)
- Security properties
- Hiding: Given
com
, findingmsg
is infeasible - Binding: Finding two pairs (
msg, nonce
) and (msg', nonce'
) wheremsg ≠ msg'
andcommit(msg, nonce) == commit(msg', nonce')
is infeasible. - Defining
commit(msg, nonce) := H(nonce||msg)
, necessary security properties depend onH
being collision-resistant and hiding
Property 3: Puzzle Friendliness
- For every n-bit output value y, if k is chosen from a distribution with high min-entropy, then finding x such that H(k||x) = y is infeasible in time less than 2^n.
- Application: search puzzle
- A hash function:
H
- A puzzle-ID: id chosen from a high min-entropy distribution
- A target set
Y
- A solution to puzzle x, such that H(id || x) ∈ Y
- Size of Y determines puzzle difficulty.
- If set of all n-bit strings, trivial, where if Y only 1 element, the puzzle is maximally hard
SHA-256
- Builds a hash compression function that works on fixed-length inputs
- Takes inputs of length 'm' and produces an output of a smaller length 'n'.
- Converts into a hash function for arbitrary-length inputs using Merkle-Damgard transform, dividing input into blocks of length m-n
- Initialization Vector (IV) is used for the first block
- SHA-256 compression function takes 768-bit inputs and produces 256-bit outputs and the block size is 512 bits.
Hash Pointers
- A hash pointer contains the "pointer" to stored information and a cryptographic hash of that information
- A regular pointer retrieves information
- A hash pointer verifies no change has occurred.
- Pointers, like linked lists or binary search trees, can be implemented with hash pointers
Blockchain
- Blockchain is a linked list build using hash pointers where each block indicates the previous block's value and contains a digest of that value
- The head of the list is a regular hash-pointer pointing to the recent data block
- Use case for a blockchain is a tamper-evident log
- Altering log data that is earlier in the log, will be detected
Blockchain: tamper-evident log
- Tampering with data anywhere in the blockchain requires tampering across the hash pointers back to the beginning
- Storing the hash pointer at the "head of the list" prevents undetected changes; The "genesis block" is the initial block
Merkle Trees
- A binary tree with hash pointers
- Data blocks comprise the leaves of a Merkle Tree.
- Data blocks are grouped in pairs so that a new data structure contains 2 hash pointers, one to each of the data block pairs.
- These data structures are each level up on the tree
- This process repeats until reaching the root, a single block
- Tampering gets detected by remembering the top hash pointer
Proof of Membership
- Only the root is remembered
- A block a member of the Merkle Tree
- Verify the specific block and the blocks on the path from data block to the root.
- Where there are 'n' nodes in a tree, checking can occur with log(n) items and requires log(n) time
Proof of Non-Membership
- Sorted Merkle Tree is a Merkle Tree sorted by some ordering function.
- Allows verification of non-membership in a logarithmic time and space.
- The path to the item just before and just after an item is revealed because the requested item is not included.
- When two items are consecutive, then the item in question is not included.
Digital Signatures
- Only one entity can create their signature and anyone can verify validity.
- Signatures are tied to a particular document
- Serves to indicate that the signature cannot endorse a different document
Digital Signature Algorithm
( sk, pk ) := generateKeys(keysize )
sk
is the secret key, used privately for signing messages andpk
is what you give out to people.sig := sign(sk, message)
isValid := verify(pk, message, sig)
isValid will returnTRUE
ifsig
is a valid signature formessage
, under public keypk
.- Properties
verify(pk, message, sign(sk, message)) == TRUE
- Signatures are existentially unforgeable
Practical Concerns
- Algorithms require source randomness
- Signing should occur as the hash of the message
- The hash of the message is a message digest (the hash function is collision resistant)
- Signing a hash pointer protects the total structure.
Elliptic Curve Digital Signature Algorithm (ECDSA)
- ECDSA is used on the standard elliptic curve "secp256k1"
- ECDSA is estimated at 128 bits of security.
- ECDSA difficulty is equivalent to 2128 symmetric-key function calls.
- ECDSA technically signs 256-bit messages, but always hashes before allowing an efficient signature for any size message.
Public Keys as Identities
- public Key is then a means of verifying that you can think of
pk
. - Access implies knowledge of the corresponding secret key (
sk
). - New identities can be made by creating a new key pair
sk
andpk
. - Hashing can occur if public keys are large
Decentralized Identity Management
- Generate identities without centralization
- Generate multiple with ease
- Bitcoin's version is addresses
- Probability of a repeated key is low
- Randomness has weakness
- There is no need to show your real-world entity, as behavior might be identifying.
Simple Cryptocurrency: Goofy Coin
- Simplified cryptocurrency
- The designated entity, Goofy makes coins
- Coin owner transfers a coin to someone else
Create a Coin
- Goofy ID generates unique coin ID uniqueCoinID so the string "CreateCoin [uniqueCoinID]" is constructed and the digital signature occurs for that string
Transferring a Coin
- Goofy transfers to Alice
- Generates “Pay this to Alice” to reference a coin
- Signs a statement
- Follow the pointer chain back; rightful owner statement saying "pay this coin to [new owner]"
Problems with GoofyCoin: Double Spending
- Bob transfers the coin using a signed declaration, but keeps it a secret.
- A signed declaration can then occurs with Bob to a 3rd party, Chuck.
- Bob / Chuck appear as owners.
Scrooge Coin
- Publishes a ledger
- Any written data remains
- Transactions must be written to the ledger, to prevent Double spending
Blockchain (Scrooge Coin)
- Scrooge signs each blockchain digitally
- Hash pointers and contents
- The signature is published
Rules of Scrooge Coin transaction
- Valid coins that were made previously.
- Has to be a non-Double Spending transaction
- The consumed total should equal the total of what comes out
- Signing is required
- Coins are immutable
Centralization Problems
- Can make as many coins
- Does not endorse a transaction
- Can refuse to write unless has gets money
- Can stop at any point
Descroogifying the system
- How all users can agree to a chain.
- Have the ability to assign Ids
- Control and design coin miniting
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.