Over a million developers have joined DZone.

Blockchains and APIs

DZone's Guide to

Blockchains and APIs

APIs fostered the connectivity that makes blockchain technology possible, and continue to help streamline blockchain in the ways you see here.

· Integration Zone ·
Free Resource

WSO2 is the only open source vendor to be named a leader in The Forrester Wave™: API Management Solutions, Q4 2018 Report. Download the report now or try out our product for free.

Blockchain technology is set to revolutionize the flow of financial transactions and the daily lives of hundreds of millions of people around the world.

A blockchain facilitates secure online transactions. It is a decentralized and distributed digital ledger that is used to record transactions across many computers so that the record cannot be altered retroactively without the alteration of all subsequent blocks and the collusion of the network. This allows the participants to verify and audit transactions inexpensively.

A blockchain database consists of two kinds of records: transactions and blocks. Blocks hold batches of valid transactions that are hashed and encoded into a tree. Each block includes the hash of the prior block in the blockchain, linking the two. Variants of this format were used previously, for example in Git. As blockchains age, they are said to grow in height.

Bitcoin, a cryptocurrency based on Blockchain technology, is based on a huge database distributed across the world and gathers all transactions. Each of these operations, encrypted and authenticated, are added to the chain of blocks, or "Blockchain." This whole process would have been impossible without APIs.

Today Blockchain has several APIs for different functionalities:

1. Receive Payments API: This provides a simple way for a company or business to begin to accept automated payments in bitcoins. The API is based on HTTP GET requests and is in charge of creating a single address for each user and for each invoice issued in each bitcoin transaction, an essential condition for good praxis.

2. Blockchain Wallet API: Since last January, to use this API, it has been necessary to install a local server to manage the virtual wallet. The communication method used is based on HTTP POST or GET calls. The process for creating a virtual wallet is known as create_wallet from this url: http://localhost:3000/api/v2/create. Each wallet is associated with a password with a minimum length of 10 characters, an authentication code for the API, a private code for each user, the folder where the wallet is created, and an e-mail address.

3. JSON RPC API: Since March 2016, the universal recommendation for Bitcoin users is to use the new Blockchain Wallet API, although the interface based on RPC calls continues to be compatible with the old Bitcoin RPC to interact with virtual currencies. It can be installed and used from libraries in numerous programming languages: syntax such as PythonRubyPHPNode.js, and .NET.    

4. Blockchain Data API: This can be used to consult the data on the transactions and operations within the blockchain in JSON format.

5. Query API: A plain text API for querying blockchain data.

6. WebSocket API: This API gives programmers access to real-time notifications on transactions and blocks.

7. Exchange Rates API: This manages the information on Bitcoin exchange rates and international currencies in real time and in JSON.

8. Charts and Statistics API.

With the Mulesoft Platform for API Management, we can build out of the box solutions utilizing blockchain APIs with faster time to market, easy API management based on SLAs and policies, and code customization to the end user's need.

The Mulesoft API-lead connectivity approach doesn't only ensure speed and agility for the business, but also helps with decoupling the orchestration services from underlying connectivity. With technology like Blockchain which is still undergoing a lot of improvements and enhancements, the agility provided by an API-lead connectivity approach will guarantee fewer code changes and contained impact due to underlying connectivity changes to Blockchain APIs. Further, this will enable faster onboarding of newer products or technologies with fewer changes or new developments (mostly only the experience APIs will change and underlying Process and System APIs can be reused).

Furthermore, the rich connector library provided by Mulesoft can enable organization for faster integration with other vendors and products, like Salesforce and other CRM solutions.

IAM is now more than a security project. It’s an enabler for an integration agile enterprise. If you’re currently evaluating an identity solution or exploring IAM, join this webinar.

api ,mulesoft ,blockchain ,integration

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}