Ethereum Financial Blockchain Applications with Java Programming Language

in #blockchain5 years ago

  Ethereum is a general-purpose blockchain that is more suited to describing business logic, through advanced scripts, also known as smart contracts. Ethereum was designed with a broader vision, as a decentralized or world computer that attempts to marry the power of the blockchain, as a trust machine, with a Turing-complete contract engine. Although Ethereum borrows many ideas that were initially introduced by bitcoin, there are many divergences between the two. 

The Ethereum virtual machine and smart contracts are key elements of Ethereum, and constitute its main attraction. In Ethereum, smart contracts represent a piece of code written in a high-level language (Solidity, LLL, Viper) and stored as bytecode in the blockchain, in order to run reliably in a stack-based virtual machine (Ethereum Virtual Machine), in each node, once invoked. The interactions with smart contract functions happen through transactions on the blockchain network, with their payloads being executed in the Ethereum virtual machine, and the shared blockchain state being updated accordingly. 

If you are not familiar with blockchain technology reading History and Evolution of Blockchain Technology from Bitcoin article is highly recommended.    If you like to learn more Ethereum blockchain development (with Solidity programming), Blockchain Developer Guide- Introduction to Ethereum Blockchain Development with DApps and Ethereum VM, Harness the Power of Distributed Storage IPFS and Swarm in Ethereum Blockchain Applications, and Building Enterprise Blockchain-as-a-Service Applications Using Ethereum and Quorum are highly recommended.  

In this article, we will break into finance and introduce a financial project that can be managed by a futures smart contract using Java (SE).      

Project presentation

I know you're a developer and not a financial nerd. Hence, I will try to introduce the futures concept in the easiest terms. Futures contracts (more colloquially, futures) are legal agreements to buy or sell a given quantity of commodity or asset (barrel of oil, gold, and silver) at a predetermined price at a specified time in the future, hence the name futures.   For the sake of ease and clarity, let's consider an oversimplified version of a real futures contract from the financial industry. Let's suppose that an airline company wants to lock in the fuel price to manage their exposure to risk and to avoid any unpleasant surprises.


Instead of buying the oil and storing it until they need it, they buy a futures contract for oil with a specific date of delivery and price per gallon. For example, an airline company can agree on a futures contract to buy 1,000,000 gallons of fuel, taking delivery 60 days in the future, at a price of $3 per gallon.   In this example, the airline company is considered as hedger while the seller might be considered as a speculator. As the futures contracts may become more valuable if the price goes up, the owner of that contract could sell that contract for more to someone else. That said, we will build a smart contract that implements the logic described here and defines the futures contract's details (asset, quantity, unitary price, and delivery date) along with holding the funds. We will also build a Java application enabling a third party (exchange market authority) to define a futures contract between the other two parties.   The smart contract will also enable the speculator to sell the futures contract to another speculator and calculate its investment offset by comparing the market price to the futures contract price. This will be a straightforward contract with only a few main abilities and minimalist design.

 After this article, we move on to full implementation of futures smart contracts for our financial project while demonstrating how Ethereum technologies can improve the efficiency of the future contract processes.    Building Ethereum Financial Applications With Java And Web3j Api Through Blockchain Oracles tutorial will deepen our knowledge of Ethereum and introduce several advanced tools, while also showing you how to develop and manage scalable, highly interoperable business solutions using Java programming language. It covers the following main topics:

 · Building futures solidity contract 

 · Introducing oracles 

· Introducing the web3j API
 

After finishing the tutorial, you learn how building a futures smart contract will help you to understand the disruptive force of the blockchain and how smart contracts can alter the financial industry (for example, futures trading market) by automating payments and facilitating business processes.
If you like to explore blockchain development with an alternative platform like Hyperledger or learn about the projects of Hyperledger like Sawtooth or Iroha, visit Comprehensive Hyperledger Training Tutorials page to get the outline of our Hyperledger articles.  


 About Authors
This article is written by Matt Zand (founder of High School Technology Services) in collaboration with Brian Wu who is a senior Blockchain consultant at DC Web Makers.   

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.034
BTC 66137.63
ETH 3161.38
USDT 1.00
SBD 4.13