A Web 2.0 Developers Guide to Web 3.0 | by Ian Rowan | May, 2022

Find out how blockchain and Net 3.0 may form the subsequent iteration of backend software program growth

Artistic Commons through https://youteam.io/blog/wp-content/uploads/2018/04/image-e1523955910900.png

Over the previous couple of years, I’ve tried to leverage my engineering background with the next assertion:

“Find out how the belongings you put money into work and put money into the issues you realize about.”

This has led to some good, high-conviction investments in expertise I knew about on the core. Likewise, I’ve made an effort to study in regards to the applied sciences I blindly invested in at first. Finally, I used to be led down one among my best studying journeys but once I determined to learn the way cryptocurrencies labored on the core. After finding out layer 1(Ethereum, Bitcoin, and many others.) whitepapers, I acknowledged the quickest solution to become involved can be to grasp the idea of “good contracts” through studying Solidity.

My background in software program engineering made studying syntax extraordinarily simple, and with the assistance of this great course and a few finance information, I discovered a brand new self-discipline that introduced collectively extra pursuits than ever.

Upon beginning to write good contracts and interacting with the net 3.0 ecosystem, I used to be rapidly blown away by the streamlining of companies and the collaborative nature of this courageous new world. Generally I forgot that foreign money and finance had been the principle use case, as I noticed the chunkiness of internet 2.0 APIs, OOP, internet hosting, and standardization consolidated right into a common expertise.

My most important takeaway: Blockchain is about a lot greater than foreign money; it’s the subsequent iteration of constructing on the web. On this article, I purpose to offer some phrases for the newbie and draw similarities in internet 2.0 language to assist different technologists see the potential of this expertise.

Understanding how the phrases of this heading are the foundational step to starting to know the blockchain. These definitions are solely meant to complement the remainder of this text with some easy definitions, so I encourage the reader to dig into every individually if these descriptions appear imprecise. If you realize these phrases, I encourage you to skip forward to the principle subjects under this part!

Blockchains — Networks of servers that retailer copies of knowledge and performance which might be accessed through transactions as soon as consensus is discovered inside a major variety of servers {that a} transaction is legitimate. Blockchains have their very own native foreign money meant to pay these server operators for his or her computing energy within the type of “gasoline.” That is the actual utility of any Layer 1 token: entry to computing energy.

Wallets — Addresses on a blockchain that may be assigned/be despatched a portion of the community’s L1 token, can assign/ship the community’s L1 token, and may signal transactions to work together with good contracts with the id of the tackle (We’ll see how this permits for different L2 tokens).

Sensible Contract — An tackle on the blockchain that features all the performance of a pockets (ship/obtain L1). They’ll retailer knowledge through state variables (suppose databases), execute performance through bytecode (suppose database/API capabilities), and work together with different contracts like a pockets

Layer 2 Tokens — A sensible contract implementing an interface (ERC20) with widespread performance to facilitate minting, transfers, burning, and different foreign money capabilities. A Pockets doesn’t “maintain” L2 tokens the identical method it holds an L1; it merely can work together with the L2 contract to switch tokens, successfully altering the steadiness state variable for its personal tackle and the tackle it is transferring to.

The movement of a typical Net 2.0 API seems to be one thing like this:

1. Pay for an authentication key on an internet site

2. Write some string processing code to construct a payload and/or variables within the URL string

3. Use a language-specific HTTP library to ship the get/submit request

4. After studying the output JSON construction, use one other library to parse into language native knowledge sorts

To a seasoned software program engineer, this isn’t an intimidating course of, and it solely ever contains these steps. The API integration can, nonetheless, be tedious and time-consuming with poor documentation, tough output knowledge sorts, working with paid keys, and upgrades or API adjustments. A developer by no means actually is aware of what they’ll get with some APIs being comprehensible and properly documented, others outdated and clunky.

In Net 3.0, knowledge is accessed another way which resolves many of those points:

1. One other contract, developed and deployed by another organizations or people that gives some knowledge or service publishes an interface (much like a library) of their public capabilities.

2. In our personal code, we will import the code for his or her interface. Then realizing their contract tackle, we will inform solidity that the implementation of that interface is on the market on the tackle like this:

IsomeAPI api = IsomeAPI(tackle);

3. Now, we will use our new object to work together with the opposite contract. As a result of the contract can be built-in solidity, each our personal code and the exterior contract will use native enter and output knowledge sorts. An interplay seems to be and feels as if the thing is in our contract:

uint temp = api.getTemp(latitude, longitude);

