Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

learning course #220

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/course/1.freshman/1.blockchain.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import LucidDiagram from '@site/src/components/LucidDiagram';

# What is a blockchain?

Blockchains are secure, decentralized computer systems that anyone can use to keep track of data and run programs. Because they are decentralized, developers can use them without worrying about who is maintaining the system and whether they will act honestly. Instead of a single authority maintaining the system, a large network of independent computers called nodes ensure that the system is tamper-proof and stable.

People use blockchains to manage data that must be persistent and protected from third-party meddling, which is why a major use of blockchains is to keep track of currency balances. Because the data is spread across many nodes that follow strict rules, users can be confident that no other user can manipulate the system, change their currency balances, or refuse valid transactions.

Developers also use blockchains to host programs called smart contracts. Like currency balances, smart contracts are spread across the nodes in the system. Therefore, when you write and deploy a smart contract, you can be confident that it will run without having to worry about which computer will run it or whether someone else will try to stop it or change it.

The blockchain data itself is stored in a series of blocks of computer information, each linked to the previous block in the chain by a cryptographic hash. This link makes the blockchain tamper-evident, because if the contents of a block change, the hash no longer matches the pervious block.
onedebos marked this conversation as resolved.
Show resolved Hide resolved

<LucidDiagram width="640px" height="480px" src="https://lucid.app/documents/embedded/26bc90d0-972f-487f-8ffc-14361b5c0842" id="h~qUR~HKpsW_" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This figure is specific to Tezos ("send tez") but occurs in a BC-generic section.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacing "send tez" by "currency transaction" could do it

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll do without this image for now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come that I don't see any change on this line, nor in the figure, but you closed the thread?


Many independent computer nodes worldwide keep a copy of the blockchain data, which makes it tamper-proof and immutable. These nodes follow strict rules for adding blocks to the chain. This process of maintaining the blockchain data and handling updates is the blockchain's consensus mechanism, and it's an important part of how the blockchain remains independent of any third party meddling. We'll talk more about consensus later.

## The Tezos blockchain

Tezos is one example of a blockchain. Other popular examples include Bitcoin and Ethereum. Tezos was created by Arthur Breitman in 2018.

onedebos marked this conversation as resolved.
Show resolved Hide resolved
## State of the chain

Each time a transaction occurs on the chain, the global state of the blockchain is updated and that information is passed to all the nodes on the chain.

## Fundamentals of blockchain technology

blockchains have three guiding principles;
onedebos marked this conversation as resolved.
Show resolved Hide resolved

1. Cryptography
2. Decentralization
3. Consensus

**Cryptography:** On the blockchain, blocks are linked to each other using a verifiable cryptographic hash to keep the system secure and trusted. This means that when data has been added to the blockchain, that data cannot be altered without breaking the cryptographic link between the blocks, rendering the data invalid. Cryptography on the blockchain also prevents people from accessing your account without your private keys.

**Decentralization:** This is a core principle of blockchain technology. Decentralization means that no single entity has ownership of the systems or can access your assets (tokens) stored on the blockchain without your permission. This is unlike traditional entities like banks, big tech corporations, governments and more. On the blockchain, data is stored through a distributed network of nodes (peer-to-peer). Decentralization has certain benefits. With a bank for example, regulators can request for your account to be closed due to political differences. With a decentralized system like the blockchain, there are no regulators or third parties who hold the power to close an account.
NicNomadic marked this conversation as resolved.
Show resolved Hide resolved

**Consensus**: Consensus is the algorithm behind how users on a blockchain decide which transactions are valid and can be added to a blockchain and which transactions are not. There are two major consensus mechanisms for blockchains today, proof of work and proof-of-stake. Tezos uses a proof-of-stake mechanism. We'll touch more on what this means in future sections.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that "users decide". Rather the nodes in the system? or the BC, or the network?

You may also say "participants", which is more generic, while "users" usually means people using the BC.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use "participants"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you didn't push the update, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though differing the discussion of POS, it may be attractive here to at least give the headline (e.g.: uses POS, which avoids well-known energy-wasting issues of POW)


## What is the difference between a blockchain and Cryptocurrency?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a so common question deserving a section by iself?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I think it's important we cover the difference, particularly for newbies to the space.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that I already heard this question. Just a slight twist, maybe, to make it clear that we talk about the technologies, not about one particular blockchain and one particular currency, and also by using capitals consistently:

Suggested change
## What is the difference between a blockchain and Cryptocurrency?
## What is the difference between blockchain and cryptocurrency?

or maybe:

Suggested change
## What is the difference between a blockchain and Cryptocurrency?
## What is the difference between blockchains and cryptocurrencies?


Cryptocurrencies are digital assets used as a store of value on a blockchain. The blockchain on the other hand, refers to the entire network of blocks containing records of transactions that have been verified by nodes on the chain.

## Some use cases of blockchain

