Free online blockchain course

blockchain course

This free online blockchain course contains several issues, some more technical and others more generals such as blockchain and what is it for, or if a blockchain is reliable, or if a blockhain is needed.

The second part is a blockchain technical course from scratch.

By the way, if you want to get free cryptocurrencies watching a few videos to learn, you can take a look at Coinbase that is also an excellent exchange.

What is Blockchain?

Introduction

Originally the term blockchain comes from English and means "block chain".
The daily term that I have seen on some occasions is that Blockchain is like an excel sheet distributed among several computers of a network.

It is a considerable simplification because it does not comment on the main characteristics of blockchain:
1.The information is stored in blocks that are chained In one way, which we will see later.
2. This Block set is distributed among the nodes of a network(of computers). Some nodes can add new blocks.
3. There is no central server, where this block set is centralized. It is decentralized.
4.Use asymmetric cryptography (public/private key) and of theHASH functionsTo provide security to this system.
5. There are someConsensus rules that the nodes of the network (the participants) accept and that it allows to manage who can create and add blocks to the chain, and who can give these blocks valid.
6. The blocks once created and published in the main chain cannot be edited, the information saved is maintained historically throughout the life of the chain as long as there are nodes (computers) that are storing and sharing the block chain among the rest of the nodes.

So broadly the Blockchain fundamental piecesare:

  • A Non-modifiable block chainthat store certain historical information of a tangible or intangible object
  • He storage (and/serialization)of those blocks/transactions in memory and hard drive
  • A NODE NETWORK(computers) that communicate Peer to peer(among them)
  • The use of functions of Asymmetric Public/Private Cryptographyand functions ofhash
  • A consensus algorithmTo manage who can consult, create or validate blocks
  • A API Restto offer block consultation services, accounts, transactions, etc.

What is Blockchain for?

Introduction

In general we can say that Blockchain serves to have a non -manipulable and historical record at the time of who has the property of a physical or digital object. This object can even be something abstract and not tangible. With the records that are stored in the blockchain we can see how that object goes hand in hand.

Among the blockchain use cases we can find:

  • Cryptocurrencies and Stable Coins (Bitcoin, Ethereum, Solana, Circle, Tether, DAI)
  • The supply chain (industrial sector, automotive)
  • The food and traceability industry
  • The health sector (medical, records) and that of pharmacies (prescription and dispensing of medicines)
  • certify the origin (luxury articles, works of art)
  • Property registration (real estate, vehicles)
  • Intellectual Property Registry (music, video games, digital artists, ...)
  • Digital identity record (governments)
  • Fintech, Segctech (international transfers between banks, peer peer micro-credits)
  • Donations (transparency)

Bitcoin's example

In the case of the Bitcoin blockchain, it serves to have a record of how a bitcoin amount is transferred Satoshi. A Satoshi is the minimum Bitcoin unit corresponding to 10-8Bitcoin.
To identify the owner of those Satoshis Public/private key cryptography is usedIn this way our name or our data does not appear, both only an amount of number and without any meaning. We can say that it is practically anonymous, although it really is not at all.
An owner has a couple of keys (at least), a public and a private one, the two are related to each other.
In the registration of transfer of those "satoshis" appears the public key of the owner (in reality its address that is a sequence of numbers and letters generated from the public key).
The owner must secretly save the private key, which allows us to make transactions with those satoshis.
Only the one who has the private key can transfer that asset (satoshi) to another user (to another public key or address). Which colloquially means transferring that amount of bitcoin.

Possible blockchain uses

With this idea in mind, sure we see Blockchain potential uses
All those sectors or industries that carry A record or a historical states of an asset (physical, digital, conceptual)in its broader sense and that You want to decentralize your management, to work between people (peer to peer), organizations, departments, groups, so that not that information is not centralized on a single server.
Some examples blockchain:
Blockchain in the Property Registry,
Blockchain in electronic money transactions,
Blockchain in the Incident Registry,
Blockchain in the vehicle registry,
Blockchain in the real estate registry,
Blockchain in the articles of a blog,
Blockchain in the Civil Registry,
Blockchain in the registry of luxury articles or works of art,
Blockchain in the Intellectual Property Registry,
Blockchain in the register of pieces in a supply chain,
Blockchain in the Registry of Medical Acts,
Blockchain in the cryptocurrency transfers record,
Blockchain in the citizen identity record, ...
The list is really impressive and this is just some examples.

