Why the ethereum evm is genius
calvintam Oct 1, 2021
These days, it's hard to come by a person that does not know about cryptocurrency. Even a hermit knows a thing or two about it, often referring it to a bitcoin. However these days, crypto is often described as a get rich quick scheme or an investment tool. What could have been revolutionary, have been muddled with the intent of being an utility for deception.
Well, today I would like to bring to the spotlight, the sort of innovation that Bitcoin and Ethereum actually brings. And why these innovations is something that we should not take lightly.
Bitcoin and the Blockchain
While everyone knows what's a bitcoin, not many have heard of the technology that powers it. The blockchain is the technology behind bitcoin, and it's amazing. Well, at least it used to be.
The idea behind a blockchain, is to create a decentralized payment network that does not require a trusted machine to operate. Anyone can join the network, and malicious actors will not be able to do any sort of damage to the network. But you ask, how is that possible? Couldn't I, join the network, declaring myself the king of bitcoin, the proud owner of 1,000 bitcoins?
Well that is part of the genius of the blockchain. As a trustless network, such a menace would be quickly dealt with. As thousand of miners on the network rummage through transactions on the network, quickly weeding out fraudulent transactions and tossing it out to the void. Transactions deemed worthy are verified cryptographically. Many wallets depend on such verification to determine the authenticity of the transaction, therefore ensuring the network is secure.
Ethereum and the Ethereum Virtual Machine (EVM)
While the idea of the blockchain is revolutionary, it is only designed to do trustless transactions. Ethereum takes this idea further, by exploring the idea of having miners to do more than just verifying transactions. The end result, is the Ethereum Virtual Machine (EVM), which frankly is pretty mind blowing. The concept of having an Internet computer, a decentralised network that hosts your application for you, and is never down, possibilities are endless.
EVM vs Servers
Servers are traditionally very centralized, and for a very long time, non transparent. Ethereum apps, or more commonly known as Contracts, are open to all to see and evaluate. This might sound counter intuitive, but having the source code out in the open does have it's benefits. This is most apparent when it comes to financial applications, if there's a promise of a payout or interest on your account, you are able to dive into the Contract's codes and find out if the promised interest or payout actually exists.
The future
The Ethereum's EVM is only the start of the implementation of such ideas. The concept sounds simple, but it allows for a future of transparent and traceable record keeping that is guaranteed to be authentic.
NFT for Charity
Recently I have been fortunate to be involved in a crypto related project, where we explore the utility of Non-Fungible Tokens for charity. You can read more about it here : KitaJaga NFT. NFTs could be a fun and engaging way to reward people for charity work, as NFTs themselves are valued solely for being unique in existence.
Sometimes we all just like a pat on the back, a unique collectible might just do the job.
How was it done?
To pull off such a feat, I combined a few technologies. Using the ethers.js library, I am able to connect to the Binance Smart Chain network. BSC is also derived from EVM, which makes it compatible. Once I have the library imported, all it takes is a look at the Application Binary Interface (ABI) for the contract of the NFT platform that KitaJaga YB uses, Pentas.io. This could be easily done through websites such as BSCScan.
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
A quick scan through the contract, I have identified that a function known as safeTransferFrom:address exists. All it takes is just a few lines of code to execute the transfer of the token to the intended recipient. Once the code is done, I uploaded it to a node.js powered AWS Lambda, and made it available online through the API Gateway.
A few tests and its up for anyone to access. It turns out, programming for the EVM isn't as hard as it sounds!