Categories
Uncategorized

How to Get Started With Blockchain Programming

Welcome to Lumiweath!

It’s a great place to start if you want to know how blockchain works and how to become a dApp blockchain developer.

We’re going to take you step by step through the process of how to get started with blockchain programming using our easy-to-follow course.

 

So, you want to be a dApp developer?

Technically called dApp, perhaps you’re curious about the opportunities available in this space? 

This is the perfect place to be!

Let’s talk about what you need to do to become a blockchain developer or a dApp developer.

We’re going to cover:

  1. Understanding the blockchain landscape
  2. Building Solidity smart contracts on Remix
  3. Build websites with HTML and JavaScript
  4. Use Truffle or Hardhat to manage a dApp with Ganache
  5. Use Web3.js and MetaMask to interact with blockchain from a website
  6. Use a library like React to handle complex user interfaces

Understanding the blockchain landscape

Let’s talk about the first step: understand the blockchain landscape. This is the most general step of becoming a blockchain programmer.

You have to know about:

  • Blockchain 
  • Cryptocurrency
  • Exchanges to buy and sell cryptocurrency
  • Ethereum and other blockchains out there
  • Decentralization and why is it so revolutionary 
  • Smart contracts
  • Solidity coding language
  • NFT
  • Web3 

So all of these and more are terms and different things about the blockchain landscape that you should understand before you start jumping into building projects. 

That’s because understanding all of these terms and how the blockchain landscape is affecting the world and different industries is critical to being able to understand how it works.

cryptocurrencies

What is the point of a smart contract and dApp in the first place?

For example, blockchain technology is revolutionizing finance and other industries as well, like web development, because you can build these decentralized web apps and other industries across the board.

Because with blockchain technology, you can integrate it into any software or system that is currently existing.

After you understand the blockchain landscape. you have to learn the Solidity coding language.

What is Solidity?

Solidity is the number one coding language for building dApps for the Ethereum blockchain.

The Ethereum blockchain is a blockchain specific for building a dApp. 

It was made to build decentralized applications so you can have software that uses blockchain’s decentralized technology. 

So, you have to learn the Solidity coding language because this language is used as the basis for building smart contracts and the basis of how you build any dApp or blockchain project. 

Solidity is just like any other coding language you have to learn different programming concepts:

  • Variables
  • Data types 
  • Functions 
  • Arrays
  • Mappings
  • Conditionals
  • Loops
  • Inheritance
  • Struct
  • Visibility modifiers
  • Mutability modifiers  
  • Abstraction 

All of these can also be applied to different coding languages. But Solidity is unique in some ways.

coding on the blockchain

Why do I need to learn Solidity?

So every coding language is similar, but they are not exactly the same.

You need to learn Solidity in order to build smart contracts.

Smart contracts contain self-executing code that makes up the basis of all the technology on a blockchain, whether you want to build a financial instrument like a bank or yield farming app. 

Or if you want to build out a decentralized website where you have a smart contract that handles transactions or it handles users or handles signups.

Well, all of those smart contracts that use blockchain technology are all written in Solidity.

So that’s why you have to learn Solidity.

Then you can build out some smart contracts once you have the fundamentals of programming down.

Once you know how to code in Solidity, you understand programming topics and you can build out small elements like a variable or a function. Then you can build out smart contracts.

What is a smart contract?

So a smart contract is a larger piece of code.

It’s a self-executing contract, so you can put in different fields like different pieces of data to put in the contract.

Or you can put functionality into the contract for whatever tool you’re trying to build:

  • Profit splitter
  • Limited time transactions
  • Bank 
  • Limited addresses
  • Libraries 
  • Coin
  • NFT

For example, you might have data defining who is going to be able to get the profits, and then you might have a function that will take that profit and will split it between three or more accounts.

So your smart contract defines the whole tool and it defines the software.

You would write a smart contract as a set of instructions containing all of the data of what your tool can do.

You can build out a contract with limits like limited-time transactions.

