Introduction to decentralized applications

You'll build a program using Python to execute methods in a smart contract programmatically, and we call this program a decentralized application. So, there's a smart contract, and there's a decentralized application. A smart contract written with the Vyper or Solidity programming languages lives in an Ethereum blockchain. This means that if you deploy your smart contract to the Ethereum production blockchain, the bytecode of your smart contract is written in every Ethereum node. So, if we have 10,000 Ethereum nodes in this world, your smart contract is duplicated 10,000 times.

However, a decentralized application doesn't live in Ethereum blockchain. It lives in your computer, in your neighbor's computer, in a cloud, but it does not live on the blockchain, and it does not have to be duplicated all over the world in the same way as a smart contract. People build a decentralized application using various programming languages. In the case of Ethereum, the most popular programming languages for building a decentralized application are Javascript in the Node.js environment and Python. In our case, we are going to use Python to build a decentralized application. To do this, we need a library. In the case of Javascript , we need a web3.js library. In our case, which is Python, we need a web3.py library. All of the library names include the word web3.

People like to think of web3 as a third version of the internet: a decentralized internet. So, if this is the third version, what are the first and second ones, you ask? The first version of the internet is the internet that you use to consume content passively (think static websites.) The second version of the internet is the social one, where you generate content and co-create experiences (think Facebook, Twitter, or Instagram):

In the preceding screenshot, we can see that the Vyper or Solidity bytecode lives (duplicated) in many Ethereum nodes (system). But a program using the web3 library can live in a single computer (such as a laptop or smartphone).