This new answer to knowledge entry permits for fast, streamlined integration of as many knowledge sources as wanted for builders. Given the open supply nature, documentation remains to be useful however not mandatory as one Solidity developer can merely take a look at the Interface code to reply their interacting questions. On the similar time, it permits for common protocols to emerge. The IERC20 is the interface/API for L2 tokens. Feeding any token’s tackle, IERC20(tackle), builders can universally entry any distinctive token in addition to create their very own in minutes.

The advantages don’t cease at scalability and reproducibility. As a result of fee methods embedded in L1s and L2s, builders of contracts/APIs can simply embed methods to cost customers for using a operate or knowledge entry. Because of this as a developer utilizing the API, no bank cards, subscriptions, or complicated pricing fashions are required. One merely wants to know how a lot of which foreign money to carry, and the funds on each ends will at all times work flawlessly.

Lastly, some might problem this notion resulting from solidities incompatibility to Net 2.0 APIs whose knowledge remains to be very mandatory. Fortunately, event-driven oracle algorithms like Chainlink have emerged. These oracles entry third social gathering APIs and push this knowledge into the good contract world, basically wrapping Net 2.0 APIs. Within the Net 3.0 world, entry to those APIs is now as simple as creating an object and utilizing easy capabilities to retrieve knowledge.

To exhibit the effectiveness of Net 3.0 APIs, let’s contemplate what the method of depositing cash right into a brokerage account seems to be like from the Net 2.0 perspective and check out what this seems to be like in Net 3.0.

Net 2.0:

1. Backend receives person approval to name API of a given financial institution (requires integration and understanding of this API, credentials, and many others.)

2. Financial institution API triggers ACH/wire switch to the brokerage accounts (ETA: hours to days)

3. As soon as brokerage receives funds, backend calls API of brokerage to carry out a commerce (possible a lot completely different API, credential system, and many others.)

4. Commerce happens, and outcomes have to be explicitly logged for lookup

Right here’s a Net 3.0 code instance:

Tailored from https://solidity-by-example.org/

As you may see, doing a fancy financial switch with two distinct companies creates a headache for builders within the Net 2.0 work because of the API integrations, credentials, and wait instances. Within the Net 3.0 good contract above, this may be carried out with two distinct companies (the supply token/financial institution and Uniswap/dealer) in a number of traces of very readable code. Moreover, this complicated FinTech transaction would occur in seconds moderately than days, although that is past the scope of this text.

Altogether, the belief of the advantages of internet hosting APIs within the good contract age is quite a few. We’ve famous how any knowledge or service might be seen as an object with language native capabilities, commonplace protocols can emerge because of the reproducible nature of interfaces with a singular tackle, and API funds might be streamlined. Lastly, as a bonus, these next-gen APIs require no server configurations, upkeep, or cloud funds. As soon as they’re deployed, the 1000’s of blockchain operators will deal with this and be paid through every transaction’s gasoline charges!

The final part covers what I see as the large break for Net 3.0. There’s another factor I wish to spotlight which will appear remarkably related, properly, it’s the similar factor, however the perspective provides one other enjoyable solution to view Net 3.0. OOP or Object-Oriented programming refers to using objects in code that holds variables and capabilities to create dynamic and scalable code.

Variables and capabilities sound similar to the principle matter of this text. Sensible contracts are, in impact, objects in OOP converse, and the scaffold of their code seems to be no completely different than a Java, Python, or C# class with variables, capabilities, and a constructor. So, what does this imply once we put it collectively? Objects have gone on-line.

Because of this we will deploy objects, with entry controls, after all, that a number of “companies” within the type of contracts can immediately entry and manipulate for different companies to do the identical. Possibly we wish to create a system for complicated automotive historical past and titling. We are able to deploy objects/contracts for every automobile and create infinite microservices within the type of different good contracts to do many alternative actions on the identical objects whereas on the similar time offering some visibility to all customers. Or perhaps we simply desire a cleaner solution to entry our personal databases in different companies, which may look as simple as this:

On this instance, our database is hosted securely on the blockchain with an interface we will embrace in any of our companies. This isn’t a lot completely different from most third-party language-based DB libraries, however I nonetheless imagine the initialization, skill to know the code, and work with datatypes is way more sturdy.

On this article, I hoped to showcase the potential of blockchain and good contracts past cryptocurrency. Whereas I’m nonetheless within the crypto facet of this expertise, I’m making an attempt to distance my view away from Tokens, NFTs, and the clichés related to the phrase “Blockchain.”

It is vital for any technologist to keep in mind that crypto is Blockchain, however Blockchain is just not crypto to permit for the movement of recent use circumstances of this highly effective world phenomenon. My concepts are presently centered round software program engineering flows in Net 3.0, standardizing knowledge entry, and good contracts as a future backend framework. I’m excited to see the place your concepts take you as you start to consider Blockchain past crypto!

More Posts