You could also build out a smart contract to represent a bank, in which case you can have data or fields to store different bank accounts and how much of a currency they hold.

programming NFTs

NFT Builds

If you want to build an NFT, you can do so with a smart contract where you can define all the data about the NFT, like its properties.

And you can also define the functions of the NFT, like can it be minted or can a new one be created?

Solidity Smart Contracts

Once you can build Solidity smart contracts, you can then go into the website portion of dApp development.

So you could stop here and just focus on Solidity, in which case you build smart contracts to deploy them onto a blockchain.

So they live on the blockchain, and then users can interact with these smart contracts directly via the blockchain as an option. 

But if you want your smart contracts to be more accessible so more people can easily access them, then you can build out a website that acts as the gateway between your smart contract and the user.

The user is any person who can go to your website, and that way they can access your smart contract via the website.

Otherwise, they’d have to access your smart contract via the blockchain, which is still possible. But it’s less accessible and fewer people are going to be able to access a blockchain directly like that because it’s much easier to just go to a website for the common person.

So if you want to build out a website portion for your smart contract to be able to reach that audience, then you have to know how to build a website. Solidity is the smart contract side and the blockchain side.

HTML

HTML & Your Website

You also have to build out the website side, in which case you have to start with HTML, a markup language similar to a coding language. 

  • Build an HTML document
  • HTML tags
  • Links
  • Images
  • Lists
  • Tables
  • Input
  • Buttons 

HTML allows you to build out the elements of a web page.

In addition to the items listed above, you can build your website with:

  • Title
  • Heading
  • Navigation Menu
  • Text
  • Images
  • Links

HTML lets you define what’s going on with your website. 

For example, if you want to build out a marketplace where users can buy and sell different tokens or different cryptocurrencies, then you have to define what is going to be on the website.

Perhaps you’re going to have your logo at the top, and then you’re going to have sign-in or sign-up buttons where users can create a new account on your website.

Then you might have the different cryptocurrencies that they can buy or exchange, and then you might have buttons to allow them to perform different actions like buy this coin.

So HTML allows you to define what are the elements on your website.

You should learn HTML coding to be able to understand how websites are put together because behind every website the core structure will be in HTML.

It’s like defining what are the elements on the page.

javascript programming book

Learning JavaScript

You should also learn JavaScript. 

JavaScript is a coding language that actually looks very similar to Solidity.

So if you know Solidity you’re actually going to find it easier to pick up JavaScript because the languages are very similar to each other. JavaScript is similar to Solidity in terms of how it looks and how you write it.

But it does have some differences.

JavaScript is for building out functionality on your website, whereas Solidity is for building out your smart contracts.

JavaScript is for building out your website functionality so you have to learn how to code in JavaScript, as well, if you want to be able to build that website portion of your software project.

You could again just build the Solidity side and keep it at that.

But many people choose to also build the website so that you can take your smart contract and you can reach people around the world much more easily.

You can reach anyone even if they don’t know much about the blockchain system!

Luckily if you know another coding language like Solidity, you’ll find it easy to pick up JavaScript.

You have to learn the fundamentals like:

  • Variables 
  • Strings
  • Numbers
  • Booleans
  • If statements
  • Arrays 
  • Loops
  • Objects
  • Functions
  • Dictionary 
  • Switch statements
  • Error handling
  • Asynchronous operations

With JavaScript, you can build out the functionality of your website.

So if you have a simple website you’ll need simple JavaScript, but if you want a more complex website you’ll need to add more complex JavaScript to be able to handle all of the tasks that you want.

If you want to have a hundred different tasks that anyone could do on the website, like buy an NFT, buy a token, or staking tokens, then all the functionality will have to write in JavaScript.

You need JavaScript so that your website can allow these things to happen.

truffle blockchain

Why do I need to learn Truffle?

You also have to learn a tool like Truffle or Hardhat in order to manage your dApp with Ganache, which is a local blockchain.

  • Build and compile smart contract
  • Deploy and migrate smart contract 

So you could just stick to the online Solidity editor known as Remix.

