Blockchain Tutorial - How To Become A Blockchain Developer - Cram Session! - Blockgeeks
Blockchain Tutorial - How To Become A Blockchain Developer - Cram Session! - Blockgeeks
Search
(https://blockgeeks.com/lo
gin/)
(https://blockgeeks.com/guides)
Guides
to
Back
Blockchain Tutorial | How To Become A Blockchain Developer: Cram Session!
#Ethereum (https://blockgeeks.com/category/ethereum/?filter=latest&post_type=guides)
#Hash (https://blockgeeks.com/category/hash/?filter=latest&post_type=guides)
In this guide, we are going to map out your journey for becoming a
Blockchain Developer. To ease things up for you, we are going to divide this
guide into various milestones and give you action steps at the end of every
section.
It goes without saying that we are living in the “era of the blockchain
(https://blockgeeks.com/guides/what-is-blockchain-technology/)”. The impact
that it can have on our future is truly scary and magnanimous. So, how can
you get a piece of that “blockchain action”? If you are to become a blockchain
developer, then there are certain steps that you need to take.
Hopefully, at the end of the guide, you will have the tools required to kick-
start your journey. If you are serious about becoming a developer then we
need to set some expectations for you. Firstly, it is going to take time and you
will need to dedicate your time and resources to your education (you can
continue your education with us by taking our blockchain courses
(https://courses.blockgeeks.com/)). Secondly, do not expect immediate
results, becoming a blockchain developer is not a magic pill.
If you are a beginner, then there are certain terms that you need to be
familiar with:
It could be advisable to learn more about these terms that are widely used in the crypto-sphere. It
is highly recommended that you go through our comprehensive glossary
(https://blockgeeks.com/guides/blockchain-glossary-from-a-z/). It is important to
learn these basic terms otherwise you will be very lost further on in your education. Now, up next,
it is time to educate yourself some more on the technical aspects of the blockchain.
So, in light of that, it can be a good idea to read up a bit on economics and
have a general idea of it.If you want to learn about cryptoeconomics in
general, then you may checkout our article here
(https://blockgeeks.com/guides/what-is-cryptoeconomics/).
If you are intrigued by the cryptography specifically and want to know how
signatures work and what public key cryptography means, then read this.
(https://blockgeeks.com/guides/cryptocurrencies-cryptography/)
After that, it is highly recommended that you understand how bitcoin works.
Bitcoin is the most widespread, finest and one of the more elegant
applications of the blockchain technology. You can even call it the finest
example of what the blockchain technology can achieve purely because of the
impact that it has had.
Let’s check out the action steps that you need to take over here:
It Is strongly recommended that you start getting acquainted with the system
today.
These wallets are the easiest to use among all. The creation is super simple
because it’s basically creating your own account on any of the exchange
services. Furthermore, you can access this wallet from any server or any device
in the world as long as it is connected to the net. Having said that, there is
one big problem when it comes to online wallets. Your private key is going to
be saved on another server. This is basically like serving up your key to
hackers on a silver platter. Do NOT use online wallets to store huge amounts
of your money. Store the bare minimum that you need for exchange
purposes.
As you create an extensive portfolio, you must learn how to utilize cold wallets
to store your money. You can learn how to do so here.
(https://blockgeeks.com/guides/paper-wallet-guide/) Later on, if you create
your ICO then you MUST know how wallets and, in particular, multi-sig wallets
work.
We are bringing this section to a close here, the tough part starts from the
next milestone.
Blockchains, as David Schwartz puts it, should be fortresses. Firstly, the code is
public and open for all to see. Anyone can look at the code and check for
bugs and vulnerabilities. However, unlike other open code resources, the
downside of finding vulnerabilities on blockchain code is massive. Any
programmer can hack in and get away with potentially millions and millions of
dollars. Because of these legitimate security concerns, development on
blockchain is usually very slow.
It is important to keep pace with the network. You cannot fall too far behind
and not keep up with all the network demands. You should be well equipped
to handle remote and local queries.
The blockchain must always perform at its highest possible capabilities, but
for that to happen the language chosen must be extremely versatile. The
thing is that there are certain tasks in the blockchain which are parallelizable
whilst there are some tasks which can’t be done in parallel.
However, not all the functions on a blockchain should be done that way. Think
of transaction execution itself. Multiple transactions can’t be executed in
parallel; it needs to be done one at a time to avoid errors like double spends.
Some languages are good at parallel operations while some are good in non-
parallel operations.
Hash functions are deterministic, meaning A’s hash will always be H(A).
The only solution to this is isolation. Basically, you isolate your smart contracts
and transactions from non-deterministic elements.
There are some languages which fulfill most of these needs. If you are a
blockchain developer, then you definitely need to have some basic knowledge
(https://blockgeeks.com/guides/blockchain-coding/) of C++ and JavaScript.
While C++ may seem a little outdated, the truth is that it wonderfully satisfies
all the functionalities that we have described above. In fact, Satoshi Nakamoto
wrote the Bitcoin source code in C++.
Along with HTML and CSS it is one of the three core technologies in World
Wide Web Content Production. Javascript is usually used to create highly
interactive web pages.
So, now we will see how to create a very simple blockchain using Javascript.
How do we make a block? What does a simple block consist of? In our simple
cryptocoin that we are going to make (Let’s call it “BlockGeeksCoin”), each
block will have the following pieces of information:
Before we continue. You need to understand certain terms that we are going
to use in our program:
This: The “this” keyword is invoked inside a function and enables you to
access the values inside a specific object that calls that particular function.
Constructor: A constructor is a special function which can help create and
initialize an object within a class. Each class is restricted to only one
constructor.
class Block
this.index = index;
this.previousHash = previousHash;
this.timestamp = timestamp;
this.data = data;
this.hash = this.calculateHash();
calculateHash()
Code Analysis
Ok, so this right here is out a block. So, in the first line of the code, we called
the crypto-js library because the sha256 hash function is not available in
JavaScript.
Next, we invoked a constructor inside the class to call for objects which will
have certain values. The thing that probably catches your eye is the
calculateHash() function. Let’s see what exactly is it doing.
In a block, we take all the contents and hash them to get the hash of that
particular block. We are using the JSON.stringify function to turn the data of
the block into a string to hash it.
Ok, so we have the block ready and good to go. Now let’s connect the blocks
together into a blockchain.
class Blockchain
constructor()
this.chain = [this.createGenesisBlock()];
createGenesisBlock()
{
return new Block(0, "01/01/2017", "Genesis block", "0");
getLatestBlock()
addBlock(newBlock) {
newBlock.previousHash = this.getLatestBlock().hash;
newBlock.hash = newBlock.calculateHash();
this.chain.push(newBlock);
isChainValid()
return false;
return false;
return true;
}
Code Analysis
Ok, so a lot of things are going on in the chain above, let’s break it down into
sections.
The genesis block is the first block of the blockchain, and the reason why it is
special is that while every bock points to the block previous to it, the genesis
block doesn’t point at anything. So, the moment a new chain is created, the
genesis block is invoked immediately.
createGenesisBlock()
{
return new Block(0, "01/01/2017", "Genesis block", "0");
}
Firstly, we will need to know what the last block in the blockchain currently is.
For that we use the getLatestBlock() function.
getLatestBlock()
Now that we have determined the latest block, let’s see how
addBlock(newBlock) {
newBlock.previousHash = this.getLatestBlock().hash;
newBlock.hash = newBlock.calculateHash();
this.chain.push(newBlock);
So, what is happening here? How are we adding the blocks? How are we
h ki if h i bl ki lid ?
checking if the given block is valid or not?
Remember the contents of a block? A block has the hash of the previous
block right?
So, what we are going to do here is simple. Compare the previous hash value
of the new block with the hash value of the latest block.
If these two values match, then this means that the new block is legit and it
gets added to the blockchain.
Now, we need to check that nobody has been messing with our blockchain
and that everything is stable.
We are using the “for” loop to go from the block 1 to the last block. Genesis
block is block 0.
return false;
return false;
return true;
If the “previousHash” of the current block is not equal to the “Hash” of the
previous block, then this function will return False, else it will return True.
Now, we are going to finally use the blockchain to create our BlockGeeksCoin.
We simply added two more blocks to it and gave them some data.
It is that simple.
That’s it for this milestone. Let’s look at the action steps. It is very simple but it
definitely isn’t easy:
Get educated in one of the many blockchain friendly languages like C++,
Javascript, C#, Go etc.
You can learn more about smart contracts in our in-depth guide here.
(https://blockgeeks.com/guides/smart-contracts/)
So, what are the desirable properties that we want in our smart contract?
Anything that runs on a blockchain needs to be immutable and must have the
ability to run through multiple nodes without compromising on its integrity.
As a result of which, smart contract functionality needs to be three things:
Deterministic.
Terminable.
Isolated.
Step and Fee Meter: A program can simply keep track of the number
“steps” it has taken, i.e. the number of instructions it has executed, and then
terminate once a particular step count has been executed.Another method
is the Fee meter. Here the contracts are executed with a pre-paid fee. Every
instruction execution requires a particular amount of fee. If the fee spent
exceeds the pre-paid fee then the contract is terminated.
Now that we have seen these features, it is important to know how they are
executed. Usually the smart contracts are run using one of the two systems:
Let’s compare these two and determine which makes for a better ecosystem.
For simplicity’s sake, we are going to compare Ethereum (Virtual Machine) to
Fabric (Docker).
If you are interested in Ethereum development specifically then it is important
that you learn solidity as well.
Solidity (https://blockgeeks.com/guides/how-to-learn-solidity/) is a
purposefully slimmed down, loosely-typed language with a syntax very similar
to ECMAScript (Javascript). There are some key points to remember from the
Ethereum Design Rationale document, namely that we are working on a
stack-and-memory model with a 32-byte instruction word size, the EVM
(Ethereum Virtual Machine) gives us access to the program “stack” which is
like a register space where we can also stick memory addresses to make the
Program Counter loop/jump (for sequential program control), an expandable
temporary “memory” and a more permanent “storage” which is actually
written into the permanent blockchain, and most importantly, the EVM
requires total determinism within the smart contracts.
If you are interested in learning solidity then you can check our in-depth
course here. (https://courses.blockgeeks.com/)
Go and join the Reddit forums, Gitbub pages, and StackExchange and connect
with other developers and always be on the lookout for any news regarding
the technology.
Along with that, it will be helpful for you to know what people look for in
blockchain developer. What qualities are companies looking for when they are
looking to hire? You can find that information here.
(https://blockgeeks.com/how-to-hire-a-good-blockchain-developer/)
This information can be very useful in you fine-tuning your skills enough to
appeal to the companies.
Conclusion
So, this is a rough roadmap for you and your journey to becoming a
blockchain developer. This alone won’t be enough, of course, you will need to
show your own initiative and always be in the mix.
1 9
Comments
Austrian Q
(
(https://blockgeeks.com/author/ajian) 0
8 months ago
This is Ajian, from Ethfans.org, which is a China based Ethereum developer community, dedicating to
promoting Ethereum and blockchain technology in China. One of our main projects is translating
selected English posts into Chinese and circulating them on our website and newsletters, where we
have more than 4000 daily visits.
I am wondering if we can ask your authorization to translate this post for non-profit purpose. If
permitted, the Chinese version will be posted on ethfans.org and our wechat daily newsletter. We will
specify your authorship of the post, and put down a link to your original post.
Please let me know if you have other requirements regarding the authorization. Looking forward to
your reply.
Thank you.
Best regards,
Ajian
bfg2001
(
(https://blockgeeks.com/author/bfg2001) 0
8 months ago
I like the way you talk of Hashing, but do not describe what Hashing actually is. The phrase is thrown
out everywhere, but I’ve never seen a simple explanation of it. What is it, how is it performed. What is
SHA256, etc
Matrix
• (
(https://blockgeeks com/author/matrix) 2
(https://blockgeeks.com/author/matrix) 2
7 months ago
@bfg2001
if you would only use the hands god gave you to type sha256 into google you would have your
answer, i would think someone who is so curious about it that it angers them that the very BASIC of
blockchain hashing is not defined would at least idk maybe type it into google?
SHA-2 (Secure Hash Algorithm 2) is a set of cryptographic hash functions designed by the United
States National Security Agency (NSA).[3]. They are built using the Merkle–Damgård structure, from
a One-way compression function itself built using the Davies-Meyer structure from a (classified)
specialized block cipher.
there ya go, first page of google and on the most popular wikipedia site.
hashing means one way encrypting. now i challenge you to learn any subject the way you are trying
to learn crypto, ill tell you now you arent going to get far without searching for answers yourself
unless you are a millionaire and can get your butler to hand you them on a silver platter. cause
trust me, the crypto world is a lot less forgiving than the real world.
Michael Garber
• (
(https://blockgeeks.com/author/blockchain-developer-2) 0
7 months ago
@Matrix
LOL
Michael Garber
• (
(https://blockgeeks.com/author/blockchain-developer-2) 0
7 months ago
@Matrix
LMAO
Michael Garber
• (
(https://blockgeeks.com/author/blockchain-developer-2) 0
7 months ago
@Matrix
I keep trying to reply to this but its not showing up. I find this response HILARIOUS! In particular:
“someone who is so curious about it that it angers them that the very BASIC of blockchain hashing
is not defined would at least idk maybe type it into google?”
@Matrix
Your last line is especially funny because it directly contradicts the author’s feelings:
“The impact that it can have on our future is truly scary and magnanimous. ”
Unless one of you is unaware that ‘magnanimous’ and ‘forgiving’ are synonyms. Hmmmm
Austrian Q
(
(https://blockgeeks.com/author/ajian) 0
7 months ago
Hi Ameer Rosic:
We have specify the original link and authorship. If you do not appreciate our work, or you have other
requirements, please contact with us.
AB
(
(https://blockgeeks.com/author/evanhill1989gmail-com) 0
4 months ago
mag·nan·i·mous
maɡˈnanəməs
adjective
very generous or forgiving, especially toward a rival or someone less powerful than oneself.
Support
(https://blockgeeks.z Hackathons
endesk.com/hc/en- (https://bountyone.io
(https://blockgeeks.c (https://trello.com/b/
Scholarships
(https://blockgeeks.c
om/scholarships/)