What is Solidity Programming
Hello friends, hope you are doing fine and doing great. In the previous tutorial for introducing Smart Contracts, I told you about Solidity. Solidity is a high-level programming language for writing smart contracts. It is the most popular programming language for Ethereum. So, in this article, I will explain the basic components of solidity. Let’s get started by revising the key points of solidity.
Solidity Programming
- Solidity programming language is made for writing code for the Ethereum platform. These codes (smart contracts) help in executing different functions in Ethereum virtual machine (EVM).
- It is easy to learn the language. If you are familiar with C and JavaScript, you can easily learn solidity.
- The code written in solidity is converted into bytecode by solidity compiler. The compiler of solidity language is solc.
- The extension of a solidity file is .solc.
- It is a case-sensitive language.
- Solidity is a statically typed language.
- The process of writing and compilation is shown in the figure below.
The layout of a Solidity File
In this section, I am going to discuss the general layout of a solidity file. It contains different components. The layout of a solidity file is explained below. It has:
- Pragma
- Comments
- Import
- Contract / Library
Pragma in Solidity Programming
- Before writing the solidity program, you want to mention the version of solidity compiler. So that anyone using the file can choose the correct version for compilation.
- For this purpose, pragma directive is used. It specifies the compiler version of the file.
- Solidity is still growing and a lot of improvements have been made since its development. Therefore, the version keeps on improving.
- The current solidity version is 0.7.4.
- The version is mentioned by using the following syntax.
pragma Solidity ^0.7.0;
I should mention here that semi-colon is the statement terminator in solidity.
- It is declared as the first statement of the program.
- The version number comprises a major build number and a minor build number. When you use ^ character with version number, it means the latest version of the major build number.
- For example, as I declared the version 0.7.0 with ^ character. Here major build number is 7. So solidity compiler of version 7 will compile it.
Comments in Solidity Programming
- Guys, if you are familiar with programming, you must know that programming languages support the option of commenting. Solidity also provides this facility.
- There are two types of comment in solidity:
- Single-Line Comments: single-line comment means a comment comprising of one line only.
- Multi-Line Comments: multiline comments consist of more than one line.
- Forward slashes are used for denoting comments. Single line comment is denoted by double forward slash //. While multiline comment starts with /* and ends with */.
- It is a good practice to add comments to your program. This improves readability.
Import in Solidity Programming
- The import keyword helps in importing other solidity files. These files can then be used in code.
- The functions of the imported file can then be used in a solidity file.
- This functionality helps us in writing code in the form of modules. In this way, lengthy code can be converted into smaller readable ones.
- The syntax for using the import keyword is given below:
import filename;
- The address of the file is mentioned within the import statement.
Contract / Library in Solidity Programming
- The contracts are defined in the solidity file.
- You can define more than one contract or library in one file.
- Contracts, libraries and interfaces can be defined one after the other in a file.
So, this was the general layout of a solidity file. Now, I will move to the next section in which we are going to discuss the structure of a contract.
Structure of a Contract
Contracts are somehow similar to classes in OOP (Object Oriented Programming) Languages. The contracts are written for ethereum virtual machine. Just like other languages, contract code contains functions and variables. The contracts can also inherit from other solidity contracts. There are two special types of contracts in solidity called library and interface. In this section, I have discussed different constructs in a contract. The contract consists of the following:
- State Variables
- Structures
- Modifier Functions
- Event Declarations
- Enumerations
- Functions
Now let’s define these for further understanding.
State Variables
- Variables store values in storage locations. The value saved in a variable can be change or update while programming execution.
- Once a variable is declared, you can use it anywhere in your program, at multiple locations.
- State variables are stored in Ethereum blockchain permanently. The changes in their value and their current value is secured.
- The data type of state variable is declared while writing the program.
- Other qualifiers, used while declaration, are listed below:
- Internal
- Private
- Public
- Constant
- The following data types can be used in solidity:
- Bool for boolean
- Uint / int for unsigned / signed integer
- Bytes for 8 bit signed integer
- Address for addresses of accounts
- Mapping for mappings
- Enum for enumerations
- Struct for structures
- String for character strings
Structure
- With the help of structure, you can define a data type of your own.
- A structure is a composite data type and that means it can contain different variables having different or same data types.
- A group of variables is defined in a structure. Each one is given a name and a data type.
- A structure is declared by using the struct keyword.
Modifier
- A modifier is a function that can change the behavior of the code.
- In solidity, modifiers are used with functions, so they can change the actions of a function.
- If you are calling a solidity function that has a modifier associated with it, then the modifier function will execute first. After its execution, the called function would be executed.
- You will define modifier function only once in the program but you can use it anywhere with multiple functions.
Events
- If you are familiar with programming, you know that different programming languages support events.
- Solidity also supports events. Events tell about the change in the state of a contract.
- With the help of logs, the caller can view the state of the contract after execution.
- Events are declared outside functions, at the global level. Then these events can be called in any function.
- The keyword for event declaration is an event. After that, the identifier is declared followed by a parameter list. The parameter list contains the data type of the variables.
Enumeration
- Enumeration provides us with an interesting facility. With the help of it, you can define a data type of your own choice.
- It contains a list of constants, from which the variable can take values.
- Each value is given an integer starting from 0 for solidity.
- The enumeration is declared by the enum keyword. After the keyword, the identifier is defined followed by the list of constant values in brackets.
- There is no semi-colon at the end of the enum declaration statement.
Function
- Just like any other programming language, a function is a key component of solidity.
- Whenever a transaction is initiated, a function of a smart contract is called.
- Functions can read and write state variables. When a function is executed and a transaction is processed, the state variable may change its state.
- A function can take input parameters, perform operations on them and can return values. The return values can be more than one.
- A function has a name that is its identifier. This identifier can be used anywhere in the program for the execution of functions.
- You can use various qualifiers with a function declaration that decides the visibility of a function. These qualifiers are listed below:
- Public
- Private
- Internal
- External
- Other than visibility qualifiers, some other qualifiers are also used with functions. These show the ability of the underlying function in terms of changing values of state variables. The qualifiers are given below:
- Constant
- View
- Pure
- Payable
So, friends, I have tried to give you a basic idea of the structure of a solidity program. It is not compulsory for a program to have all of the above-listed features. I hope you have learned and got a good understanding of the basics of this language. That was all from my side. Please let me know if you have any questions. I would love to answer them. I am signing off for today, Take care!
Structure of a Block in Blockchain
Hello guys, hope you are doing good and enjoying your lives. Today, I am going to introduce you to the blocks of a blockchain. I gave you an understanding of blockchain, its characteristics, and some idea about accounts and wallets in my previous tutorials, and today my article is about the structure of a block in the blockchain.
I will first define the block before going into the details about its structure. So let’s start without any further delay.
Block in Blockchain
- A block is actually the building block or the key element of a blockchain.
- The definition of a blockchain is based on its blocks. As I defined in my previous posts, a blockchain is a chain of multiple blocks.
- Blocks contain transactions. Each block contains a different number of transactions.
- These transactions are contained in blocks so that they would be added to the distributed ledger.
- The number of transactions is limited by the block size and gas limit. Generally, the block contains more than 500 transactions.
- Other than transactions, a block also consists of some metadata. This metadata is stored in the header of the blockchain.
- The size of a block header is 80 bytes, the detail of which is given in the upcoming sections of this article.
- Let’s first define a parent block in the next part.
Parent Block in Blockchain
As the blocks are linked together one after the other, they have a parent-child relationship. Each block is the parent of the upcoming block. Each child block contains the hash of the previous block i.e., its parent block. The first block of the blockchain is called Genesis Block and it has no parent.
The block contains different fields which can be roughly categorized as listed below:
- The block size: The size of this field is 4 bytes and it contains the size of the block.
- The block header: The size of a block header is 80 bytes. It further contains different fields.
- The transaction counter: This field contains the number of transactions and the size of it is between 1-9 bytes.
- The transactions: This field contains transactions of the block and its size is variable.
This was some information regarding the fields of an Ethereum block. Now, we will move towards the next part in which I am going to give you an idea about the block header and its fields.
Block Header in Blockchain
The header of an Ethereum block contains different fields of metadata which are listed below.
- Hash of the previous block: Every block header gives information about the previous or parent block. This field contains the hash value of the previous block and this reference connects all the blocks. The size of this field is 32 bytes.
- Version: This field stores the version number to show software upgrades. The size of the version field is 4 bytes.
- Difficulty: The mining difficulty at the time of the block creation is stored in this field. The concept of mining would be explained in the upcoming articles. Its size is 4 bytes.
- Timestamp: This field contains the time at which the block was created. The size of this field is 4 bytes.
- Nonce: A nonce is a value used during the mining of the block. This field’s size is also 4 bytes.
- Merkle tree root: A Merkle tree is a structure obtained from hashing the transactional data of a block. The root of this tree is stored in the block header under this field. 32 bytes is the size of the Merkle tree root field.
This was all about the header of a block. In the next part, I am going to give you an idea about the properties of a block.
Properties of a Block:
There are a lot of properties of a block that give us important information about it. I am listing down the properties here.
Difficulty Property:
- As I mentioned earlier, this property gives the difficulty level of solving the puzzle to mine the block.
totalDifficulty Property:
- This property of the block tells us the total difficulty of the blockchain.
gasLimit Property:
- This property tells us the maximum gas allowed by the block which in turn tells us about the number of transactions that the block can accommodate.
gasUsed Property:
- The gasUsed property gives the amount of gas used by the block for executing all of its transactions.
Number Property:
The number shows the block number in the list of blocks.
Transactions Property:
- This means all of the transactions contained in the block.
Hash Property:
- This property shows the hash of the block.
parentHash Property:
- This property saves the hash of the previous block.
Nonce Property:
- Nonce property shows the nonce value that I defined earlier. It is a variable used in mining the block.
Miner Property:
- The miner property gives information about the miner of the block. This gives the account of the block miner.
So guys these were the properties of a block. I will move towards the next part i.e., the identification of a block.
Block Identification:
The blocks of a blockchain need an identification to refer them or distinguish them from other blocks. Two parameters are used for this purpose which are given below:
1. Block Hash
Block hash is the main identification parameter of a block. This value is obtained by cryptographic hashing of the header of the block. The hashing operation is performed twice. The header of the block contains metadata of the block and when this data is hashed the result is the block hash, whose size is 32 bytes.
The hash of the block is not stored in the block’s data whether the block is being transmitted to the other nodes or it is stored as part of the blockchain on some node. When a node receives a block from the network, it computes its hash itself.
2. Block Height
The second parameter used for identifying a block is its height. As we already know that the blocks are linked together in a list type structure starting from the genesis block. The genesis block is given a height 0 zero. The second block in the blockchain or the first block after the genesis block is at height 1 and so on.
In this article, I have explained the structure of an Ethereum block. The article explained the header and some properties of the blocks. I hope you have learned something new from it. Take care!
Real Time Embedded Systems: Definition, Types, Examples and Applications
Hello friends, I hope you are happy, healthy and content. We have been discussing embedded systems lately and this discussion would be incomplete without an in-depth discussion on Real time embedded systems. You might have observed their utility and their absolute need in our constantly changing external and internal environment, the ease of managing the room temperature with a single tap, generating several results with a single click and streaming videos and playing games anytime and anywhere are the blessings of real time embedded systems.
Definition of Real Time Embedded Systems
Real time embedded systems can be defined as;
- "The embedded systems which respond to real time situation with the help of its embedded software and hardware, within the specified time constraints are called real time embedded systems."
Characteristics of a Real-Time Embedded System
Real time embedded systems must have the following characteristics;
1. Constant Response:
- A real-time embedded system always responds in the same manner to a certain situation, it is not allowed to deviate from its normal designated output. An air-conditioner is not allowed to throw hot air in summers.
2. Deadline:
- A deadline is crucial to the working of an embedded system, a missed deadline can cost lives and finances.
3. Accuracy:
- In case of any malfunctioning, the system failure can cause havoc, what would happen if the pacemaker can't maintain the heartbeat, patient would eventually die!
4. Quick Response:
- It is the most important characteristic of all, the real-time embedded system must be swift enough to respond to the changing external environment with immediate effect.
Components of Real Time Embedded Systems
We have already discussed the embedded system components in detail within our previous article, for a quick overview , let's revise the basic things;
1. Hardware
- The hardware parts include a microcontroller or a microprocessor, Input and Output ports, sensors , actuators , relays, power supply or batteries and several other peripheral parts according to the design and function of the embedded system.
2. Software
- Real time embedded systems have embedded software which directs the system for performing designated tasks.
- For a real time embedded system, embedded operating systems software must have the critical feature of task scheduling, because we need a system which sticks to the deadline and performs the task within that limited time range. Let's have a look, how task scheduling is done;
Task Scheduling
To understand task scheduling you must understand pre-emptive and non-preemptive scheduling.
Preemptive scheduling
IT refers to the scheduling of tasks based on priority, it is a flexible process and interruption between the tasks doesn't upset the whole system. It's same as you are washing dishes and someone ask for a clean dish at immediate basis, you leave the thing in your hands and start washing that dish which is needed immediately!
Non- preemptive scheduling
it is a rigid process, the other task at hand has to wait until the first one has been completed.
Now, you are well aware of the types of approaches used in task scheduling, its time for a detailed outlook on the basic types of Task Scheduling done in the real time embedded systems.
First Come First Served Task Scheduling
- As the name clearly indicates, the task that is assigned first is completed first.
- This is a non-preemptive scheduling approach.
- The system is highly efficient and tries to complete the task real quick and responds quickly.
Round Robin Task Scheduling
- In this task scheduling technique the preemptive approach is applied, but there is a difference, it doesn't priorities a task, instead it allocates the time for each task.
- Its same as, you have an exam tomorrow morning and you allocate 2 hours to each chapter for revision!
Shortest Job First Task Scheduling
- All of us have done this at some point of our lives, if you aren't a very diligent student, you choose the shortest paragraph to read first. Isn't it?
- Same is done by the preemptive scheduling system in this case, the task which can be performed quickly , is chosen and performed first.
- If a new task is assigned which can be performed earlier than the one being performed at hand, the system starts performing the shorter one which has just arrived, unfair! Isn't it?
Priority Scheduling
- Let's suppose its your best friends birthday and you are in charge of all the celebrations or we can say a surprise birthday party, what would you arrange first? snacks?, decorations? or a birthday cake? The answer is clear , it would be a birthday cake winning the priority list.
- Same is the case with priority scheduling, the system prioritizes all the tasks at hand, but the one with utmost urgency and priority is performed first.
- This system can be designed using both the preemptive and non-preemptive approaches.
Real time operating system
- Real time embedded systems are everywhere around us and have real time operating system as their basic component, they are almost similar to embedded operating systems , only having a few particular features different from the typical embedded operating systems due to the task specifications.
- RTOS are implied in the embedded systems which are time sensitive.
- Time constraints are the key, a task completed after due time or deadline would be rendered useless or would have a negative impact on the users. You can't enter your lecture hall after the starting time of your lecture without feeling guilty of being late!
- Time maintenance component is crucial to the real time operating system, tasks are specified and given preference according to the time constraints of each task.
You can refer to the diagram for the components of a real time embedded system.
Types of Real Time Embedded Systems
As we are done with the definition and components of a real time embedded system, being made up of real time operating system, embedded software and hardware.It would be easier to learn their types. Real Time embedded systems have the following three types, we would discuss each of them in detail.
1. Soft Real Time Embedded Systems
Following are the characteristics of soft real time embedded systems;
- In soft real time embedded systems, timeliness of a task poses a positive impact on the system, but it is not crucial for the performance of the system.
- Missing a deadline would not degrade the performance of the whole embedded system.
Example of Soft Real Time Embedded System
A data acquisition system can tolerate delays and hence its a soft real time embedded system.
Other examples include, websites, computer games, cellular networks, online database and multimedia transmission and reception.
2. Hard Real Time Embedded Systems
Following are the characteristics of hard real time embedded systems;
- For a hard real time embedded system, time is crucial.
- The output must be completely on time, the prescribed deadline can not be missed in any case. You can't submit your exam paper after the time is over, or can you?
- In case a deadline is missed, it would be regarded as a system failure.
Following table shows the brief account of characteristic features for both soft and hard real time embedded systems.
Example of Hard Real Time Embedded System
The missile launch system is one of the most suitable examples in such systems, if the missile is not launched in time, it would miss the target claiming a huge environmental, economic and human loss.
Other examples include medical equipment and handheld devices, avionics, industrial control systems, and transportation control.
3. Firm Real Time Embedded Systems
Following are the characteristics of firm real time embedded systems;
- Timelines of a task are crucial but the missed deadline can be compensated as it occurs rarely.
- Missed deadline doesn't degrade the system performance.
- In case of the missed deadline, The system continues to perform and discard the delayed response.
Example of Firm Real Time Embedded Systems
A fully automated assembly line doesn't crash when a task isn't performed in time, it rather ignores that missed part and continues to complete the rest.
Examples of Real Time Embedded System
- Real time embedded systems examples are being listed below, we will only discuss the few basic ones in detail out of an endless list.
Cardiac Pacemaker - A Real Time Embedded System
- First one on the list is a pacemaker, let's have a brief idea about the function of pacemakers first, a pacemaker maintains the heart beat, so is crucial to human life. A pacemaker is a real time embedded system.
- The sensors present in the pacemaker detect the intensity of the beat and send an electrical signal, if its too low to maintain normal function of the heart, in response to this signal an electrical impulse is generated to maintain the already diminishing heartbeat, your heart can't skip a beat, otherwise you'd die of heart attack! It only happens in movies.
Airbags- A real Time Embedded System
- Who is not aware of the importance of air bags in this era of modern vehicles! Airbags are indeed one of the most celebrated safety inventions of modern age.
- Air bags are necessary for human survival in case of a road accident which is obviously a life threatening condition.
- The airbags are inflated on the detection of collision or crash by the sensors, upon detection certain chemical react instantly to inflate the bags, providing cushion to the passengers to land on, saving passengers from serious injuries.
- Hence, airbag system of a car is a real time embedded system which works within strict time constraints, otherwise it would be useless for an airbag to inflate after the passenger has already got a whiplash injury during collision, ending up in a hospital bed or a deathbed.
Manufacturing Assembly Line
- The above mentioned examples were the life threatening ones, the one we are about to discuss is light and crispy!
- Now consider a manufacturing assembly line for production of Lays, the one you have seen in your childhood on national geographic, or maybe you were lucky enough to see it in real!
- What would happen if the automated system fails to fill in the chips in designed time? It doesn't happen that much, but just imagine for an instance!
- That one delayed step would disturb all the preceding steps in line, such as sealing and flavouring the packets.
- This is not life threatening situation , but a delay that would cost millions or much more. Packaging is just the terminal step, you can yourself imagine the importance of timelines in the whole manufacturing process.
- Or in another instance the missed step would be ignored if it is not on a large scale and the process would continue, the same thing that happens in firm real time embedded systems. It all about programming the system according to your personal preference and available resources.
- Thus a manufacturing assembly line is a real time embedded system, which needs to be in time.
Crusie Control of a Car
- Cruise control which once seemed a crazy concept a while ago is now a new normal for longer trips.
- It's a real-time embedded system that controls the speed of a car.
- The real-time embedded software algorithm has basic features of keeping the car at a preset speed as indicated by the driver, maintaining a safe measurable distance from a preceding vehicle, and lastly it is designed to switch between the two discussed modes according to the real-time situation on road.
- A minor miscalculation of the speed and distance would cause havoc on the road, thus real time embedded systems need to be accurate and on time during their performance.
Safety critical systems
- We have discussed safety critical systems in one of our previous articles as well, but a discussion on real time embedded system without an example of a safety critical system is incomplete.
- First things first, Safety Critical Systems are real time embedded systems.
- You might have got a slight idea about the safety critical systems from their name, The systems which can't afford delay are called safety critical systems, their output delay can claim a human life, can pose serious financial and environmental crisis.
- One the most common example is a missile launching system.
- Missile launching system is a real time embedded system, imagine the destruction with one single delay or miscalculated response. Another example include shuttle launch in space which is also a safety critical system.
Applications of Real Time Embedded Systems
Real time embedded system applications are countless, a few popular ones are being discussed below;
Medical Industry
- Real time embedded systems are deeply rooted into the healthcare sector either in the form of handheld devices such as insulin pump, BP apparatus, pulse oximeter or large devices such ECG machines, and industrial scanners, real time embedded systems are everywhere.
- These embedded systems have made diagnosis , treatment and prognosis much easier than before. Diagnosis and treatment would be a difficult thing to do without the real time embedded systems, how would you identify a tumor without a scan? How insulin levels would be checked? Nobody can deny the importance of real time embedded systems in the medical field.
Manufacturing and Assembly Lines
- Real time embedded systems have revolutionized the automation of production lines, you might see the fully automated processes of biscuits, chips and soda in documentaries or maybe in real. Have you ever thought how it is done? The mechanism and machinery behind the fully automated processes? These are large robots with real time embedded systems, performing their designated tasks in a real time environment.
- Control of internal environment according to the manufacturing process, for humidity , air pressure and temperature is also done by real time embedded systems. Would you ever like soggy lays? Or a soda without gas? A cookie without crunch? No! Nobody does! All these factors are controlled by real time embedded systems through predictive maintenance.
Military Operations
- Either it is a preventive or defensive approach, real time embedded systems are an essential part of a bigger picture in military armaments.
- You might have heard of guided missiles, detection systems and much more intelligent weapons, all these systems are real time embedded systems.
- In military SWaP size, weight and power is a decisive factor of winning and losing for the soldiers in the battlefield, real time embedded systems, reduce size and weight of the power gear and provides quicker and better turnover during a strike.
- Microcontroller technology has led to the reduction of production costs along with the manufacturing of lightweight power gear.
Home Automation
- You might have seen the central cooling and heating systems, smart lighting system, security system, fire alarm, security surveillance system and many other systems that are controlled by the sensors by collecting data from external environment, these are real time embedded systems which have added to the ease of human beings.
- All the above mentioned systems are controlled through internet but they can be regulated manually as well.
- We have already discussed in detail the concept of a Smart home, in which several electronic devices are connected to a central hub through internet. Real time embedded systems have helped a lot in turning this unpopular concept into reality. To say the least, it is indeed an expensive concept.
Automotive industry
- Automotive industry has reaped the benefits of the real time embedded systems to full extent.
- Can you imagine a car without a GPS system these days? No , its an absolute necessity now!
- Crusie control, smart parking, car tracking, traction control system, and a lot more which are a part of another bigger picture have real time embedded systems in them.
- Hybrid vehicles which consume less fuel and save environment are a gift of real time embedded systems as well.
Multimedia Systems
- Multimedia systems which provide the audio and video interface to their users, have real time embedded systems as their integral part.
- The gaming world would be incomplete if real time embedded systems are not implied, many of the modern games are also networked and played live among the users from all over the world at the same time.
So, friends, that's all about the Real Time Embedded Systems, I have tried to cover everything regarding this topic. I hope you have learned something new from this article. In case you want to add something new to the list of applications or examples of embedded systems, you can mention in the comment section below. See you soon with another topic. Have a good day ahead!
The LendInvest Loan Engine – What is it and How Does it Work
LendInvest makes property finance simpler. Bridging loans, development finance, and buy-to-let mortgages for intermediaries, landlords, and developers made it easier. LendInvest provides loans that you can trust. They provide fast and flexible funding to help the property professionals create housing that is funded by an international capital base. LendInvest’s international capital base of £2 billion supports projects of wide variety and they are backed by some of the world’s largest financial institutions and the most successful individuals. Some institutions include HSBC, J.P. Morgan, Citi, and NAB. Be updated in banking news to learn more.
How do they simplify property finance? They use technology-enabled lending and they are relationship focused. Technology-enabled lending means using online tools to make property lending experiences better. The technology they designed is built around the needs of the user. This relates to their relationship focused philosophy. They are experts dedicated to fulfill a high quality service for the users. They want to ensure that the loan for your next project is hassle free to get.
LendInvest is reliable and trustworthy because of its decades of experience. They are also a multi award winning company that is proudly profitable. They certainly get the job done because of their ambitious and professional team. From their engineers or mortgage advisor to their underwriters are all very talented and specialists in their own fields.
Lendinvest has been awarded by the REFI European awards as the winner of Alternative Fund of the Year in 2020. They are also awarded the Financial Times as one of Europe’s Fastest Growing Companies in 2021. LendInvest has received multiple notable awards.
LendInvest allows important information to be readily available to a wide selection of teams across the business. They have a unique business model that is responsible for their rapid growth over the last ten years.
LendInvest serves as a mortgage marketplace platform for both investors and borrowers!
For investors, it is a place for
- Investment Funds
- Online Platform
- Financial Partnerships
- Retail Bonds
- RMBS
For borrowers, it is a place for
- Bridging loans
- Development loans
- Buy-to-let mortgages
Start your next project as an intermediary or a borrower with LendInvest!
- For intermediaries here are loans and mortgages rates:
|
Rates from |
Max LTV |
Loans up to |
| Auction |
0.55% |
75% |
£15 million |
| Bridge-to-let |
0.55% |
75% |
£750,000 |
| Buy-to-let |
2.99% |
80% |
£3 million |
| Commercial Bridging |
0.79% |
75% |
£15 million |
| Development |
7.98% |
65% |
£5 million |
| Development Exit |
0.55% |
70% |
£15 million |
| Regulated Bridging |
0.55% |
70% |
£3 million |
| Residential Bridging |
0.55% |
75% |
£15 million |
- For borrowers here are the bridging and development loans
|
Rates from |
Max LTV |
Loans up to |
| Auction |
0.55% |
75% |
£15 million |
| Bridge-to-let |
0.55% |
75% |
£750,000 |
| Commercial Bridging |
0.79% |
75% |
£15 million |
| Development Exit |
0.55% |
70% |
£15 million |
| Development Finance |
7.98 |
65% |
£5 million |
| Residential bridging |
0.55% |
75% |
£15 million |
You can contact LenderIvest by calling them or through email. Expect an efficient and fast responses from the team!
- How does LendInvest work?
They tackle problems that are being faced in property finance such as:
- Enabling various teams across the business to track which loans each funding source is funding source is funding in real time.
- Recording and analyzing financial data to make better decisions.
- Ensuring that they are funding loans in the most efficient way possible.
They found a solution for these problems by providing an efficient interconnected process of loan funding and management, accounting, reporting, and
data warehousing.
- Tracking loans in real time
The Loan Engine provides a live viewing for the state of the entire loan book. You can view the funding source of each loan and their balances. You can also view the data history.
- Efficient internal workflow
The Loan Engine is a tool that helps all the dedicated and talented finance and treasury teams. It made the reporting and reconciling transaction of loans easier.
- Accurate capital allocations
They differentiate the use of their funds by knowing which loans should be in which funding source and when they should be drawing capital from those sources.
These are the factors that affect it
- Funding source costs are complicated, and change over time
- Each funding source has strict rules on the composition of its portfolio – both on an individual loan basis as well as the whole portfolio
- Non-utilisation fees
- When and how much capital we should request from our funding sources
- Regulatory and fair treatment requirements
- Pipelines of loans about to be lent and about to be paid back
All of these details contribute into making LendInvest a reliable and trustworthy business. They are constantly improving their ways to ensure that they are doing the most to help those who work with them. Loans and funding is a complex thing that is hard to handle by just a single person. A dedicated team that specializes in what they do can make it easier. LendInvest constantly innovates and develops.
Smart Contracts: Definition, Working, Writing & Deploying
Hello friends, Hope you are doing fine and having a good time in your life. The topic that I am going to discuss today is a very interesting and important one in the context of blockchain. I will discuss smart contracts in this article and I am sure you will learn the concept by the end of this tutorial. I have mentioned smart contracts in my previous articles and defined them before.
Before discussing smart contracts, let’s first revise what a contract is, and then we will talk about smart contracts.
Contract
- When two persons or two parties want to carry out a deal or a transaction such as buying property, they need some proof for future reference.
- So, a contract between two or more individuals is a legal document that serves as proof for the transaction.
- All conditions of the transaction are mentioned in the contract and must be fulfilled by the involved parties.
This was the basic idea and revision of the concept of a contract. Now, I will introduce a smart contract in the next section.
Smart Contract
When reading about blockchain and decentralized applications, you must have encountered the term “Smart Contract”. The name may indicate to you that it could be a contract that executes smartly or that has smart conditions. Well, in actuality, it is a contract whose conditions fulfill when it executes. If the conditions of such a contract are not met, then the execution fails.
- In the Ethereum blockchain, a smart contract is actually a program that is deployed on Ethereum.
- The smart contract contains logic and it is written in some high-level language.
- An example of a high-level language is solidity that we will discuss in the upcoming tutorials.
- A smart contract is a set of rules that are coded in the form of a program. These rules govern the transactions between the Ethereum accounts. The transaction could be a transfer of assets, transfer of money, or a change of Ethereum state.
- In Ethereum, the type of account having a smart contract is called “Contract Account”.
- Smart contracts can have balance and can also store data. They contain several functions that can be called by other accounts.
I have told you earlier that only an externally owned account can initiate a transaction on Ethereum and call a smart contract. Once initiated, the smart contract can call other smart contracts deployed on Ethereum or it can deploy a new contract.
Writing Smart Contracts
In this part of the tutorial, we are going to discuss writing smart contracts for Ethereum. Various tools are available for writing smart contracts. First, let’s talk about Remix.
Remix
- The remix is an Integrated Development Environment for writing smart contracts.
- It is a browser-based IDE and helps in developing contracts easily.
- The language used is Solidity.
- It helps in the following functions:
- Writing and developing smart contracts
- Deploying contracts on Ethereum networks
- Troubleshooting contracts
- A remix is an open-source tool available freely for everyone. So, if you are not comfortable using the online version, you can simply download it and use its functionality.
- The downloaded version can be used offline on a local computer system.
- The general steps for writing a smart contract using the online tool are given below:
- Open your browser and type https://remix.ethereum.org/ in the address bar.
- The site will show some default contracts. You can use that, study that or you can simply delete that if not needed.
- On the left bar, there would be an option to create a new file. Use that to create your smart contract.
- Write the code for your smart contract in the newly made file.
- The next steps are to compile the contract using a solidity compiler and deploying it on the network.
- After deployment, the functions written in the contract code can be executed.
This was a brief introduction to remix. Let’s talk about Solidity now.
Solidity
- Solidity is a high-level programming language used for writing smart contracts.
- This language has similarities with C and JavaScript languages.
- Solidity is case-sensitive.
- The extension of a solidity file is .solc and this file contains code.
- You can write and read such a file in any text editor.
- The solidity compiler is used for the compilation of code and named “solc”. The compiler generates the bytecode of the smart contract.
- This bytecode is generated for the Ethereum virtual machine as it cannot understand code in the high-level language.
- You can install solc using npm by typing the following command in the command prompt.
npm install –g solc
Remix and Solidity are the two essential tools for writing smart contracts. In the next part, we will discuss the deployment of contracts.
Deploying Smart Contracts
The contracts are deployed after compilation. The solidity compiler performs this task and generates two main outputs that are listed below:
- ABI
- Bytecode
Now let’s explore these two concepts.
ABI
- ABI stands for Application Binary Interface.
- ABI of a smart contract contains a declaration of all public and external functions. It also contains their parameters and returns types.
- ABI is the definition of a contract. Any account that wants to execute a contract function uses its ABI.
- After deployment, the contract instance is created using its application binary interface.
Bytecode
- The bytecode is understandable by Ethereum and helps in deploying the contract on the Ethereum virtual machine.
- Ethereum virtual machine cannot understand solidity so bytecode is a must.
ABI definition and bytecode both are necessary for deployment. The transaction for deploying a contract on EVM takes place and an address is generated for the smart contract. This address is the identifier of the contract. Any function of the contract can be called and executed using the contract address.
So, guys, this was all about smart contracts. We discussed the main idea and some steps to create a smart contract. The two main tools for creating a contract are also discussed in this tutorial. I hope you have learned these concepts and enjoyed reading them. That’s all for today. Take care and have fun.
dApps: Definition, Features, Comparison & Developing Tools
Hello friends, hope you are doing fine and enjoying your life. In today’s article, I am going to discuss decentralized applications that are abbreviated as dApps. With the invention of blockchain technology and afterward Ethereum, the idea of decentralized applications has gained a lot of attention. So let’s get into the details and learn what a dApp is.
Decentralized Applications (dApps)
- An application built on a decentralized platform such as Ethereum is called a Decentralized Application(dApp).
- A dApp generally consists of a backend and a frontend.
- The backend of a dApp is a smart contract mostly written in solidity language.
- The front end of a decentralized application is the user interface. The user can interact with the application using the frontend.
- Smart contracts available on Ethereum are open for anyone. So, a dApp can use the smart contracts present on Ethereum other than its own backend.
- Now l am going to give you the similarity and differences between a centralized application and a decentralized application in the next section.
Centralized vs Decentralized Application
In the traditional internet system, there is a central server and various computer systems connected with it. The backend program of centralized applications runs on that central server. While in decentralized applications, the backend program runs on a decentralized network. I have discussed the decentralization concept in my previous articles.
The front end of a centralized application can be written in various languages such as HTML. The front end of the application connects the user with the functionality of the backend. Similarly, in decentralized applications, the front end can be written in any programming language and that will help the user in interacting with the backend.
In the upcoming section, I am going to discuss smart contracts. We have already discussed them before. So we will try to make a connection of a dapp with smart contracts.
Smart Contracts
- A smart contract is simply a program that is controlled by its logic.
- The logic given in the code controls the execution of the smart contract.
- It is deployed on the Ethereum network by an account.
- The backend of a dApp is written in the form of smart contracts. Thus, smart contracts control the execution of a dApp.
Features of a dApp
In this part of the tutorial, I will talk about the characteristics of a DApp that make it so useful. These are listed below:
Decentralization
- As a dApp runs on a decentralized platform, it is independent.
- No central authority controls it. A dApp is controlled by the backend logic.
Deterministic
- The output of the dApp is known. It will always produce the same result with the same conditions.
Open Source
- The dApps are open source and available for anyone. The dApp’s operation is autonomous.
Transparency
- Dapps provide transparency, trust and audibility. The data is secure and accessible to anyone.
Turing Compatibility
- As Ethereum is Turing complete, a dApp on Ethereum is Turing compatible.
Isolation
- All dApps on Ethereum virtual machines are executed independently in a virtual environment.
- Any errors in one code do not break the functions of the rest of the network.
Privacy
- While using or deploying a dApp, the user does not have to provide his real identity and that helps in privacy.
Data Integrity
- Data is secure and immutable in dApps. No hacker or malicious entity can change the data.
No Downtime
- When a decentralized application is deployed on the peer-to-peer network, it is available for everyone.
- Not like traditional systems, where a failure in the central server makes the app unavailable.
These are some features of a decentralized application. Along with these features, some other points make Ethereum dApps different and usable. I am listing some of those exciting features below:
- A dApp is uncensored as no party has control over it.
- A dApp is able to create digital assets.
- A dApp can create a new currency.
- A dApp allows you to use the functionality of decentralized systems in any application.
- Any node can use a dApp and connect to the Ethereum network.
Tools for Developing dApps
A variety of tools are available for developing dapps. Some of them are listed below:
- Programming Language
- Web3 Library
- Development Frameworks
- Integrated Development Environment
- Blockchain
- Ethereum Network
- Wallet
Programming Language:
- A programming language for writing smart contracts is needed while developing a dApp.
- The most common one is solidity.
- Vyper and LLL are two other options for writing contracts.
Web3 Libraries:
- Web3 library provides an interface for interaction with Ethereum nodes. They are available in different language options. Such as web3.js and ethers.js for javascript and web3.py for python.
Development Framework:
- The development framework helps you in performing operations such as compilation, ABI generation and testing etc.
- The most common development framework is Truffle. It is node-based and the most used one.
IDE:
- IDE or Integrated Development Environment also helps in dApp development.
- The Remix is an online IDE that you can use from your web browser. It is the most convenient option.
- You can also use the Visual Studio extension for solidity.
Blockchain:
- While testing your dApp, you need some development blockchain where you can quickly deploy your contracts and test them.
- Ganache is the tool for that facility. It creates a local blockchain on your system.
Ethereum Network:
- While working on the dApps, you have the option to deploy it on the network of your choice.
- For example, while testing you can use the test network.
- There is no value of ether on the test network, so you can easily test your dApp.
- Ether has value on the main Ethereum network, named Mainnet.
Wallet:
- A wallet is a software application that is used for keeping track of the balance and managing keys.
- Various wallets are available with different functions and security levels. The common one is Metamask, a web-based wallet.
These are some of the tools that you need for developing a dApp. With that, I am concluding this article. I am hoping you have got some good information from this tutorial. Let me know if you have any queries. Take care, bye!
Ethereum Wallet: Definition, Working and Types
Hello friends, hope you are doing good and enjoying your life. Today, I am going to introduce you to the Ethereum wallets. I have given you an introduction to blockchain, its characteristics, and an introduction to accounts in my previous tutorials, so let’s get started with today’s tutorial on Ethereum wallets.
What is Ethereum Wallet???
In this section, I will introduce you to the Ethereum wallet and then we will move into its further details.
- A blockchain wallet is just like a real-life wallet but in software form. It is the digital form of a wallet.
- A wallet is application software that acts as a user interface to the Ethereum network.
- The wallet is a system to manage and store the keys.
- This digital wallet allows transferring cryptocurrencies from one account to another.
- The functions that can be performed by using a wallet are:
-
- Access to your money
- Access to accounts
- Management of keys
- Management of addresses
- Management of cryptocurrencies such as bitcoin or ether
- Tracking and viewing the user’s balance in different accounts
- Initiating transactions
- Signing transactions
- Interacting with contract accounts
This was some basic idea of wallet technology. Let’s move towards an important feature of wallets i.e., key management in the next section.
Key Management in Ethereum Wallet
- The actual function of a wallet is managing keys.
- If you think that your wallet will contain money then it is not true. You can view your balance via your wallet but this balance is actually residing on the Ethereum blockchain.
- Your wallet contains keys (both private and public) and by using these keys, you can sign transactions on Ethereum.
- To transfer ether or any cryptocurrency to other accounts, you need keys stored in your wallet.
- In centralized systems such as banks, your money is saved under your account. You can check the account balance and perform transactions with the involvement of banks. While in the blockchain you can control your money with your wallet yourself.
Ethereum Wallet Design
- While designing or choosing a wallet, two factors are considered that are convenience and privacy.
- There is always a trade-off between the two.
- With more convenience comes privacy issues and with strict privacy, convenience is compromised.
Types of Wallet
The wallets are classified into two main types depending upon the relationship between the keys they hold. These types are given below:
- Deterministic Wallet
- Non-deterministic Wallet
Now, I will explain these types a little bit. The first one is the deterministic wallet.
1. Deterministic Wallet
- In this kind of wallet, all wallet keys are generated from a single key.
- This single key is called the master key and it is derived from a seed.
- All of the keys are related to each other. Here, the original seed value is very important.
- These keys can be generated again with the use of seed value.
- Commonly, these keys are linked in the form of a tree structure where the root is the seed value.
2. Non-deterministic Wallet
- The second type of wallet is a non-deterministic wallet. In this kind, the keys are not related to each other.
- Each key of such a wallet is generated independently from different seed values.
- This wallet is also termed a random wallet and it is better than a deterministic wallet in terms of security.
Mnemonic Words
- There is a concern about security in deterministic wallets as all keys are related.
- If anyone gets a hold of the seed value, he can generate the master key and then all other keys of the wallet. It will give access to the balance.
For unfortunate data loss accidents, when a person loses his seed, the seed value is converted to mnemonic codewords. The mnemonic code words are a bunch of English words that the wallet holder has to keep safe. This word list can be saved in the form of a hard copy by writing that on a piece of paper and then storing it in a secure place.
This concludes the section here. I will now discuss different wallet applications available for you in the next part.
Different Forms of Wallet
There are different kinds of wallet applications for you to select from. The interesting thing about wallets is that you can switch from one type of application to the other. If you do not like the wallet that you are using, you can change your wallet easily and there is no loss in doing so. All the funds in your current wallet would be transferred to the new wallet. Your keys would be moved from the old wallet to the new one.
The wallet applications are classified into three types that are listed below.
- Mobile Wallet
- Desktop Wallet
- Online Wallet
- Hardware Wallet
- Paper Wallet
Mobile Wallet
- A mobile wallet is simple a phone application.
- You install the wallet application on your mobile phone and then access your account.
- These wallets can be used anywhere and are safer than online wallets.
- The only problem arises when there is a phone breakdown when you can lose your money.
Desktop Wallet
- A desktop wallet is also a safer option than online wallets.
- You can download a desktop wallet on your personal computer and access it anytime from the same device.
- The issue with this type of wallet arises when your desktop gets out of order, gets hacked, or is infected by a virus.
Online Wallet
- An online wallet is a convenient option to use.
- It can be opened anywhere from any device having an internet connection.
- These wallets reside on the cloud. Online wallets have higher security issues and can be used wisely.
Hardware Wallet
- In this kind of wallet, the keys are stored on some hardware device such as a flash drive.
- The hardware wallet remains offline mostly which provides security features.
- This wallet is a convenient and safe option although expensive among others.
Paper Wallet
- The last type of wallet is a paper wallet. This is the safest option among all options.
- The public and private keys are written or printed on a sheet of paper to make a physical copy and that copy is called a paper wallet.
- The transactions are done by entering private keys or you can also scan the QR code of your paper wallet.
These were the types of wallet applications and you can choose any of them depending on the features you prefer the most. So, guys, this was all about wallets. I hope you have learned something new from this article. That was all for today, Take care!
Ethereum Accounts: Definition, Types and Fields
Hello friends, hope you are doing good and enjoying your life. Today, I am going to introduce you to Ethereum accounts. I have given you an introduction to blockchain in my previous tutorials, so let’s get started on the essentials of this technology. I am going to start with accounts.
Ethereum Accounts
- An account is an important component of the Ethereum system.
- It is the main building block and has a balance in ether (ETH) (Ethereum currency).
- An account is capable of sending transactions on the Ethereum network.
- The interactions between different accounts create transactions that are stored in the distributed database.
- Each transaction involves the sender account, receiver account and contract account.
- An account can be controlled by a user or it can be a program deployed on the Ethereum blockchain.
Types of Ethereum Accounts
In this section, I am going to describe the two types of accounts in Ethereum, namely externally owned and contract.
- Each account has a balance property that shows how much balance the account currently holds.
- Therefore, accounts are classified into two main types:
-
- Externally Owned Accounts
- Contract Accounts
Externally Owned Accounts
- Externally Owned Account is abbreviated as EOA. This is the type of account that is owned by people on the Ethereum network.
- An individual makes an account on Ethereum and a public-private key pair is generated for the account. The account is not identified by the person’s name or any personal information.
- The private key of EOA gives control and access to one’s assets and contracts. The private key is kept secured by the user.
- While, as the name suggests, the public key of the account is open. This key acts as the identity of the account.
- The public key is generated from the private key via a one-way cryptographic function.
- As an example, if you create an account on Ethereum, you will keep the private key to yourself while the public key would be shared. Transactions between accounts are carried out through public keys.
- The address of an Ethereum account is generated through its public key.
- This type of account interacts with other externally owned accounts and contract accounts. It carries out transactions with the former one and interacts with the latter one by calling and executing its functions.
- This type of account has no code. It has balance in ether.
- Now, let’s talk about the second type of Ethereum accounts.
Contract Accounts
- In this section, I am going to tell you about the second type that is contract accounts.
- In some ways, contract accounts are similar to externally owned accounts but there are some differences between them too that I will mention later.
- First, let’s define a contract account. A contract account has a code for a smart contract.
- The contract account is identified by its public address.
- This account does not own a private key.
- These accounts also have balance property and they can hold ether too but these accounts have smart contract code. This code contains functions to execute and state variables.
- The logic of the smart contract controls this account. The smart contract that is deployed on the Ethereum blockchain is the owner of the contract’s account.
- When an externally owned account initiates a transaction with a contract account, the code of that contract runs in Ethereum virtual machine. The transaction contains data other than ether that tells information about what functions to run and what parameters should be given to the functions for execution.
This was some introduction to both accounts. Now, I am going to highlight some key differences and similarities between these two types.
Difference in Externally Owned Account and Contract Account
- An externally owned account (EOA) does not have a code while a contract account has a code.
- Externally owned accounts have a private key associated with them that contract accounts do not have.
- An externally owned account can initiate a transaction with another externally owned account or a contract account. But a contract account cannot initiate transactions.
- A contract account responds to transactions and in doing so it can call further contracts and their functions.
- Transaction between two EOAs is only of one kind that is the transfer of ether while transactions with a contract account can be of any kind, for example, calling other contract’s functions, deploying another contract, etc.
- An externally owned account is free to create while creating a contract account has a cost.
Similarities in Externally Owned Account and Contract Account
- Contract and externally owned accounts both are identified by their public addresses.
- Both types of accounts can have a balance and are capable of sending and receiving ether.
- Both of these accounts can interact with smart contracts deployed on Ethereum.
This was a comparison between externally owned and contract account. In the upcoming section, I am going to tell you about the components of an account.
Fields of an Ethereum Account
Any Ethereum account, whether an EOA or a contract account contains four fields which are given below:
- Nonce
- Balance
- CodeHash
- StorageRoot
I am going to give you an introduction to each of them. The first one on the list is Nonce.
Nonce:
- The nonce of an account is actually a counter that tells us about the number of transactions sent from that account for an externally owned account.
- While, for a contract account, this counter indicates the number of contracts created by that account.
Balance:
- This property shows the balance of the account as the name suggests.
- The balance is actually in Wei, a unit of ether (ETH) where 1 eth = 1x10e18 Wei.
CodeHash:
- This field gives the hash value of the contract code of the account.
- In the case of contract accounts, the smart contract code is hashed and the resulting value is stored in this field.
- While for externally owned accounts, this field contains the hash value of an empty string.
StorageRoot:
- The data of an account is stored in the world state trie.
- Each leaf of this trie represents one account.
- The storageRoot contains the hash value of the root of the storage trie.
- This field of account is empty by default.
These are the four fields of an Ethereum account. I hope this article has given you an understanding of Ethereum accounts. I will bring another interesting topic next time for you. Till then, take care!
Blockchain Mining: Definition, Process, Pooling & Miners
Hello Friends, Hope you are doing fine and having fun in your lives. In my previous tutorials on blockchain and Ethereum, I have talked about mining a few times. So, in today’s article, I am going to discuss the concept of mining with you. This is an important part of learning the working of blockchain to see how the decentralization of blockchain happens. Let’s start today’s article by defining mining.
Blockchain Mining
- As blockchain is a peer-to-peer network. Mining is also a peer-to-peer process.
- Blockchain (or Ethereum) mining is used to verify transactions on the network.
- In this process, miners (the person or node who performs mining) add transaction records to the decentralized distributed ledger of the blockchain.
- The transactions are added to the blocks, and the blocks are secured and linked after mining in the form of a chain.
- Mining requires computational power and effort from miners. And basically, it is the process of adding blocks.
- In this way, the transactions get confirmed and money and assets move from one account to another.
This was the idea of mining. In the next part, I am going to define the miner and discuss its role in the Ethereum blockchain network.
Blockchain Miner
- As defined earlier, a miner is a person or computer that performs the mining process.
- Miners provide their time, efforts, and computer resources for mining and serve the blockchain system.
- As a reward for their contribution, miners get transaction fees. The sender (or initiator) of the transaction pays this fee to the miner.
- A miner adds a number of transactions in the new block and collects the transaction fee for each of them.
- Any person can become a blockchain miner. A blockchain mining software needs to be installed and executed by the miner. This allows them to communicate with the blockchain network.
- A computer performing this process then becomes a node. The nodes interact with each other to collaborate for verifying transactions.
This was all about the miners and their importance. Now, I will explain the idea of decentralization in the context of mining in the upcoming section.
Mining and Decentralization
I have discussed the concept of decentralization in previous articles. Decentralization means no central server or no central authority to manage and control the data. An example of centralization is our traditional banking system. And an example of decentralization is blockchain.
Decentralization is related to the mining process. Miners contribute to the blockchain system by providing their computing powers in verifying the blocks of transactions. This verification process is mining and it eliminates the need for a central entity.
The agreement of everyone on the state of the Ethereum network is essential for this system. Miners make this possible by solving the blocks and this increases the trust and security in this system. The decentralized process and consensus happen from these four processes.
- Each transaction is verified by every node independently. The verification is done based on complete criteria.
- The addition of these verified transactions into new blocks by miner nodes independently. The addition is done with a computation via a proof of work algorithm.
- The new blocks are then verified by all nodes independently. The next step is assembling these blocks into the chain.
- The selection of the chain having computation via proof of work, by every node independently.
In the next part, I will discuss the step by step process of mining via nodes.
Mining Process
For explaining the procedure of mining in steps, let’s start with the transaction generation.
- The first step is the initiation of a transaction by an account.
- A person (an externally owned account) starts a transaction by providing all the necessary data and then signing it via his private key.
- The transaction is transmitted to the Ethereum network via some node requesting to be confirmed by miners.
- When nodes of the network get a request from a transaction, they add that unconfirmed transaction to the pool of other such transactions.
- All unconfirmed and unadded transactions will wait in that pool.
- Any miner starts the process of mining by adding hundreds of different transactions in its block. More number of transactions means a more rewarding fee for the miner.
- The miner verifies each transaction in its block and executes any code with it.
- The miner would change the state of the Ethereum virtual machine and produce the proof of work certificate for its block.
- The miner also produces a checksum of the new Ethereum virtual machine (EVM) state.
- When the computation is complete and a certificate has been produced for the block, it would be transmitted to the network.
- When other nodes receive the new block, they check the authenticity of the block certificate.
- Then execute all transactions included in the new block and check the state of the Ethereum virtual machine.
- They produce a checksum of their EVM state and match it with the checksum of the EVM state provided by the miner.
- If the checksum matches, the new block is added to the blockchain. The resulting EVM state is accepted as the new state.
- The transaction confirmed via a new block is then removed from the pool of unconfirmed transactions.
- Every new node that joins the blockchain network downloads the complete blockchain starting from the genesis block.
- Each transaction of every block is executed again until the final state of EVM is obtained. This state matches with the EVM of all other nodes.
- In this way, transactions get verified again and again increasing trust and security features.
So, guys, this was the process of mining. I tried to make this easy to understand for beginners. Before concluding this article, I want to introduce you to another concept related to mining and that is “Mining Pools”.
Mining Pool
- With time, the mining competition has been increased.
- Mining a block requires a lot of electricity and hardware resources and the likelihood of successful mining is very low.
- Therefore, miners now group and work together in mining pools where they share their resources and also the reward.
- In this way, everyone gets something out of their input.
In conclusion, I hope you have got an idea of how mining works from this article. Next time, I will present another new concept to you. Till then, take care!
Ethereum Blockchain: Definition, Currency, Working & Components
Hello friends, Hope you are doing good. In my last tutorial, I gave you an introduction to blockchain technology and this article is the second one of this series. Today I am going to talk about Ethereum. In simple words, Ethereum is an open-source platform of blockchain technology. But unlike the bitcoin blockchain, it offers more functionality. The blockchain in bitcoin tracks bitcoins only. It tracks the ownership and transfer of bitcoins. While Ethereum is not only a payment network for cryptocurrency but also termed as the world computer due to its wide functionality. First, let’s go through the key introductory points of Ethereum, and then we will dive into the details:
What is Ethereum Blockchain?
- Ethereum blockchain is an open-source global platform that supports decentralized applications.
- It offers a programmability feature, coding is done in smart contracts.
- It runs its own currency named Ether and is abbreviated as ETH.
Now let’s take a look at its invention history, and then I will talk about its features in the next sections.
History of Ethereum
In this section, I will give you an idea that how Ethereum was invented and why there was a need of developing such a platform. When bitcoin was invented and people realized the power of blockchain, developers tried to design new applications other than cryptocurrency. The limited functionality of the existing blockchain made it difficult to build different types of projects and hence, arose the need for a new blockchain.
In 2013, Vitalik Buterin presented a white paper giving the idea of the Ethereum blockchain. Afterward, Vitalik and Gavin Woods worked together and built upon that idea. And guys, finally in 2015, the first block of the Ethereum blockchain was mined. So, this was a little history and now before getting you bored, I will move towards the next section explaining the programmability of Ethereum.
Ethereum Programmability
- The main function of Ethereum is that it is programmable, which means applications can be built on it.
- It is a general-purpose blockchain capable of executing code.
- The language offered by bitcoin was very limited with limited data types and size, but this is not the case with Ethereum.
- Ethereum is also called Turing complete and I will explain the concept of Turing completeness in the upcoming sections.
Working of Ethereum Blockchain
I am going to tell you about the working of Ethereum Blockchain in this section.
- The memory in Ethereum stores data and code.
- The Ethereum blockchain tracks the changes in data and thus it tracks the changes in its memory.
- Ethereum first loads the program, executes it and finally stores the results in its blockchain.
This procedure is the same as in the computers that we use in our daily life. The difference is that the data in our computer is stored locally while in Ethereum blockchain, the changes in state are distributed and each node has data stored in it. Also, the changes in data are according to the consensus rules. The process can be summarized as:
- Accepting transactions from different nodes or accounts.
- Updating the state for accepted transactions.
- Storing and maintaining the state in its memory.
- The states are maintained until another accepted transaction happens.
- This process is repeated for each change.
Now let’s list down some main components of ethereum technology. I am going to give you a simple definition of each one for a basic understanding.
Components of Ethereum Blockchain
The components of Ethereum are given below:
Peer to peer network:
- Ethereum blockchain is a peer to peer network, all computers or nodes are connected with each other.
Nodes:
- Any device whether a computer or a mobile, connected to the blockchain containing the data are called nodes. All nodes are connected to each other.
Transactions:
- The messages exchanged on the network are called transactions. A transaction involves a value, a recipient, a sender, and a data payload.
Consensus Rules:
- The set of rules that is followed for considering the validity of a transaction and a block in Ethereum I called consensus rules. These rules are enforced by all nodes.
Consensus Algorithm:
- The consensus algorithm is the procedure to obtain agreement on the longest chain in the distributed Ethereum network. The most commonly used consensus algorithms for Ethereum are proof of work and proof of stake.
State Machine:
- Ethereum transactions and state changes are processed by the state machine called Ethereum Virtual Machine abbreviated as EVM.
- Ethereum virtual machine executes the program in machine language.
- These programs are written in a high level language such as Solidity and then a compile converts the program into bytecode.
- The program written in a high level language is called a smart contract.
So, these were some components and terminologies associated with Ethereum Blockchain. Next, I am going to introduce the cryptocurrency that Ethereum uses.
Ethereum Currency: Ether
The cryptocurrency used on the Ethereum blockchain is ether (ETH). This cryptocurrency acts as fuel for the execution of smart contracts. This currency is integral and users pay it for using the Ethereum network. The purpose of this currency is:
- Storing value.
- Allowing users to perform transactions by exchanging payments.
- Allowing payments for computational costs of code execution means each transaction executes by paying a small transaction fee.
- Running applications (Decentralized Applications).
At the time of writing this article, the currency is worth 2355.44 USD. That was some basic idea of the ether, now let’s move towards smart contracts.
Smart Contract
- A program that executes on Ethereum is called a smart contract.
- It is a set of rules or codes that control the transfer of value according to programmed conditions.
- One feature of a smart contract is immutability. Immutability means that the code of a smart contract cannot be changed after its deployment.
- Smart contracts are deterministic. The outcome of the smart contract execution is the same for anyone running it.
Before concluding this article on Ethereum introduction, I will give you an idea of Turing completeness as I mentioned earlier.
Turing Completeness
- Ethereum is a Turing complete system.
- Ethereum can read and write data to memory and execute programs in the Ethereum virtual machine.
- It can compute any program that a Turing complete machine can.
- The main difference provided by Ethereum is that it combines computing power with blockchain.
- All of the characteristic features of blockchain are combined with the programmability feature and that makes Ethereum a useful invention.
That was all for today. I hope you have got an idea about Ethereum. Next time we will move towards the interesting features of this technology and also we would talk about dApps in upcoming articles. Till then, take care!