This is where you can just go to a website and you can start building smart contracts right away. You can actually deploy them onto the blockchain on Remix as well.

Typically, developers will choose to use more complex tools like Truffle or Hardhat because they allow you to manage a more complex dApp rather than just a simple smart contract.

So if you want to build a dApp that is more complex, then you’ll want to implement a tool like Truffle or Hardhat which are a bit more advanced.

But by the time you get to this stage, you’ll have more experience with Truffle and Hardhat to allow you to manage your project.

So it makes it easy to have your whole project in one place.

Ganache

Ganache is a local blockchain that you can use to test out your projects because if you’re building out a complex project or even a simple one then you will want to test out your functionality first before you deploy it onto the Ethereum Mainnet, the main blockchain.

So you can use a free tool like Ganache to try out your functionality and your smart contract for free before you put it onto the main blockchain.

Build Smart Contracts with Truffle and Hardhat

With Truffle and Hardhat, you can build smart contracts. You can compile them then deploy and migrate them, which means you put them onto a blockchain.

After you build out a project with Truffle or Hardhat, you can then connect your smart contract side with your website side.

So you have these two sides of the project: you have the website, which is what the user is going to see when they go to your website, then you have the smart contract side which is handling all the blockchain functionality.

The user will go to the website, then the website will talk to your smart contract, the smart contract will talk back to the website, then the website will show the user the results.

So the user doesn’t have to see the smart contract, they can just see your website.

metamask

Use web3.js and MetaMask to interact with blockchain from a website.

Web3js is a tool that allows you to take a website and connect to a smart contract via the website.

It’s just an extra addition to JavaScript because it is written in JavaScript.

  • Build HTML to interact with smart contracts via the website
  • Connect to MetaMask with JavaScript web3
  • Enable the user to interact with smart contract via the website
  • Test your dApp with MetaMask and Ganache 

This is a library called web3, and it allows you to make a website in JavaScript and add more functionality to it, specifically to communicate with a smart contract.

That’s the point of web3.js and similar tools.

Using MetaMask

You also have MetaMask, which is a cryptocurrency wallet.

So with MetaMask, anyone can store cryptocurrency, either real or just for testing on a browser.

That way you can go to a website, and then you can perform transactions on that website via the browser extension.

If you want to do some kind of action, like you want to buy an NFT on that website, then you can do so via that MetaMask wallet because it’s storing your cryptocurrency.

You can take the cryptocurrency out of the wallet and send it to the website. The website will send it to the smart contract. The smart contract will give the website the NFT, and you’ll see that you now have the NFT. 

So you have to learn tools like web3.js and MetaMask because you are going to build out the HTML so that your website can interact with your smart contract.

Then you’re going to connect to MetaMask in your website so that your website can handle this functionality.

Your website has to be able to accept MetaMask transactions and then send the coins to the blockchain. Also, your website has to handle receiving results from the smart contract.

So your website has to handle if a user sends you cryptocurrency via their MetaMask wallet 

Your website has to send that cryptocurrency to the smart contract to do whatever functionality is being asked for.

The smart contract will send the results, and then the website has to send the results to the user. 

Learn to use a library like React to handle complex user interfaces.

After you have been able to build dApps, you can then build more complex steps by using a library or a framework.

One example is React, which is a web development library for building more complex websites.

Previously we talked about how you have to know HTML and JavaScript, and that’s still true.

But if you want to build more complex websites, you also have to know React or a similar library or framework.

React is actually created using JavaScript. It’s called React js, and it allows you to build more complex websites very easily. 

Think about if you have a very complex website with interactive pages with many users and many different types of functionalities.

You’re going to need a tool that allows you to organize all those pages and organize all those user interfaces. And so React is a very popular tool for web developers.

You’ll have to learn a library or a framework like React or others out there, but React is the most popular to be able to build complex websites.

If you’re just building a simple website, then you can just use HTML and JavaScript.

But if you want to build a more complex website, you have to leverage something like React.

That would be your next step.