We can glimpse that there will be a blockchain with different characteristics for each use.
Public, if anyone can see the blocks.
Private, if access to the blocks is restricted to members of a group, or a consortium, an organization, etc ...
Permitted or not. With block creation permits only a few nodes or everyone ...

Is Blockchain reliable?

It depends. Not all blockchain protocols are 100%reliable.
Currently, according to a website that listing cryptocurrencies, there must be more than 2000 blockchain projects.
Is Bitcoin reliable? We can affirm with a high percentage of probability that yes. It is the most reviewed code of all these projects, the most capitalized, the number of nodes in the network is enormous compared to small blockchain projects and the consensus algorithm of the work test remains safe.
At cryptographic security level, almost all these protocols use asymmetric cryptography and 256 -bit hash functions, so the day that the security of these algorithms is "broken", possibly most blockchain projects included Bitcoin stop being safe.
Now, if you do not keep your private password properly, you can expose to stealing the bitcoin that you have that address. So the best way to be sure is not to share the private key with anyone, and use new addresses in each transaction.

Do I need blockchain?

Before considering if someone needs blockchain, we must think if The goalIt is our profession/work or a hobby. Below I show a compilation of the different users who are usually interested in blockchain:

With a professional objective:

  • The investor in projects, startups or ICOs. He is a person who invests his money on cryptocurrency blockchain projects waiting to obtain a long -term economic performance.
  • The founder (CEO / cto) of a startup that uses blockchain technology
  • The user or manager who is interested in using blockchain in a non -profit organization
  • The official who is interested in using blockchain for the public sector/government
  • The businessman who is interested in using blockchain in his company
  • Blockchain protocol developer, a programmer generally
  • The one dedicated to the marketing of Blockchain projects
  • Bitcoin and cryptocurrency trader (professional)
  • The Minero (Entrepreneur) of Cryptocurrencies Medium/Large Scale
  • The operator of a master node or a node of the network, a devotee generally
  • The one dedicated to training and sells courses or master in blockchain
  • The one dedicated to developing blockchain projects to third parties (to public or private companies)

With an amateur objective:

  • The user who has just discovered cryptocurrencies
  • The user that mine cryptocurrencies like hobby
  • The student of Ade, Law or Enginery who wants to learn or specialize in blockchain
  • The user who is curious about blockchain technology
  • Bitcoin's enthusiast

Depending on your interests I can recommend aHyperledger tutorialIf you want to use a blockchain at the business level, or aSolidity tutorial, or atutorial as mining ethhereumIf you are interested in mining, or if you want to start using cryptocurrencies or need them to test your blockchain projects, I recommend looking for "Bitcoin Testnet Faucet" in a search engine to obtain the 3 or 4 websites that give free cryptocurrencies without any risk.

After summarizing the various profiles interested in blockchain, which I have found these 2 years, we can say that it is mainly such an incipient technology that has served To make money forming people in blockchain or creating icos to capture investor money.
For the rest of the companies, since it implies a strong economic investment and the recycling of the workers (their training or new hiring), their use does not seem profitable, although each individual business case should be known.
Another problem is the "decentralization" that brings blockchain, not all businesses can adapt that characteristic, it seems that the majority of the business system is based precisely on the centralization of information and services.

The business projects that I know have not left the concept test.
It is a technology that has generated New jobs, especially in newly created startups, in concrete locations such as Switzerland, the United States, Singapore, Berlin, ... and possibly in the future a job market will be created, formerly non -existent, and like any new tool or technology, public and private companies will have interest in using it, either to improve their business processes, or to reduce costs.
This technology also allows to create value proposals differently from that traditional in several sectors, so it is also known as a disruptive technology, capable of changing the world, especially in relation to intelligent contracts.

The first project that used blockchain technology (and the one that has been most successful) has been the Bitcoin, which already has more than 9 years of history.
Its star product is a digital concept called Bitcoin, encompassed within the cryptocurrency category.

Bitcoin is an intangible concept, because it does not exist physically as a metal coin or a paper ticket.
It exists as an accounting note in a shared transaction book, which shows reliablely who has a bitcoin (or a Bitcoin fraction) as such.

The CADUX project

Introduction

The CADUX projectIt is an online learning project (in Python) in which we are going to createBlockchain from scratchin blog or tutorial format with weekly deliveries.
I believe that access to Blockchain knowledge free and other technical subjects in general must be a universal right, as well as Wikipedia, this free online blockchain course is provided as is, although of course, you can make contributions!

