In the next few slides, we’ll be presenting
various cryptographic primitives that will
be relevant in this lecture and in future
ones, so pay close attention, and try to imagine
situations where this primitive might be useful
for accomplishing some goal.
One of the primitives you should be familiar
with by now is the cryptographic hash function,
which we shorten for convenience to hash function
or just hash.
Keep in mind, though, that cryptographic hash
functions are NOT the same as typical hash
functions, even though we’re shortening
the name for convenience.
As mentioned before, cryptographic hash functions
are used to fingerprint a piece of information.
This is done through preimage, second preimage,
and collision resistance, as explained in
the previous course, Bitcoin and Cryptocurrencies.
Let’s look at an example where hashes are
important for securing a blockchain network.
And we’ll do this by taking a sneak peak
back at how Bitcoin’s tamper evidence system
works.
First and foremost, the Merkle Root.
By using hash functions, we can capture the
identity of the information without revealing
anything about the information.
For example, if we take the hash of a transaction,
the idea is that the transaction data will
no longer match with the hash, the identifier,
if modified, also implying that no other transaction
will match this identifier as well.
The Merkle Root effectively does this over
every transaction in the block.
Second is the previous block hash, which points
to the previous block in the blockchain.
This makes the block permanently attached
to the previous one.
By doing this throughout the blockchain, the
chain becomes immutable.
Anyone trying to manipulate the history will
corrupt that block and anything onwards.
Third is the block header hash, which needs
to satisfy the requirement of being below
a certain target value.
This is the part of the design which enforces
Proof-of-Work.
Miners repeatedly try hashes until the block
header hash is satisfactory.
Without the properties of hashes, it would
be difficult to enforce these restrictions.
Another cryptographic primitive is the digital
signature, used to cryptographically prove
your identity.
Each individual has a public facing identity
and a private piece of information used to
authenticate themselves.
We recall from Bitcoin the public and private
key scheme used by each individual entity
to receive and send bitcoins.
Through using digital signatures, we assume
each real world entity can have at least one
virtual representation of themselves, and
that no one else can pretend to be that person.
It’s not uncommon for information to be
lost in transit or in storage.
Is there a way to protect that information
without duplicating it repeatedly?
This is what erasure codes attempt to solve.
Erasure codes construct an algorithm to add
additional pieces of information to a piece
of data.
Even if some pieces of data are lost, you
can still reconstruct the original information
if you have enough pieces of data left.
This is used frequently in memory replication
protocols, such as RAID, as a way of ensuring
data preservation and security.
Timelocks are a special kind of encryption.
Timelocks allow for a message to be easily
encrypted but take a longer amount of time
to decrypt.
In other words, there is a built-in delay
before the information can be retrieved.
In addition, it is highly difficult to find
ways to speed up the decryption of this information
in parallel, meaning that putting multiple
computers together won’t decrease the delay
time.
This will allow us to ensure that data is
not opened for some amount of time.
The equation on the right demonstrates how
we can do this.
The value of n in the exponent is proportional
to how much time it takes to decode, allowing
us to easily adjust the functionality of this
timelock to our specifications.