Beginner Project Suggestions 

You can build out beginner projects using smart contracts and React.

Try to build:

  • An NFT contract and deploy on OpenSea 
  • An NFT minting dApp
  • A to-do list dApp
  • A dApp to access data storage smart contract

You can build a to-do list dApp, which is a website where users can store their to-do list items. But if they want to store an item, they have to do that over the blockchain. They have to perform a blockchain transaction and then they have to send crypto if they want to add a to-do list item.

And if they want to mark it as complete or if they want to remove the item, they have to do that all over the blockchain.

The point is to practice taking functionality and doing it over the blockchain.

You could just build a regular to-do list, which is just a website.

But if you want to implement blockchain technology, then you have to go through web3.js.

You have to go through a smart contract, and all your to-do list items are going to be stored on the blockchain.

So it’s just taking a regular website and injecting blockchain technology into it.

You can also see the benefits and the differences from building a regular website to building out a website that uses blockchain decentralized technology.

Another example is to build a decentralized app that will access a data storage smart contract so your smart contract can store some data fields. Your dApp can access them, then you can build more complicated apps once you’re comfortable building out beginner projects.

profitable apps

Profitable dApps

Try the next step to build some profitable dApps:

  • Cryptocurrency exchange 
  • Cryptocurrency trading bot
  • Bank for deposit and lending
  • Yield farming 

So some profitable advanced dApps would be a cryptocurrency exchange where users can come to your website, and they can give some cryptocurrency like bitcoin and in return get some ether. They can exchange cryptocurrencies.

Another example is a cryptocurrency trading bot where you can find some lesser-known cryptocurrencies, and you can see and watch for when they change the price or when they have different prices on different exchanges.

Therefore you can leverage the difference in price in order to get a profit as well.

You can build a bank for getting deposits and giving out lending of cryptocurrencies so users can deposit cryptocurrencies into your bank.

Then they can get rewarded for doing so, and users can also ask to take a loan of cryptocurrency from your bank. They would have to pay some fee to do so. In this way for all these projects, they’re profitable because you can leverage some of the transactional fees.

You can take a percentage, and you can reward your users for these different actions so the user has profitability but you as a developer you also have profitability.

You also have yield farming, which is another profitable dApp project very commonly used where you can put in some of your cryptocurrency, like Ether.

You’re putting your Ether coin, and as a result, you’re going to be farming a new cryptocurrency that is specific to the website.

And then users will get rewarded for putting in their bitcoin or their Ether, and they’ll be rewarded with a percentage or they’ll be rewarded with some of the new cryptocurrency as well.

So for all of these users, it’s profitable and so are you as the developer.

These are some profitable dApps to look forward to once you get to the stage where you’re comfortable building out Solidity smart contracts, you’re comfortable building out websites, you’re comfortable connecting the two together where you have a website and you can connect it and talk to smart contracts on that website.

Because then you can get to the point where you’re building out popular and profitable dApps.

Get Started With Lumiwealth!

Join Lumiwealth to learn more!

We’re going to teach you how to build tons of projects in our blockchain programming master class, where we take you from no experience whatsoever, with no coding experience required, and we’ll teach you everything you need to know about Solidity, to build out smart contracts like for a coin or an NFT, and we’ll get you started.

Then take your next steps in your blockchain developer journey!

There are tons of jobs out there.

This is a new industry because the Ethereum blockchain only began in 2015, so there’s a lot of opportunity in the space.

A lot of companies are looking to build out blockchain projects and incorporate blockchain technology because it saves them time and it’s more secure.

It saves them money, and it can also make them money.

So there are tons of companies out there hiring blockchain programmers, and there are tons of projects that you can build out yourself as a side hustle as we mentioned with some of those profitable dApps.

It’s an exciting space with tons more to be innovated!

Blockchain is a new technology, so there is a lot of exciting opportunities and growth.

So we hope to see you at LumiWealth!

Take our course on how to build the right blockchain infrastructure, learn solidity/web3 and make a profit.