Utilizing blockchain in your development
When it comes to recording information, mankind has used everything from clay tablets, to paper records, to client/server-based information systems. Unfortunately, these forms of record keeping are prone to a number of issues. For example, a clay tablet can be broken or lost, paper records can lose readability over time or be forged, and computer servers may be hacked.
On top of these issues lies a lack of transparency, which can lead to multiple sources of truth. For example, your airline ticket may indicate that you have a seat reserved, but the airline’s underlying computer server can overbook a flight leaving you stranded at the airport. So, whose source of truth is correct - your ticket, or the airline’s computer?
This is where blockchain comes in: a fully transparent, single source of digital truth that serves as a ledger for recording transactions.
In this blog, we will help you understand the basic principles of blockchain, and how it can give you an edge in developing your own innovations. Given the trends of AI and IoT, which are set to generate exponential data, Blockchain could significantly change the way data is collected and shared.
The basics of blockchain
A blockchain is a virtual ledger consisting of immutable blocks, where each block contains information about a transaction. A transaction describes information that you want to permanently record, such as the transfer of a financial asset from one person to another, tracking data from a weather station, or in the example above, a seat reservation with an airline.
A blockchain is maintained by a decentralized collection of nodes (devices) communicating over a peer-to-peer network, where each device runs a decentralized app or “Dapp”. A device can be anything from a desktop to a mobile device. The Dapps running on these devices work together to collectively maintain and verify this ledger. To accomplish this, each node in the network receives a complete copy of the entire blockchain. Then each node has the opportunity to add to it, and to reach a consensus with other nodes as to the validity of the blockchain.
With no central authority or “middle man”, the agreement on the maintenance and verification of a blockchain rests on the collective processing of the nodes working together, which is what makes a blockchain so powerful. As the entire history of the chain can be viewed by any Dapp participating in the blockchain, there is complete transparency.
A blockchain can be open, where anyone with a device and the blockchain’s Dapp can participate as a node in the blockchain’s network, or it can be permissioned based.
The immutable nature of blockchain data structure
The data structure of a blockchain is a linked list of elements called blocks, the first called the “genesis block”. Each block points to the previous block in the list. Each block must contain a hash which is generated by encrypting all of the elements of a block down into a unique ID or key. The most critical piece of information that underlies the secure nature of blockchain is that every block must include the hash of the previous block in the chain. Any tampering is easily discovered with a simple recalculation of a block’s hash as it will uncover an invalid block and chain structure. Thus, once a block has been created and added to the chain, it is said to be immutable.
Interested in starting your own blockchain?
First determine what your protocol will track (i.e., what is the purpose of your blockchain?). As a blockchain is open-ended it can track virtually anything from financial transactions, music rights, land titles, sensor data, and even airline seats.
Next you develop the protocol, including its consensus algorithm. Nodes can come and go, and as others seek to add blocks, nodes may not always have the latest copy of your blockchain. The consensus algorithm assures that nodes agree on which is the most up-to-date blockchain. In some cases, it may be important that the rate at which blocks are added is controlled.
Blockchain has the potential to drive one of the next big phases of how we use the Internet. As a developer, it represents an opportunity for you to learn and experiment with how Blockchain can help you expand the creation, analysis, and storage of data in your solutions. Qualcomm Technologies thinks that Blockchain can help developers push the boundaries of innovation, and we encourage you to bring the conversation of Blockchain to our developer forums. We are eager to hear how you may be utilizing our software and tools to help you work with Blockchain in your development.