The user can find a Master Blockchain or course specialized in payment blockchain, but it is not necessary if one does not know how to train in blockchain first.
Thus, it is first advisable for a free online blockchain course and then expand the knowledge on more concrete, specific and always hand in hand with recognized centers, with proven experience, of which we can advise you some if you really already have it very clear (leave a comment or a contact message and we will send you that information).

The CADUX project is mainly a course specialized in blockchain for technical profilesIt is a blockchain programming course, which is not oriented to a business or marketing profile, although it can be useful for acquiring some concepts but without going much in detail. So I think the technical profiles will fit perfectly in this Blockchain Free Blockchain course.

If you know nothing about Python, you can take a look at thisPython interactive tutorialbasic to familiarize and execute these exercises interactively.
Python is not the most optimal language for blockchain, but it is the most indicated for learning (and for other sectors such as AI is a pointer).

Obviously you can also study a blockchain course at the University if you are studying or a few years ago you finished the race. You can also find some blockchain course in Barcelona or Madrid, two reference cities for this type of courses, although curiously it may be that there is a talk in a lost town in Spain, but I reiterate, the best training offer in Blockchain face -to -face is Madrid and Barcelona.

The CADUX project consists of several iterations with code examplesdiverse that make up various fundamental technical pieces of blockchain.
You will find from examples of cryptography, block storage in a database, P2P networks, some consensus algorithm, and creation of an API Rest.

How can I help?
  • Making a contribution with ETH cryptocurren
  • Writing articles or guides for the web or for this course
  • Sharing our tutorials on Twitter, Facebook, ... on all social networks

These Python code examples have our copyright withA MIT license


Iteration 0. A block chain linked with hashes

In this first iteration, the main concepts are used:
A block that contains certain data such as height (the block number), the Timestamp, the block data, the hash of the previous block and the hash of the current block.
A blockchain as a block list.

blockchain

Hash

What is the hash? This is a concept that must be understood, because it is one of Blockchain's keys.
A hash function allowstransform an input data(as a text chain) in a Fixed length output dataand different for each different input data.
It is also practically impossible to obtain the input data knowing only the output data.
And it is also very unlikely that two different input data result in the same output data.
They are functions that"Input information" digieTo get a fixed length exit data, usually 256 bits (32 bytes), Hash256 functionor 160 bits (20 bytes) Ripemd160 function
Hash256 (dato entrada) := dato salida de longitud fija 32 bytes
Ripemd160 (dato entrada) := dato salida de longitud fija 20 bytes

Iteration 1. The ECDSA for the generation of keys

As I said previously to carry out certain actions such as the transfer of a record of the "property" of a certain "ASSET" or active in the blockchain, asymmetric cryptography is used: Public and private key pairsTo digitally sign transactions.
The acronym ECDSA mean "Elliptic Digital Curve Signature Algorithm"And it is an algorithm of key generation and digital signature frequently used in blockchain protocols.
It is usually used sinceThe keys are generated quickly and are smaller than other algorithmsAs the RSA algorithm (also asymmetric cryptography) and that is convenient to sign transactions and send them through the P2P network (remember that the blocks between the various nodes are shared), thus the ECDSA has historically been used in bitcoin and in subsequent blockchain protocols.

As the name seems to indicate this ECDSA algorithm is based on mathematical operations about an elliptical curve. Start from the generation ofA random integer, a very large whole number, which corresponds to a private key(which should only be known by the person who generates it), and a public key that is generated from that private keyand that is shared with the other users of the blockchain, when transactions are signed for example.
In the case ofBitcoinThe elliptical curve is used SECP256K1
Anyway, usually blockchain protocols transform the public key into something shorter that is usually called "address" or directions.
This transformation is usually made by application. Hash256 Function (several times) in the public keyand by applying another algorithm such as Ripemd-160
The final transformation (which is what is known as Bitcoin address) uses a Base coding58 (which does not use the letter or, nor the I, nor the number 0)In this way, addresses management is easier so as not to confuse with some letters that are similar to the numbers.

In this second iteration I use an ECDSA bookstore for Python.
The idea of ​​the exercise of this iteration 1 is to generate a Bitcoin address (a Pubkey Hash that begins by 1) from the elliptical curve:
a secp256k1 curve is generated,
a couple of keys are generated,
Several hash functions apply to the public key,
The "version" (one 00 for bitcoin) is added,
A checksum is extracted,
is codified based58,
And finally the final address is printed

 

