Paper 3 Blockchain Test
RSA
"This is the public-key encryption algorithm. Security features of this algorithm stem from the difficulty of the factorization problem. The algorithm employs two keys — the public and the private, forming the relevant pair. The public key is used for data encryption purposes. If a message is encrypted using a public key, then, it can only be decrypted using the associated private key." The two generated prime numbers are used to create a modulus that is part of the public key → decrypted using modular exponentiation functions
Transaction Pool
(aka mem-pool) digital transition area for transactions that each full node maintains for itself. After the transaction is verified by node, waits in Mempool until picked up by a miner and inserted into a block.
Blockchain Limitations
*Energy Used* *Complexity:* blockchain technology is associated with tremendous complexity and an array of highly-specialized terms. *Network Growth:* a blockchain's network of users is vast and constantly growing, which facilitates a stronger response to attacks. In case a blockchain does not have a robust network with well distributed grid of nodes, it may not be possible to reap the full benefit of such a technology. However, there still is a risk of internal defects occurring and let us also not forget that there are physical limitations, because all the data has to be physically stored. *Risk of Error:* there is always a risk of error occurring, as long as the human factor is involved. In case a blockchain serves as a database, all the incoming data has to be of high quality. If all occurring events are not originally registered with accuracy, then the trustworthiness of the stored data could be seriously in doubt. In case unreliable, incorrect information goes into the blockchain, then unreliable, incorrect data will also go out from it. *Security Flaw:* Bitcoin as well as other blockchains are associated with one considerable security flaw, which was first brought to light by Satoshi Nakamoto when the cryptocurrency was launched. The flaw, also known as a "51% attack", refers to a situation when a group of "miners" somehow take control of more than half of the blockchain network's computing power. It is a theoretically possible occurrence, as the Bitcoin network is free and open. In other words, if a miner or a group of miners somehow manage to acquire sufficient computational power (which is a very costly endeavor), there is no centralized authority to prevent them from influencing the entire Bitcoin network. This means the "attackers" would be able to prevent new transactions from being verified, thus, they could stop payments between some users. While being in control of the network, the attackers would also be able to reverse transactions that were finalized during that same period of time. This means they could spend coins twice. On the other hand, what attackers would not be able to do is create new coins or modify already completed blocks. Due to the existence of such a flaw in the system, Bitcoin "mining pools" are subject to strict monitoring by the Bitcoin community. This way it is ensured that no user unintentionally gains such influence on the network. *Speed and Cost of Transactions (Blockchain Bloat):* during the first several years following Bitcoin's launch, transactions in this digital currency were considered as "nearly free". As of now, however, transaction costs associated with Bitcoin are notable. At the end of 2016, for instance, every single transaction in Bitcoin cost approximately $0.20 and allows users to store 80 bytes of data. As far as the speed of the Bitcoin network is concerned, currently only seven transactions per second could be processed. We should also note that for some time there have been diverging views regarding the use of the Bitcoin blockchain. Some of the opinions claimed that the blockchain should not concern transactions, but data storage instead. This leads us to another debatable topic - the so called "blockchain bloat". The latter has both positive and negative aspects. A positive aspect is the increasing number of transactions on the blockchain. This suggests a larger number of people using that blockchain and also speaks positively for the adoption of the particular digital currency in a long term. More users and more transactions are the major factors behind the accelerated growth in the size of Bitcoin and Ethereum blockchains compared to almost any other digital currency in circulation. However, increasing number of transactions equals increasing amount of data going into the respective blockchain. And, as more data comes in, this brings forth the matter involving the active storage of all that information. In such a case, the use of a hard drive with huge capacity is completely understandable, though it may turn out to be an issue for those who operate a network node. If Bitcoin and Ethereum blockchains keep on growing at their current daily rate, it may not be that long before we witness blockchains of a few terabytes in size. When it comes to the negative aspects of blockchain bloat, we should note that as blockchains grow larger, the size of each block has to increase as well. In case that does not happen, then fewer transactions will be processed with each block on the network. And, in order to address such an issue, experts in the field have already proposed "scaling solutions". *Data Modification:* Another downside of blockchain systems is that once data has been added to the blockchain it is very difficult to modify it. While stability is one of blockchain's advantages, it is not always good. Changing blockchain data or code is usually very demanding and often requires a hard fork, where one chain is abandoned, and a new one is taken up. *Private Keys:* Blockchain uses public-key (or asymmetric) cryptography to give users ownership over their cryptocurrency units (or any other blockchain data). Each blockchain address has a corresponding private key. While the address can be shared, the private key should be kept secret. Users need their private key to access their funds, meaning that they act as their own bank. If a user loses their private key, the money is effectively lost, and there is nothing they can do about it. *Inefficiency:* Blockchains, especially those using Proof of Work, are highly inefficient. Since mining is highly competitive and there is just one winner every ten minutes, the work of every other miner is wasted. As miners are continually trying to increase their computational power, so they have a greater chance of finding a valid block hash, the resources used by the Bitcoin network has increased significantly in the last few years, and it currently consumes more energy than many countries, such as Denmark, Ireland, and Nigeria.
Explanation on how the 5 Challenges are actual challenges and how they will be solved
1) Proof of Work (Validating the nodes so that they are not malicious) 2) Cryptocurrencies that use blockchain use blocks to process transactions. However, in the early days of their development, the maximum size of these blocks was limited — in Bitcoin's case, to just 1MB.Although this mechanism was designed to make Bitcoin more secure, it hasn't helped the network become future-proof. With each transaction comes data, and with a maximum size of 1MB per block, there's only so many payments that can be processed at once. At a maximum, Bitcoin can handle about three to four transactions per second. But if crypto was to go mainstream, it would need to process hundreds of thousands of transactions per second to ensure the economy could keep moving without massive delays for consumers and businesses. While bitcoin is now at a size of 32MB per block, the increasing of its size has caused the fully operational nodes to be much more expensive which in turn could be leading to less decentralization of the network. While a full solution has not been implemented yet, many see the idea of a lightning network to be a solution. This lightning network will serve as a second layer to the blockchain will be able to process unlimited transactions. They key is finding a method to shorten the transaction period and to be able to do more transactions at a time. 3) Say that understanding cryptographic techniques in blockchain cryptocurrency is very difficult due to the complex process that it takes. Look cryptography starting from *slide 19* 4) Explanation of How Balance Works in Next Quizlet Term 5) Discuss limitations of transactions through blockchain. A large change from societal norms, and is a much more complex and confusing process to learn than credit cards, cash, etc. Transactions are not instantaneous and take time. The blockchain transaction process takes a lot of energy and may not be something that can be widely available. More limitations are on *slide 29*. Solution could be having mandatory courses on one day where a certain group of citizens are brought in at a certain time to learn the specifications. Could be a slow transition from normal currency to the blockchain cryptocurrency.
Blockchain header
A block header is used to identify a particular block within a blockchain. It is repeatedly hashed to create proof of work (A way for detecting tampering in a blockchain) for mining awards. Altering the contents of a block causes the block header to change as well.
Blockchain
A chain of blocks. Where the blocks signify digital information and a chain represents a database. The blocks store information about transactions like the date, time, and dollar amount of one's most recent purchase. It also stores the participants of the transaction. Each block has its own information distinguishing it from other blocks (hashes). In order for a block to be added to the blockchain, this must occur: a transaction must occur, the transaction must be verified, the transaction must be stored inside of a block, the block must be given a hash. To be a part of the blockchain, one can opt to be a node in the blockchain network system.
Cryptocurrency
A digital currency in which encryption techniques are used to regulate the generation of units of currency and verify the transfer of funds.
Node
A node is a computer or other device that contains a full copy of the blockchain. When a miner attempts to add a new block of transactions to the blockchain, it broadcasts the block to all the nodes on the network. Based on the block's legitimacy (validity of signature and transactions), nodes can accept or reject the block. When a node accepts a new block of transactions, it saves and stores it on top of the rest of the blocks it already has stored. In short, here is what nodes do: - Nodes check if a block of transactions is valid and accept or reject it. - Nodes save and store blocks of transactions (storing blockchain transaction history). - Nodes broadcast and spread this transaction history to other nodes that may need to synchronize with the blockchain (need to be updated on transaction history).
Blockchain header - Nonce
A nonce is an abbreviation for "number only used once," which is a number added to a hashed—or encrypted—block in a blockchain that, when rehashed, meets the difficulty level restrictions. The nonce is like the "magic number" because whoever discovers it first will become the block validator. The reward is then put into the coinbase field and it is given to the miner who discovered the nonce first. The nonce must be equal or less than the difficulty target. Discovering the nonce is the main activity miners engage in during the consensus mechanism of validating blocks. The miners are competing with one another by trying to solve a cryptographic puzzle that must be below the difficulty target. It was coded in a protocol to be rather difficult so that not just anyone in a permissionless system can discover the nonce. Thus, a difficulty target was specified that adjusts the value based on the network's total hash rate.
Hash Function
Hashing functions are mathematical algorithms that take inputs and generate unique outputs. - Hash functions turn an arbitrarily-large piece of data into a fixed-length hash output - They are one-to-one: the same input will always provide the same hash output - They are one-way functions: it's impossible to "work backwards", and reconstruct the input given a hash output. Good Hashing Function - "The essential characteristics of good hashing algorithms are determinism, noninvertibility and collision resistance." A good cryptographic hash function is non-invertible, meaning it cannot be reverse engineered.
Hashing
Hashing is when an arbitrary input, typically a sentence or a phrase, is converted into a fixed-size output that is enciphered. Hashing algorithms have three main distinct characteristics: - Determinism: The SAME message should always result in the same hash. - Non-invertibility: Hashes are non-reversible, meaning that the output cannot be used to obtain the input. - Collision resistance: Duplicate hashes for DIFFERENT messages, or "collisions", should be nearly impossible. An example of a hashing algorithm is the SHA256, where an almost unique 256-bit (32 byte) hash is generated from an input.
Blockchain Advantages
Advantages of cryptocurrency using blockchain are decentralized currency regulation, transparency of transactions through direct peer to peer transactions, and immutable transaction records Decentralization ensures that peers on the network have immutable transaction records to verify if future transactions are credible or suffer from the double spend problem Simply put, the double spend problem is when the same cryptocurrency token is illegally used in multiple transactions To prevent double-spending, blockchain is used to arrange cryptocurrency transactions chronologically in a similar manner to the linked list, with references to the previous block The network then checks the order and consensus of the transactions to stop double-spending Other advantages are that MONS acts as a local currency, helping the community in all the ways described at the start Cryptocurrency can't be forged MONS also reduces fees, such as those associated with transactions and printing notes As previously mentioned, cryptocurrency is decentralized, meaning peers validate information and data is stored in multiple locations Only vulnerable to a 51% attack
SHA256
SHA-256 (secure hash algorithm, FIPS 182-2) is a cryptographic hash function with digest length of 256 bits. It is a keyless hash function; that is, an MDC (Manipulation Detection Code). A message is processed by blocks of 512 = 16 × 32 bits, each block requiring 64 rounds.
Challenges of Blockchain
Challenges of using Cryptocurrency based on Blockchain: - The main challenges of using a cryptocurrency are: how to create a transaction, how to check that the transaction is accurate, and how to record a transaction in a way so that it cannot be changed. Challenges more specific to blockchain in the introduction of a new cryptocurrency (like MONS): Understanding how new blocks are added to the ledger and how the proof of work prevents malicious nodes from taking over the blockchain network understanding how the cryptocurrency architecture is scalable and can remain efficient as the number of users increases Understanding the use of cryptographic techniques in blockchain cryptocurrency Explaining to citizens how their cryptocurrency balance is calculated from transaction data securely stored in a publicly accessible blockchain ledger Investigating how the distributed nature of a blockchain cryptocurrency and the confirmation process may have disadvantages for the citizens (of the city where the cryptocurrency is newly introduced).
One way function
Copied from online notes: A cryptographic hash function is an algorithm that can be run on data such as an individual file or a password to produce a value called a checksum. The main use of a cryptographic hash function is to verify the authenticity of a piece of data. Two files can be assumed to be identical only if the checksums generated from each file, using the same cryptographic hash function, are identical. Some commonly used cryptographic hash functions include MD5 and SHA-1, although many others also exist. Cryptographic hash functions are often referred to as "hash functions," but that's not technically correct. A hash function is a generic term that encompasses cryptographic hash functions along with other sorts of algorithms like cyclic redundancy checks.
Blockchain technology is used in a decentralized system where each node holds a copy of the entire blockchain. Explain how tampering with any existing block would invalidate the entire blockchain.
Because of the structure of a blockchain, resembling that of a double linked list, each block in the blockchain points to the previous and the next block. Specifically, the pointers used are the hashes of the previous and next block. Each block has its own unique hash, created through some cryptographic hash algorithm. Because of the collision resistance of hashing algorithms, if any one change is made to a certain block, the block's hash will change. Furthermore, due to the entropy of the hash algorithm, if any small change is made to the block, the resulting hash will be completely different. Tampering with an existing block would obviously change the information that the block carries. As just described, this would lead to an extremely different hash than the one the block originally had. Because of this, and since each block contains the hash of the previous block, changing any block's hash would then result in every single following block having incorrect information. Unless a hacker had massive computing power and could change the information in every following block until the end of the blockchain, which is already prevented by the proof of work that is used to create each new block in about 10 minutes, each block following the tampered one would have incorrect information, therefore invalidating the entire blockchain.
Blockchain Structure
Blockchain - like the name suggests - is a constantly growing chain of blocks, linked together through cryptography. A blockchain is a time-stamped series of immutable records of data that is managed by a network of computers not owned by any single entity. Each of these blocks of data is secured and bound to each other using cryptography (chain) Each block contains transaction data and points to the cryptographic hashes of the block preceding it as well as proofs of work, equivalent to saying block containing merkle root, cryptographic hash of previous function, and nonce (answer to proof of work) The blocks are linked chronologically Blockchain creates a digital structure to track transactions, contracts, and assets - like currency - which are verified and validated on every relevant computer on the network Blockchain is similar to a double linked list Each node has some information about the block, such as the block's nonce, hash, size, predecessor's hash, and merkle root The Merkle root is the root of the merkle tree which contains the information about the transactions within a block
Blockchain in Cryptocurrency
Blockchain is used to get rid of the central authority system in things like banks. By blockchain having its functionalities spread over a network of computers, cryptocurrencies can be run without a central authority. This reduces extra frees connected with a central authority (as shown in the Santa Monica Example)
Structure of Transactions in Blockchain
Blocks are generated by members/nodes of the cryptocurrency network looking for an answer to a cryptographic puzzle, to generate a proof-of-work that serves as the basis for creating a new 'mined' block The proof-of-work consolidates blocks into a chain, and creates a distributed method of time stamping transactions (increasingly difficult to reproduce a block as the chain grows in length away from it) Proof of work puzzle uses hashing algorithm, a deterministic method to produce a non-invertible output of fixed length The crypto-puzzle the nodes solve notably concerns putting the hash of the previous block and transactions in the block Peer-to-peer broadcasting systems are used in cryptocurrency that uses blockchain, as when a node finds a solution to a block, it broadcasts it, gets a consensus from other nodes, and starts mining the next block Specific to the case study and Santa Monica, each user has a 26 alphanumeric character address Transactions work by transferring a certain value of MONS from one address to another Details of the transaction are then broadcast to the network to be validated Neighbor nodes check the digital signatures to see the identity and origin of the transaction Valid transactions are sent on to neighbors and propagated in this manner until they are accepted At this point, the nodes help prevent a double-spend problem or attack Then miners have these transactions grouped into candidate blocks which can be added to blockchains They calculate a proof of work for each transaction to find a nonce for the block The miners are incentivized by receiving some MONS and part of the transaction when they find the nonce for the block Although miners can increase their chances of finding the nonce by getting better GPUs, the time it takes to validate the transaction is consistent
Mining/Staking Nodes
Can be full nodes (not always full nodes though); used to refer to the miners who solve proofs of work, broadcast the results, and verify transactions Staking nodes are for Proofs of Stake; money frozen temporarily equivalent to chance for verification and next block building
Candidate Block
Candidate blocks are blocks created by miners as part of a proof-of-work consensus process. A miner's job is to gather transactions from the transaction pool into a candidate block, and then attempt to add the candidate block to the blockchain Candidate blocks are given headers with metadata about the block - Metadata serves as an informative label To add a candidate block to a Blockchain, miners must hash the block header (plus a nonce) and hope that the result is below a certain target value The target is calculated from the difficulty, if the result is below the specific target value, the candidate block is added to the blockchain
Blockchain in Cryptocurrency More Info
Cryptocurrency is a digital currency that uses cryptography, or a method of protecting information and communications through mathematical transformations into a secure format, for transactional security and to combat counterfeiting; blockchain used for decentralization (peer to peer) and security Rooted in the basic steps of encryption and decryption, typically public and private keys are used in cryptocurrency transactions for digital signatures (made by puttygen - key generator based on entropy), which confirm transactions; - Private key for signing signature key; public key = verification key. - Signer feeds data to the hash function and generates hash. - Hash value and signature key → signature algorithm → digital signature on hash. Signature is appended to the data and both sent to the verifier. - Verifier puts digital signature and the verification key into verification algorithm → arbitrary value output - Verifier also runs the same hash function on received data to generate a hash value. - For verification, this hash value and output of verification algorithm are compared. Based on the result, the verifier decides if the digital signature is valid. - Since digital signature is created by the 'private' key of the signer and no one else has it; the signer cannot repudiate signing the data in future. Cryptocurrency uses a peer-to-peer model to handle these transactions Blockchain is used to confirm and create the immutable ledger of transactions for cryptocurrency (miners confirm transactions for the transactions to be added to node databases) We can validate transactions through miners proof of work and the use of a distributed consensus algorithm
Why are GPUs used for mining?
Cryptocurrency mining was originally performed using CPUs, or Central Processing Units. However, its limited processing speed and high power consumption led to limited output, rendering the CPU-based mining process inefficient. Enter GPU-based mining, which offered multiple benefits over the use of CPUs. A standard GPU, like a Radeon HD 5970, clocked processing speeds of executing 3,200 32-bit instructions per clock, which was 800 times more than the speed of a CPU that executed only 4 32-bit instructions per clock. It is this property of the GPU that makes them suitable and better for cryptocurrency mining, as the mining process requires higher efficiency in performing similar kinds of repetitive computations. The mining device continuously tries to decode the different hashes repeatedly with only one digit changing in each attempt. GPUs are also equipped with a large number of Arithmetic Logic Units (ALU), which are responsible for performing mathematical computations. Courtesy of these ALUs, the GPU is capable of performing more calculations, leading to improved output for the crypto mining process.
Cryptography
Cryptography is the process of converting plain text into unintelligible text and vice-versa. Simply put, data is transmitted and stored in a particular form in which only users with appropriate credentials are able to access it. There are four main objectives for cryptography: Confidentiality: Confidentiality indicates data privacy, where the sender's data is transmitted in a secure way that prevents malicious users from accessing sensitive information. Integrity: Integrity outlines that the data must not be altered/modified when transmitted from the sender to the receiver. The receiver should receive the exact information the sender wanted to transfer. Non-repudiation: The assurance that the sender of the information is provided with proof of delivery and the recipient is provided with proof of the sender's identity, so neither can later deny having processed the information. Authentication: Only the receiver of the information should be able to authenticate the information.
Full Nodes
General Description: "maintaining the consensus between other nodes and verification of transactions. They also store a copy of the blockchain. When making decisions for the future of a network, full nodes are the ones that vote on proposals. If more than 51% of them don't agree with the proposition, it gets skipped. In some cases, this can lead to a hard fork in which the community cannot agree on a certain change and thus go their separate ways, creating two chains." Sub-Type Pruned It retains all the properties of a fully node, but with specifications: "It begins downloading blocks from the beginning and once it reaches the set limit, deletes the oldest ones, retaining only their headers and chain placement." Sub-Type Archival It retains all the properties of a fully node, but with specifications: host/stores the entire blockchain
Digital Signature Broken Down
Hash the data, add private key, send as a digital key to the recipient, recipient uses the key to verify that the data is sent.
Side Branch Blocks
Mine in reference to a different node as a parent Usually has a lower difficulty than the main branch If more blocks are mined in reference to this, it becomes reorganized into the main branch Happens when creating modification to the cryptocurrency token or if there are software updates or if there is no unanimous consensus on the direction/future of the blockchain on a certain matter (ex. a hack)
Blockchain header - Height
Distance from genesis block (first block in chain)
Double-spend problem
Double-spending occurs when a blockchain network is disrupted and cryptocurrency is essentially stolen. The thief would send a copy of the currency transaction to make it look legitimate, or might erase the transaction altogether. Although it is not common, double-spending does occur.
Define Entropy in key pair generation for digital signature.
Entropy serves as a measure of randomness. Inside key pair generation for digital signature, entropy is determined by the length, complexity, randomness, and/or diversity of the characters in the key. However, how the key is generated determines the entropy. If the resulting key is a full sentence or discernable characters then it has low entropy as the information is coherent and not truly random. The idea of entropy is that with a small change in input the output is drastically different.
Types of Nodes
Full Nodes, Mining/Staking Nodes, Lightweight Nodes
Blockchain Input Output system
Functions from discrete inputs and outputs. The transactions are not kept, but the balance from the last transaction is stored in the blockchain. That information includes unconfirmed transactions (UTXO) that is added to the outputs (multiple outputs). Use balance to calculate whether accurate. Input: the money that exists. Output: money spent.
Immutable Transaction
Immutability is used to denote something which can never be modified or deleted. In a blockchain, it refers to the logs of transactions, which is created by consensus among the chain's participants. The basic notion is this: once a blockchain transaction has received a sufficient level of validation it can never be replaced or reversed or edited. Now let us see how blockchain attains immutability. If a miner tries to change a transaction from history, he will have to re-mine all the blocks from that block till the current block and this will have to be reflected in every copy of the ledger in the network. Miners will have to rebuild the merkle tree of the block in which the transaction is present and redo all the proof of work for that block. Now, since the next block stores the hash of this block, the next block will also have to be re-mined. This is because the next block will have to be edited with the new "previous block hash". This change will result in a different block hash. The new block hash might result in a hash that does not match the set difficulty level. Thus, this block will also have to be re-mined. What about the new blocks being added every 10 minutes? The computing power required to achieve this is enormous and probably only theoretical.
Transaction in Blockchain
In Bitcoin, all the transactions that took place in the last ~10 minutes are bundled together into a block and transmitted to everyone in the network. These blocks can be quite large, since they potentially contain thousands of transactions. To save on bandwidth, Bitcoin pulls off a clever trick: instead of transmitting all of the transactions, the transmitted block only includes a Merkle root of that block's transactions. (In practice, this transmitted data is known as a block header, while the transactions themselves are transmitted separately on request. We'll learn more about this later.) Timer puts the transactions in the transaction pool and then those transaction keep on going in the block until it is full.
Blockchain Miners
Ledger: file where all the transactions are Mining is performed by powerful computers that must solve extremely complex computational math problems Blockchain mining is a peer-to-peer computer process used to secure and verify bitcoin transactions. Mining involves Blockchain miners who add bitcoin transaction data to Bitcoin's global public ledger of past transactions. This addition of transactions acts as a reference point for security Put simply, Blockchain mining can be defined as the process of adding transaction records to a blockchain
Types of Blocks
Main Branch Blocks, Side Branch Blocks, Orphan Blocks
Merkle Tree
Merkle trees are a very important part of blockchain transactions structure They are binary trees that store the list of transactions in every block (binary tree of hashes) The cryptographic hash of child nodes and root block are referenced in the header Cryptographic hashes of a single node of data are held in leaf nodes Merkle trees allow information about transactions to be stored securely and efficiently, thereby making them effective for storing a large number of transactions, such as would be present in the use of MONS All stored transactions in the tree are held in a single block at the root by repeatedly hashing individual transaction leaves from the bottom to the top of the tree (basically, you start with the single nodes of data at the bottom, and those are repeatedly hashed together into leaves until it reaches the root of the binary tree) The root of the tree acts as a digital fingerprint for every transaction stored under it - this allows users to verify if all valid transactions are included Data can be proven to be part of a merkle tree and the dataset without compromising any data through a "merkle proof" → use the process just described (hash leaf nodes together until you reach the root, and since the root's hash is public, you compare the two values. If they match, the data is "valid") The implementation of Merkle trees in blockchains has multiple effects. It allows them to scale while also providing the hash-based architecture for them to maintain data integrity and a trivial way to verify the integrity of data.
Orphan Blocks
Non-validated block or inactive block if most mining was switched to a different chain OR: if two miners produce a similar block at the same time. This can happen because to complete the process of creating every block will take time. Acceptance of the blocks into the Block Chain won't happen instantaneously. In the meantime, another miner may come up with the exact same block. Now there will be some confusion in the Block Chain Network, as to which of these two identical blocks should be added to the block chain. When such tie arises, the block with the larger share of Proof of Work will be added to the Block Chain. The leftover block which has comparatively smaller proof of work will be orphaned or detached. Even though it is a valid and verified block, it will not be added to the block chain and remains as an orphan block due to the delayed acceptance.
Parts of the Blockchain header
Number of Transaction: Height: Block Reward: Timestamp: Merkle Root: Previous Block: Difficulty: Bits: Size: Version: Nonce: Next Block:
Blockchain header - Number of Transactions
Number of transactions in the block
MONS Project Limitations
Older citizens will not be as enthusiastic or trusting of the currency MONS can be harder to regulate than physical currency As by its nature, MONS is decentralized, meaning the central bank of the region cannot control the currency anymore. Thus it cannot affect the economy of the region MONS is only local - it cannot be exchanged for any foreign currencies or used in other areas of the country MONS is competing with existing currency (workers receive part of their salaries in the cryptocurrency, but still receive the other part in the physical currency)
More Miner Info
Once miners validate transaction it becomes a candidate block. With P2P everyone has a unique address. Before each transaction: digital signature. 1st verify identity of the sender using digital signature. Check that there are enough funds: that is when the double spends becomes critical. Initial node is the receiver which identifies it. Miners can improve chances by using a large number of GPUs. Why GPUs: faster to calculate quickly. Very focused and relies mainly on the ALU. Because it is so focused, it is so efficient. GPU cost is also cheaper than buying more CPUs. By increasing difficulty you take away ordinary people from being a miner. Rich people can start manipulating the market.
Evaluate cryptocurrency based on blockchain technology. Discuss two advantages & two disadvantages.
One advantage of cryptocurrency based on blockchain technology is the fact that it is decentralized. This one advantage means that no single organization can control the flow of the money or its value. This keeps the currency secure and stable as opposed to government-controlled currencies which can lead to monopolies. Another advantage is that cryptocurrency cannot be forged. While physical currencies can be recreated and re-spent, once a certain amount of cryptocurrency has been spent, it cannot be forged and reused. This helps combat fraud in a way physical currencies cannot. One disadvantage is the actual security of cryptocurrencies leading to potential financial losses. Essentially, if a user loses their unique private key to their wallet, all of their currency will be lost until they can retrieve the private key. However, due to the security of cryptocurrency, it is impossible to retrieve a private key from anything but your own memory. While the security keeps the money secure, data loss can lead to serious financial loss as well. Finally, another disadvantage is that since the records of transactions are immutable, there is no opportunity for cancellation of funds. If a user buys something accidentally and wants to cancel their order, this is now impossible once their transaction has been verified. While the immutable records obviously have benefits as well, they also pose serious threats to users who spend their currencies accidentally or are scammed and spend their currency for no product and cannot retrieve the money that they spent.
Outline two characteristics of the cryptographic hashing algorithms
One characteristic is determinism meaning that the same message should always result in the same hash. Another characteristic is non-invertibility meaning that hashes are non-reversible as the output cannot be used in order to generate the same value as the input.
Nonce
Primary Explanation: The nonce is a certain string which when plugged into the hashing algorithm adds a certain amount of leading zeros to the hash. The goal of miners is to keep on inputting nonces into the hashing algorithm until they get a certain amount of leading zeros which solves the requirements to get the reward. What makes the mining process very difficult is that it is hard to predict what the output of the hashing algorithm will be due to its high entropy. So, the node which ends up winning the reward is randomized. Secondary Explanation: "The Nonce is a number added to each block as the variable that miners can continuously change until the miner finds a Nonce that solves the math problem above. Essentially, you can continuously change the Nonce until the SHA256 hash function results in a hash with a certain amount of leading 0s. This has the added benefit that when a miner broadcasts the block to the network, everyone else can take the block and the nonce and perform the SHA256 hash of this data and see that indeed this gives you a hash with the correct number of leading 0s.
Santa Monica Case Study Background Information
Problem: Santa Monica is a typical town, however, over the past few decades there has been a decline in population and local businesses. Many inhabitants are spending their money on products from multinational companies which do not bring money back to the city. This is something which the mayor Pablo wishes to reverse. Solution: To reverse this process, Pablo decided to investigate other cities which have made their own currencies and decided that this could be implemented inside of Santa Monica. He found that cities like Santa Monica that implemented their own currency got a lot of benefits from doing so. However, he saw that many cities also failed to implement their own currency due to the administration costs of having to print notes, combat fraud, and providing additional bank services. To fix this problem, Dolores, a CS student, proposed to implement a cryptocurrency based on blockchain. This solves the administration cost problem as there is no need for central administration. Meaning that two strangers can perform a transaction without needing a central authority (which would increase costs). The final step is promoting the new cryptocurrency MONS across the inhabitants of Santa Monica.
Digital Signature
Process: - Public-private key pair. - Key pairs used for encryption/decryption and signing/verifying are different. Private key for signing = signature key; public key = verification key. - Signer feeds data to hash function and generates hash. - Hash value and signature key → signature algorithm → digital signature on hash. Signature is appended to the data and both sent to verifier. - Verifier puts digital signature and the verification key into verification algorithm → arbitrary value output - Verifier also runs same hash function on received data to generate hash value. - For verification, this hash value and output of verification algorithm are compared. Based on result, verifier decides if digital signature is valid. - Since digital signature is created by 'private' key of signer and no one else has it; the signer cannot repudiate signing the data in future.
Proof of Stake
Proof of Stake is when a miner's computing power is based on how much of the cryptocurrency they have. With proof of work, miners have to use a lot of energy for faster GPUs so that they have a better chance of solving the POW to find a block's nonce. With proof of stake, instead of miners having to use their currency to fund their expedition for more currency, the amount of currency that a miner starts with determines their computing power
Explain how new blocks are added to the distributed ledger and how the proof of work prevents malicious nodes from taking over the MONS network.
Proof of work inside of blockchain is a consensus algorithm which is used to confirm new transactions and add new blocks to the distributed ledger. With proof of work, different miners compete with each other in order to complete transactions on the network and get their reward. In order to get this reward, a miner has to find the nonce which satisfies the intended result. The nonce is a certain string which when plugged into the hashing algorithm adds a certain amount of leading zeros to the hash. The goal of miners is to keep on inputting nonces into the hashing algorithm until they get a certain amount of leading zeros which solves the requirements to get the reward. What makes the mining process very difficult is that it is hard to predict what the output of the hashing algorithm will be due to its high entropy. So, the node which ends up winning the reward is randomized. Once a miner 'wins' this process, the block is added to the distributed ledger. The proof of work prevents malicious nodes from taking over the blockchain network due to its inherent process. When different miners begin to start mining for the nonce, they decide to agree to the specific set of rules in which they are not trying to take over the blockchain network. This process ensures that each miner checks on the other miner in order to make sure that there are no malicious nodes as all transaction processes are public. The PoW sets a different difficulty based on the miners, so a higher difficulty means a harder "problem" to solve. Furthermore, the proof of work process is protected by a cryptography and a key process which requires both sides to sign upon the transaction to ensure its validity.
Proof of Work
Proof-of-Work, or PoW, is the original consensus algorithm in a Blockchain network. In Blockchain, this algorithm is used to confirm transactions and produce new blocks to the chain. With PoW, miners compete against each other to complete transactions on the network and get rewarded. In a network users send each other digital tokens. A decentralized ledger gathers all the transactions into blocks. However, care should be taken to confirm the transactions and arrange blocks. This responsibility bears on special nodes called miners, and a process is called mining. The main working principles are a complicated mathematical puzzle and a possibility to easily prove the solution. It's an issue that requires a lot of computational power to solve. There are a lot of them, for instance: - hash function - normal problem: finding a nonce to combine with hash that is less than the target based on difficulty - integer factorization - find validating prime factors and create an integer from it. - guided tour puzzle protocol - experimental variant to the proof of work where miners have to design a method to visit a set of pre-defined nodes in a sequential order within a set of efficiency bounds As the network is growing, it is facing more and more difficulties. The algorithms need more and more hash power to solve. So, the complexity of the task is a sensitive issue
Scaling Blockchain
Proof-of-work has proven to be an elegant system with a very small attack surface. However, there is 1 main drawback; it is pretty slow. In proof-of-work, security comes at the expense of speed. This has put strong limitations on what smart contract blockchains like Ethereum can achieve. In an attempt to achieve faster transaction speed while maintaining a high degree of security, Ethereum plans to switch to a consensus model called proof-of-stake. While proof-of-stake will not directly lead to faster transaction speeds, it is expected to enable sharding.
Types of Encryption
RSA, DSA, Digital Signature
Main Branch Blocks
Regular blocks that extend the blockchain (after having been verified and confirmed)
Security Provided by nodes
Since blockchains utilize a p2p network, the majority of nodes have to verify the creation of a new block. This creates distributed consensus which prevents the likelihood of an invalid block being created. Determinism (operation replayed on a different node at a different point in time should produce the same results.) Thus, a hacker would need to control more than 50% of the nodes that exist within a network. This is known as a 51% attack or a takeover attack.
Blockchain header - Timestamp
The "time" or timestamp is a 4 byte file that is the time measured in Unix epoch time. This is the number of seconds that have elapsed since January 1970. The timestamp begins when the miner started the hashing header. This must be strictly greater than the median time of the previous 11 blocks. Full nodes will not be accepting blocks with headers that are more than 2 hours in the future according to their clock.
Explanation of How Balance Works
The Input & Output system: - Cryptocurrency functions off of discrete input and output. - Transactions have an input and an output. - Every transaction has their reference input as a previously unspent output. - "Money" or output is spent when they are referenced in the input of a new transaction. Keys - We have already established that each client has a private key and a public key. - The address, used to send and receive money, is a shortened representative form of the user's public key. - The private key is used to indicate ownership of funds. - In an abstract way, the public key is an email address and the private key is the password that grants access to the email account. More in-depth - In a blockchain (such as Bitcoin) there is a Unspent Transaction Output Set or UTXO. - The UTXO is a subset of all the unspent output in the blockchain. - If a citizen of Santa Monica has 7 MONS, then it refers to the sum of all the unspent output in the blockchain that corresponds to public keys the user has a private key for. How to explain it to the people of Santa Monica - To calculate the balance, the system looks at the amount of money you didn't spend. - If you buy something new for 1 MONS, the system first looks at how much money you have left over from the previous transactions. - Everytime you purchase something, a certain amount of money is "left-over". The sum of this is your balance. - Hence, the money left over from every transaction are then added up into something called "unspent transactions". - The 1 MONS is then is subtracted from the "unspent transactions". = And the cycle repeats. Summary This is a challenge as blockchain is a very complex process. Then need to mention how it assures their rights and privacy. A cryptocurrency public ledger is a record-keeping system. The ledger maintains participants' identities anonymously, their respective cryptocurrency balances, and a record of all the genuine transactions executed between network participants. Scaling and security concerns are one challenge for cryptocurrency public ledgers and transactions.
Blockchain header - Merkle Root
The Merkle Root field is 32 bytes in length and contains the hash of the blockchain Merkle Root. It uses the same function as the previous block header hash. The Merkle Root is derived from the hashes of all transactions included in this block. Hashing makes sure that that none of those transactions can be modified without modifying the entire header. Once again this is a tamper resistance measure that provides security for the block, an important feature of a public, decentralized and trustless system. The Merkle Root consists of all the TXIDs (transaction ID) of transactions in the block. The TXIDs are placed in the order required by the consensus rules. The total length of 32 bytes is the result of the SHA256 hash function. The input is converted from a variable-length value to a fixed value that is 256 bits in length. The Merkle Root can always be traced back to the very root of the data tree structure (i.e. The Merkle Tree) and is a fast and efficient way to verify the data.
Blockchain header - bits
The difficulty target is a 4-byte file also referred to as the Bits. The encoded version of the target is a threshold that the block's header hash must be less than or equal to. The Bits specify a value or target threshold that contains leading zeroes. This is the basis of the difficulty target, which is not the same as the Bits. For example, on the Bitcoin network, The difficulty target is adjusted every 2,016 block. This information is important for miners in particular. The difficulty target is coded as a Blockchain (Bitcoin in this example) protocol. This determines how difficult the hash value should be based on the network's total hash rate. When there are too many miners, the hash difficulty increases in order to control the supply of Bitcoin. If the difficulty is too easy, the block propagation time falls below 10 minutes on average. This could exhaust the supply of BTC given very quickly, and hash rates do increases as more powerful mining devices are added to the network. When the block propagation time is more than 10 minutes, the difficulty is too high, so the protocol code ensures that the difficulty must be decreased. For this example at the bottom of the page, the difficulty value has a hexadecimal form that was converted to 419486617. The lower the value of the difficulty target, the harder it is to generate a block.
Blockchain header - Next Block
The hash of the next block header
Entropy
The measure of true randomness Measured in: N-bits of entropy Example: Words from wordlist 8 words from 2048 word list -> 88-bits of entropy Application: Key generation Relates to how the key is generated Key with higher entropy = more permutations Elaboration on how it is measured: An N-bit number chosen uniformly at random with a perfect random number generator should have N-bits of entropy. Application: The entropy is determined through the length, complexity, randomness, and/or diversity of the characters in the key However, entropy is determined through HOW the key is generated A sentence may seemingly have high entropy, but in reality the level of randomness is low (you have coherent sentences instead of random characters) . Hence a low level of true entropy. If Hash function has a high entropy, a small change in input will lead to a big change in output.
Lightweight Nodes
These types of nodes communicate with the blockchain while relying on full nodes to provide them with the necessary information. They don't store a copy of the chain, they only query the current status for which block is last, and broadcast transactions for processing.
Outline the structure of the Merkle Tree.
This is something which is vital to the blockchain transaction structure. This is a binary treewhich stores the list of transactions in every block (it is a binary tree of hashes). Thisstructure has a branching factor of two meaning that every parent node has two child nodes.In the header, the cryptographic hash of child nodes and root block are referenced. All ofthe transactions that are made are stored in one block at the base of the tree by hashingrepeatedly all the blocks from the bottom to the top of the merkle tree. This root of the treeserves as a digital fingerprint as one can verify that all transactions are included. A Merkletree allows for blockchain to scale while also providing a hash-based architecture whichprovides data integrity.
Merkle Proof
Traversing up the tree (merkle) to obtain the root hash (sometimes publicly known) by "hashing hashes"
More digital signature info
Verification of signature not verifying message, but verifying who is the sender. To do this takes their public key and checks against the hash of the transactions. Simple pay verification technique, can carryout merkle proofs with a small portion of the transactions.
Ciphering
When it comes to algorithms within cryptography, they revolve around the one central concept of: *Ciphering* - Ciphering is the act of converting plain text, which can take the form of letters and numbers that form coherent sentences for example, and converting them into ciphertext. - Ciphertext will appear as strains of noncoherent text that visually does not make sense. *Three types of algorithms: secret key, public key, hash function* Secret key: Also known as symmetric encryption, is where ONE KEY is used to encrypt and decrypt the information. Public key: Also known as asymmetric encryption, where a PAIR OF KEYS are used. Public keys may be disseminated widely, and private keys, which are only known to the owner. Hash function: Any function where data is mapped from an arbitrary size to a fixed-size.
Further Info On Challenges
While the MONS project has many advantages, it also comes with challenges Scaling up the MONS project efficiently is a large challenge, as the system is very susceptible to a 51% attack while starting Communicating to citizens of Santa Monica how their account balance is stored and calculated would be difficult (essentially, helping less technologically capable citizens understand the new currency) Gaining the trust of the citizens of Santa Monica in order to convince them to use MONS In that vein, getting enough users to prevent an easy takeover attack would also be a challenge Distribution of blockchain and the confirmation process may pose disadvantages to residents because people can take over the network through routing, Sybil, or 51% attacks, creating malicious issues; on longer transaction times, proofs of work for confirming transactions take time Understanding how new nodes are added and how proof of work prevents a loss of control of the system High administrative and setup costs (beyond setting up the cryptocurrency, cost of awareness campaigns, educational material, etc.) Also has a high cost due to large amounts of computational power required
More Nonce info
Why validate the block?: they get a compensation based on the difficulty of the block. Incentives: charges small fees for being on the network. What happens when amount of time need to figure out the block chain is too long or too short: Too short makes it too easy to be found - allows for easy manipulation of the network. If too long, turns people as it is too slow to get any money Amount of starting 0s makes the nonce more difficult. Hashing is not so difficult. The target is not a specific value, it is a less than value. <= target bunch of 0s followed by a number of case study.
Blockchain header - Difficulty
a measure of how difficult it is to find a hash below a given target
Blockchain header - Block Reward
amount awarded for solving the block
Ledger
file where all the transactions are
What is SHA 256 Hash Generator
he SHA (Secure Hash Algorithm) is one of a number of cryptographic hash functions. A cryptographic hash is like a signature for a data set. If you would like to compare two sets of raw data (source of the file, text or similar) it is always better to hash it and compare SHA256 values. It is like the fingerprints of the data. Even if only one symbol is changed the algorithm will produce different hash value. SHA256 algorithm generates an almost-unique, fixed size 256-bit (32-byte) hash. Hash is so called a one way function. This makes it suitable for checking integrity of your data, challenge hash authentication, anti-tamper, digital signatures, blockchain. With the newest hardware (CPU and GPU) improvements it is become possible to decrypt SHA256 algorithm back. So it is no longer recommended to use it for password protection or other similar use cases. Some years ago you would protect your passwords from hackers by storing SHA256 encrypted password in the your data base. This is no longer a case. SHA256 algorithm can be still used for making sure you acquired the same data as the original one. For example if you download something you can easily check if data has not changed due to network errors or malware injection. You can compare hashes of your file and original one which is usually provided in the website you are getting data or the file from. SHA-256 is one of the successor hash functions to SHA-1, and is one of the strongest hash functions available.
PuTTYgen
key generator tool for creating pairs of public and private SSH keys. one of the components of the open-source networking client PuTTY. originally written for Microsoft Windows operating system, now available for multiple OS' (ex. macOS, Linux) PuTTYgen.exe is a graphical tool on Windows OS. Linux OS has only command-line accessible using SSH commands.
Blockchain header - Size
size of the block; how much data
Self-referential data structures
structures that have one or more pointers which point to the same type of structure The first block (also known as the genesis block) does not point to a previous block. When one block is tampered with, each of the following blocks are made invalid since they don't contain the right hash to the previous block. So, a hacker would have to recalculate all the hashes of the following blocks to make the chain valid again.
Blockchain header - previous block
the hash of the previous block header. This is what links a block to the rest of the blockchain. The previous block hash is a 32-byte field that contains the hash of the previous block header. This contains a pointer to the previous block, a very important feature in a blockchain. This information cannot be modified without requiring modifying the previous blocks. Thus if you had 200,000 blocks and you attempt to change the hash value of the previous block, the avalanche effect will occur which means it requires changing the other previous hash values. This will require plenty of computing power hash rate that will be too difficult. This feature of linking hashes is what provides the block's security and tamper resistance. It can still be changed, but it would affect the entire blockchain and this would, in theory, require what is called a 51% attack. Reversing all transactions is thus difficult to do on a blockchain due to the hashing of the block header.
Blockchain header - Version
the version number of the block which follows the consensus rules of that protocol version.