Skip to content

Commit

Permalink
Merge pull request #188 from Cyfrin/justin/upd-701-update-a-few-image…
Browse files Browse the repository at this point in the history
…s-with-the-new-syntax-for-testing

Update a few images with the new inline syntax for testing
  • Loading branch information
solhosty authored Sep 3, 2024
2 parents 3016c62 + e5701aa commit eae8a0a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Beyond just teaching you to code, this course prepares you to maneuver DeFi, NFT

### Best Practices

<img src="/blockchain-basics/git-repo.png" style="width: 100%; height: auto;" alt="git repo">
::image{src='/blockchain-basics/git-repo.png' style='width: 100%; height: auto;' alt='git repo'}

Let's start by covering some of the best practices to help you get the absolute most out of this course.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Let's jump right in!

### Transaction Fee and Gas Price: What are they?

<img src="/blockchain-basics/06-intro-to-gas/intro-to-gas1.png" style="width: 100%; height: auto;" alt="etherscan transaction">
::image{src='/blockchain-basics/06-intro-to-gas/intro-to-gas1.png' style='width: 100%; height: auto;' alt='etherscan transaction'}

While inspecting an Ethereum transaction, two terms invariably catch the glance: "transaction fee" and "gas price". Let's clarify what they are and why they matter.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In this lesson, we're going to break down blockchains, the process and the techn

At its simplest, a hash is a unique, fixed-length string that serves to identify any piece of data. When you input any kind of data into a hash function, it produces a hash. In this demo, the hash algorithm we'll focus on is SHA-256.

<img src="/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work1.png" style="width: 100%; height: auto;">
::image{src='/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work1.png' style='width: 100%; height: auto;' alt='hash function'}

If I add `Patrick Collins` to our `SHA-256` algorithm, it will:

Expand All @@ -31,7 +31,7 @@ In the application, whatever data you enter into the data section, undergoes pro

Now that we've grasped the concept of hashing and fixed-length string, let's inspect the structure of a blockchain—a collection of "blocks."

<img src="/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work2.png" style="width: 100%; height: auto;">
::image{src='/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work2.png' style='width: 100%; height: auto;' alt='blockchain'}

A block takes the same data input, but instead of a singular data field, a block is divided into 'block', 'nonce', and 'data.' All three are then run through the hash algorithm, producing the hash for that block. As a result, even a minor change in the data leads to an entirely different hash, hence, invalidating the block.

Expand All @@ -43,7 +43,7 @@ The problem or criteria a miner has to solve will vary from blockchain to blockc

In a blockchain, which is essentially a sequence of blocks, each block is comprised of the previous elements - a block number, a nonce and data - as well as `the hash of the previous block`

<img src="/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work3.png" style="width: 100%; height: auto;">
::image{src='/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work3.png' style='width: 100%; height: auto;' alt='blockchain'}

What this means in practice is that any changes to data, in any block of the chain, will invalidate every proceeding block, until they are recalculated, or re-mined.

Expand All @@ -55,7 +55,7 @@ Now, if a single entity were to control the blockchain, they could conceivably c

_Enter Decentralized Distribution._

<img src="/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work4.png" style="width: 100%; height: auto;">
::image{src='/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work4.png' style='width: 100%; height: auto;' alt='blockchain'}

The crux of blockchain's power lies in its decentralization or distributed nature. Under this system, multiple entities or "peers" run the blockchain technology, each holding equal weight and power. In the event of disparity between the blockchains run by different peers (due to tampering or otherwise), the majority hash wins, as the majority of the network agrees on it.

Expand All @@ -65,7 +65,7 @@ Nodes that don't agree with the majority effectively fork the network, continuin

Until now we've been considering the data passed in a block to be a random string of text, but the reality is - this data can be anything. In the token and coinbase sections of this demo you can see how each block is comprised of a number of transactions that all get hashed together. Any edits to any of these transactions is going to invalidate the chain!

<img src="/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work5.png" style="width: 100%; height: auto;">
::image{src='/blockchain-basics/07-how-do-blockchains-work/how-do-blockchains-work5.png' style='width: 100%; height: auto;' alt='blockchain'}

### Wrap Up

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In the context of blockchain technology, Layer 2 (L2) solutions like ZK Sync off

We extend our gratitude to Matter Labs and the ZK Sync team for being the lead sponsor of Cyphrin Updraft: their commitment to making Web3 developer and security research education accessible has allowed us to offer this course for free. Additionally, we thank Arbitrum and Optimism for their historical support. Transparency is crucial, so we list all sponsors in the [dedicated section](https://github.com/Cyfrin/foundry-full-course-cu?tab=readme-ov-file#sponsors) of the GitHub repository associated with this course. We also provide alternatives to ensure you can choose the technology that best suits your needs.

> 👀❗**IMPORTANT** <br>
> 👀❗**IMPORTANT**:br
> At the end of each section, you'll find links to challenge contracts that you can solve to earn NFTs.
### Deploying to production
Expand Down

0 comments on commit eae8a0a

Please sign in to comment.