Blockchains are not just confined to cryptocurrency. Because Blockchain technology ensures transparency and security, it can have an impact in many sectors of the economy. Its use cases are endless, and here are some of those use cases:

- **Capital Markets** - blockchain technology allows for easier, faster and cheaper access to capital. For example, it enables peer-to-peer trading, quicker and transparent settlement of payments additionally it also allows for reduced costs and counterparty risks, and streamlined auditing and compliance.
- **[DeFi](https://dappradar.com/rankings/protocol/tezos/category/defi)** - Stands for Decentralized Finance. It refers to the shift from traditional, centralized financial systems to peer-to-peer finance enabled by decentralized applications. This new economic system is setting a financial standard for access, opportunity and trust in which anyone can build and participate in it.
- **[NFTs and Art](https://dappradar.com/rankings/protocol/tezos/category/marketplaces)** - A non-fungible token is some data stored on a blockchain, that certifies a digital asset to be unique and therefore not interchangeable. NFTs can be used to represent data such as digital art, video, audio, and other types of files or ownership over something.
- **Digital voting** - Organizations can use a blockchain to cast and store votes instead of in-person paper voting. This online voting process is significantly more transparent and tamper-proof, because the voting is secure and the vote record is immutable.
- **Gaming** - In-game rewards and tokens can be stored on a blockchain to facilitate trading, storage, and portability.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may specify which kind of portability (between games and gaming platforms, for example)

49 changes: 49 additions & 0 deletions docs/course/1.freshman/2.what-is-tezos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# What is Tezos?

Tezos is an open-source, public blockchain protocol that uses a low energy consumption and energy-efficient consensus. The protocol uses a self-amending governance system in which the protocol cannot be hard-forked as it continues to make changes to its existing framework.

# What is the Tezos token?

The native token of the Tezos blockchain is called tez and its ticker (symbol representing a token) is XTZ. This token is used to perform transactions on the Tezos blockchain.

## The creation of Tezos

The main weaknesses of Bitcoin and Ethereum were thought to be:

- Updates require "_hard forks_" which are highly complex and risky processes to update blockchains by splitting them into two. The communities break/spilt as the consensus could not agree on the upgrade taken to the protocol.
- *Proof-of-Work* consensus by Bitcoin is high energy-consuming based on the concentrated activity on mining facilities.
- Lack of code [verifiability](https://en.wikipedia.org/wiki/Formal_verification) of the main smart contract's low-level languages, reducing trust in the reliability of code.

In August and September 2014, *Arthur Breitman* released the Tezos' *[Position Paper](https://tezos.com/position-paper.pdf)* and *[White Paper](https://tezos.com/whitepaper.pdf)*, using the "_L.M Goodman_" pseudonym.

Arthur's goal was to keep the advantages of other blockchains and to overcome their existing drawbacks and defects.

## What makes Tezos different from other blockchains?

### Self-Amendment & on-chain governance

Self-amendment enables Tezos to upgrade itself without splitting (“forking”) the network into two different blockchains. This is important because the suggestion or expectation of a fork can divide the community, alter stakeholder incentives, and disrupt the network effects that are formed over time.

On-Chain governance enables all stakeholders to participate in governing the protocol. The [election cycle](https://www.tezosagora.org/) provides a formal and systematic way for stakeholders to reach an agreement on proposed changes to the protocol/blockchain.

### Smart contracts

Tezos offers a platform to create smart contracts and build decentralized applications that cannot be censored or shut down by third parties.

### Liquid Proof-of-Stake (PoS)

Transactions are validated on Tezos using the PoS (Proof-of-stake) mechanism. Unlike in Bitcoin where computational power - which can be very expensive - is required to validate transactions, Tezos offers a very affordable alternative for anyone to participate in helping the network to achieve consensus. We'll delve deeper into LPoS in the Junior section of this course.

## Running a node and baking on Tezos

On Tezos, anyone can run a node to verify that the transactions being added to a block are valid.

Nodes responsible for creating new blocks are called baking nodes or bakers. To become a baker on Tezos, you'll need to stake 6,000 tez. All bakers earn tez as a reward for creating a new block.

## Testnet vs Mainnet

The Mainnet is where all the transactions on the blockchain are recorded. On the Mainnet, actual tokens are used. The testnet on the other hand is a development environment that helps you test your applications safely while in development. You may use dummy (not real) tokens on the testnet but you cannot do the same on the Mainnet.

## Multiple languages

Tezos developers have a choice of languages to use when developing smart contracts. They can use the Python library SmartPy, the JavaScript/TypeScript-style jsLIGO, the OCaml-style cameLIGO, or the domain-specific language Archetype.
23 changes: 23 additions & 0 deletions docs/course/1.freshman/3.how-is-blockchain-different.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Web 1, Web 2 and Web 3

The Web has undergone a number of transformations over the years. We have had the advent of Web1, Web2, Web3. In this section, we'll talk about some of the major changes that have happened around Web technology since the early 1990s.

## Web 1.0

Web 1.0 was the static web. Users could read information on the web but were unable to interact with it. It was the very first version of the World Wide Web. In this stage of the web, static websites were built to provide information to customers. Amazon, CNN, Yahoo and MSN had very early versions of their website that provided information in a simple, static format.

![CNN](/img/course/1.3_web1.png)

## Web 2.0

Web 2.0 started from around 2005. It was known as the social web. Users could now interact with websites on the web. This was the beginning of social media. Users could create their own content and share it with others around the world. Some of the earliest platforms built on top of web 2.0 were YouTube, MySpace and Facebook.

One disadvantage with web 2.0 technologies is that all the data is stored on centralized servers controlled by the major companies who go on to "sell" users as the product. These companies are able to generate ad revenue because of the amount of data they have on users of their platform.

## Web 3.0

Web 3.0 is the decentralized web. Unlike web 2.0 where data is stored in a single database belonging to one central entity, web 3.0 applications run on the blockchain with data stored across several computers/servers (collectively known as the blockchain) scattered around the world and not owned by a single entity. In contrast to web 2.0, users of web 3.0 applications own their data. An example of a web 3.0 application is [objkt.com](https://objkt.com), [IPFS](https://ipfs.tech)

![objkt](/img/course/1.3_web3.png)

The underlying technology of web 3.0 is the blockchain - a network of computers that offer an immutable and transparent way to store information.
60 changes: 60 additions & 0 deletions docs/course/1.freshman/4.interactive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Your first transaction on Tezos

To wrap up your Freshman course, you'll complete a few practical tasks to help you get familiar with the Tezos blockchain and tools. In this section, you'll learn how to

1. Get your first wallet
2. Get your first tez
3. Send tez from your account to another wallet
4. View your transactions on the block explorer

## Getting your First Wallet

Ready? Let's get our first wallet!

There are a number of wallets that support Tezos and the XTZ token. There's [Kukai](https://wallet.kukai.app/), [Temple](https://templewallet.com/) and [Metamask](https://metamask.io/). In this lesson, we'll be setting up the Temple wallet.

**Follow these steps to set up a Temple wallet:**

1. Go to the [Temple](https://templewallet.com/) website
2. Click Web extension
3. Follow the instructions to install the extension for your preferred browser.
4. Once added, on the **Welcome to Temple** Screen, click **Create a new Wallet**.
5. Click the **PROTECTED** section under **seed phrase** to reveal your seed phrase. Make sure to store your seed phrase in somewhere secure. Your seed phrase is your key to recovering your wallet if you ever loose access to it.
6. Check the **I made seed phrase backup** box and click Next. You'll be asked to enter some of the words from your key phrase.
7. Create a password, accept the terms and hit the **Create** button. You should end up on a screen like below.

![Temple wallet dashboard](/img/course/1.4_temple_wallet.png)

Temple wallet also has a Mobile app. You may choose to install that instead.

## Getting your First tez

In this section, you'll get your first taste of the tez token. When developing applications in Web3, you'll find yourself using test tokens often. Testnets have faucets that provide test tokens.

To get your first test tez, follow the steps below;

1. First, switch your wallet to a test wallet on Temple. In your top right, click the **Tezos Mainnet** dropdown and select **Ghostnet Testnet**
2. Go to the [Faucet](https://faucet.ghostnet.teztnets.xyz/)
3. Scroll down to **Fund any address**. Copy and past your wallet address from Temple. It should start with `tz1`. Remember to switch your network on temple to the Testnet.
4. Enter the amount of tez you'll like to request. The more tez you want, the longer the transaction will take to complete.
5. Head back to your Temple wallet, and you should see your tez tokens.

## Sending your First tez

In this section, you'll send some of your tez to me. Yes! to me! Fear not :(, they are test tez.

1. Click the **send** button on your temple wallet.
2. Select the account that you recently received tez to.
3. Enter my wallet address `tz1hGDfenyU6Ex6hVgUBhQzDAW7x2Ph3Rumj`
4. You should see a breakdown of the sending fees. Select minimal - transactions on Tezos are really fast anyway. Hit **send**.
5. On the next screen, click **Confirm** to approve the transaction. A transaction hash will be displayed. Copy the transaction hash.

## Viewing transactions on the Tezos blockchain

Let's check if our transaction was recorded. To view transactions on the blockchain, we use a **block explorer**. For the Tezos blockchain, one of our favorite block explorers is [TZKT](https://tzkt.io/).

1. Head over to the [TZKT](https://tzkt.io/) website
2. Change the network at the top of the page to Ghostnet.
3. Enter the transaction hash you copied from the previous section.
4. Hit enter and you should see details of the transaction like how much was sent, what the gas fees were, the sender's wallet address and the receiver's wallet address.
![Tzkt](/img/course/1.4_tzkt_transaction.png)
Loading