Iteration 2. The Merkle tree

The Merkle treeIt was created by Mr. Merkle enough years ago (1979) and is very curious how its design has been applied to blockchain technology.
The Merkle treeIt is used in Bitcoin and Ethereumand most likely in the rest of Blockchain protocols.

Extras: As a curiosity, if you are a programmer, you surely know a tool that also uses Merkle trees. It's about GIT. Use a DAG (directed acyclic graph) where each node (label, commit, ...) is labeled with the hash (use Sha-1, although in the new versions I think it is already Sha-256) of its content. So every time you use git at home, you have a "blockchain" (saving differences! Such as work tests, consensus algorithms, block rewards, etc ...).

ForoptimizeThe disk space and the size of the information packages that are shared by the P2P network, "compacted" data structures are used for the blocks.
One of these structures is Merkle's tree, where In each "sheet"of this treeA hash is storedwhich originally comes from a transaction, or from the State (from an account for example).
The Merkle tree It is built from the bottom up, from transactions or states, applying the HASH function, then adding these hash from two in two and re -applying the hash function, and so on until a single hash that defines that Merkle tree is obtained.
Actually when I have previously talked about the structure of a block (in the first iteration), a block with a header and a set of transactions or states is usually implemented.
In it Bitcoin caseIn the header the root hashof this Merkle tree that contains the "summary" of the transactions of that block.
In it Ethereum caseIn the header they are kept 3 Hashes root: One of the transaction tree, another of the tree of states and another of the receipts. In Ethereum a Merkle Patricia Trie tree is used.
When talking about the hash of the block it usually refers to the hash of the header.
In the following example I will use the Perkle bookstore to show how this works from Merkle's trees.

merkle tree

To simulate transactions I will use Python text chains. Actually these transactions will have the sender, the recipient, the quantity, the type of asset, and a "payload" of generic data.
But to simplify it I only put a text.
Then the hash function is applied to each transaction, and they are added by peers, the hash function is re -applied to the result until finally obtaining the root hash.

A Important Merkle Tree Featureis that you can Verify quicklyIf a transaction is on a tree.

 

Iteration 3. The UTXO model

The word UTXO comes from English (UNSPENT TRANSACTION OUTPUT).
Each UTXO is a transaction not worn on the Bitcoin (and Litecoin, Bitcoin Cash, Neo, ...) network.
A UTXO contains a series of inputs (inputs) and exits (outputs).
In this way, in a UTXO transaction, there may be more than one transfer between addresses. From an entry to several outputs, or several tickets to a single exit, or several entries to several outputs. It would not be very optimal to create a transaction for each Satoshi (the minimum bitcoin unit) that went to transfer, because the number of transactions to be recorded would be enormous.
That's why Bitcoin uses utxos. When the sum of the tickets of the entries is equal to the sum of the bitcoins of the outputs, it is considered a spent utxo. Example:
In a transaction, Alicia that has 10 bitcoin, sends 5 bitcoin to Roberto. A UTXO is created with two outputs, one of 5 bitcoin to Roberto and one of 5 bitcoin to another UTXO direction belonging to Alicia. It is something like returning the change or the remnant to another direction.

Extra: Bitcoin transactions

Each bitcoin block can contain thousands of transactions.
Initially the first blocks that were mine only had a transaction called Coinbase, which is the first of each block and determines that miner (which address) takes the reward to solve the block (which was initially 50 bitcoin). They are new created coins.
In this case, there are no tickets and there is an exit (the direction of the miner).

Extra: double expense

All this Utxes system optimizes, but does not control that an address that has 5 bitcoin can perform a double expense, that is, send 5 bitcoin to Roberto and the same 5 bitcoin to Alicia.
To avoid the double Bitcoin expense uses the test of work (POW), which is a puzzle that must be resolved, and that consists of generating a hash for the block that begins for a certain number of 0000.
The miner who previously manages to find that hash, and publish the block, takes the cat to the water and the free bitcoins.
This work test makes an attacker extremely difficult to change the previous blocks, since he would have to find that hash of the previous block, and the previous one, and the previous one, ... which would be necessary to have a greater calculation power than most of the nodes.

Iteration 4. The account model

If Utxo is the Bitcoin base, the account is the base of Ethereum. We can say that most blockchain protocols use one, another or the two models. In the account model, it is simpler, since from an account transactions and balance are obtained. It is very easy to follow the tracks of the transfers, therefore it is difficult to maintain anonymity.

