As we have discussed, blocks are organized into a linked list structure called a blockchain, a copy of which is held in each node. Blocks are ordered ed by time, and they start from the initial element in the blockchain structure which is the genesis block. Once the genesis block is manually created, subsequent blocks are added to the blockchain through a consensus between the nodes, competing to have the network’s permission to adding new blocks. Specific consensus varies from different blockchain systems, but the overall design ensures that block may be considered a trustworthy record of events provided the network is suitably diverse.
The concept of an account is important. An account is represented by an agent and the notion of balance in the cryptocurrency associated with the blockchain of Bitcoin and Ethereum. Accounts menu receive or spend cryptocurrency with a transfer of value that forms a transaction. When you look at a cryptocurrency like Ethereum, it goes beyond containing a list of transactions. Another innovative element that we look earlier, smart contracts is which makes Ethereum unique. A smart contract is a bunch of code that is stored and executed in a blockchain.
The smart contract enables to have automated control data in the blockchain with full access functionalities. Each smart contract of Ethereum has an account to it of a special contract account type where it stores ad updates data as it creates transactions by itself. Smart contracts can serve as functions with inputs and outputs of which is written to blockchain on execution and they still go through the same verification process as other blockchain transaction.
It is important to note that blockchains are time ordered structures where data that is related is stored across multiple blocks, there is no way to identify, query or group it; this brings the concept of indexing. When you index at contracts as well as ordinary and contract created transactions, you can search and analyze the services that a distributed ledger offers, potentially exposing them to third party integration.
There are different levels of granularity that indexing occurs, these are Low level and high levels of granularity. In low level, basic entities of the distributed ledger which include the transactions and accounts and blocks are indexed.Aggregating data that is located on the blockchain requires one to locate and retrieve it. Therefore, an index is necessary in case any high-level querying is needed.
At a higher level, smart contracts have more functionality on ledger platforms like Ethereum. This makes the level useful in case one needs to discover and access smart contracts as computational services. Smart contracts can be indexed according to their applications in the real world.