Iteration 5. Serialization and deerialization of data

As in many fields of computer science, when it comes to sending data by the network, or storing record data, the most optimal is to use binary format data.
To do this, Blockchain protocols make use of serialization and deerialization mechanisms in this format.

As we are using Python to program the examples, I will choose the "pickle" module that allows to serialize and deduce Python data structures to a bytes format for later storage or network transmission.
It has an inconvenience, and if we are going to use this format between several languages, it would not be highly recommended to use a format closely linked to Python. On the other hand it is not fully compatible between several versions of Python, so there could be problems.
Finally, the source should be taken that the binary object is obtained, since a malicious actor could hide harmful code inside and the object would be activated once.

With this "pickle" module you can serialize almost everything: text chains, numbers, lists, even classes. But it doesn't work very well with lambdas or generators.

In this example, the pickle library is used to serialize a block class that contains certain properties and a list of transactions. It is shown how to serialize the data to a file and how to read it later.

 

Iteration 6. API REST / JSON RPC

Blockchain protocols have a module specially designed for Rest / JSON RPC communication that allows you to communicate by the network to wallets (or customers) and nodes.

In the case of Python we can find several frameworks that incorporate a JSON RPC server such as Django, Flask or Aiohttp.

I will use Flash with JSRONRPCServer in the example for the API Rest / JSON RPC and 'Curl' server to do customer (which would be a wallet).

The most typical is to create the hello world with the 'ping' and the 'pong'. I invoke the 'ping' method and the server responds with a 'pong'.
In fact all this comes from Bitcoin that was the first blockchain that used RPC methods of the 'getbalance' style, 'GetblockChaininfo', etc ... which are several remote methods (RPC) to provide various functionalities such as Wallet management, the state of the blockchain, the management of transactions, the network ... the network ...

In the example of this iteration I will simulate an API rest method such as 'Getblock/{Height}' that would return the data of a block and a JSON RPC type method such as 'Getbalance' that would return the balance of the wallet associated with the node.
Obviously these methods are made of stone cardboard.

To perform the test it is necessary to lift the Rest/JSONRPC (Flash) server, and use curl with the command to invoke the 'Getbalance' method:curl --data-binary '{"jsonrpc":"2.0","id":"curltext","method":"getbalance","params":[]}' -H 'content-type:text/plain;' http://127.0.0.1:5000
The command to invoke the API Rest 'Getblock' would be:curl http://127.0.0.1:5000/block/3

Iteration 7. Consensus algorithms

Each blockchain protocol implements certain algorithms or consensus mechanisms to function.
What are the consensus mechanisms for? To stipulate that nodes are chosen to create, validate and broadcast a block to the rest of the nodes.
Consensus algorithms such as Bitcoin's are tolerant of Byzantine failures (BFT) this is that they operate under the assumption that a small number of nodes can act in a "dishonest" or "malicious" way.

Work test (Pow)

This was the first consensus protocol that was used in a blockchain, specifically in Bitcoin.
Ethereum also adopted a work protocol, and some cryptocurrencies copied from Bitcoin such as Litecoin, or Bitcoin Cash too.

A work test is based on a hash function such as Sha256 or Scrypt.
How does the work test work?
The miners compete with each other to see who solves a mathematical puzzle, which usually consists of finding a hash of the block that begins with a specific number of 0000.
To do this the miners are increasing a number (Nance) that added to the data of the block Danh of the block that starts for 0000.
The miner that solves the puzzle earns a bitcoins reward.

Participation test (POS)

It was the second generation of consensus algorithms, which was used for example in Bitshares. This protocol does not make use of a puzzle, but gives importance to nodes that "accumulate" a tokens' balance. These nodes can choose to "undermine" new cryptocurrencies and receive rewards.

These two consensus mechanisms are the most used currently, although there are versions of some of them, specifically the delegated participation test, which centralizes the "power" of undermining tokens even more, since it allows most nodes to "vote" a few "chosen" nodes (whose number is not very high) so that they are responsible for creating, validating and retransmitting the blocks.

Reflections: Do you think that these consensus mechanisms are democratic or on the contrary only those who have money can act as "block producers"?

New deliveries every week ...

Этот веб-сайт использует файлы cookie для получения статистических данных о навигации своих пользователей. Если вы продолжаете просмотр, мы считаем, что вы принимаете его использование. политики cookie