Test how to execute BTC/USD Forward contract on R3 Corda

Inspired by this Commerzbank Conducts €500k FX Transaction Using R3’s Corda news, I decided to test a BTC/USD forward contract execution on R3’s Corda.


What is a Forward Contract?

Investopedia

For example, a property development company FinCo just signed a lot of contracts to sell their highly demanded new builds, and they are willing to accept bitcoin, but the customers only need to transfer the amount in 6 months time. Same time after 6 months, FinCo also will have an outgoing payment of US dollars to their material supplier in the States, and worried about the BTC/USD rate could go down in the future, FinCo struck a deal with FabBank for a forward contract, fixed an exchange rate between BTC and USD in 6 months. Therefore, in the settlement of the contract, FinCo can use the bitcoin received from the customer to pay FabBank, and pay their supplier the dollars received from FabBank with the locked BTC/USD rate, avoiding the future BTC/USD exchange rate risk.


What is Corda?

Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda’s smart contract technology allows businesses to transact directly, with value.


How to run the test

runnodes will start up 3 nodes, one Notary node, one FinCo node and one FabBank node. Because there is no REST server for Notary, only one console window popped out for it. Both FinCo and FabBank will have two consoles windows popped out, one for the node itself and another is for the REST server. So you will have 5 console windows altogether.

After the 5 processes started successfully, you can import the FXForward-Cordapp.postman_collection.json file under the project’s postman folder into your Postman.

Under the FXForward-Cordapp postman folder, there are 12 GET requests, execute them one by one from the top to the bottom, you will have the whole process of issuing tokens, issuing forward contract and settling the contract.

Note

As a demo test version, the source code is not fully tested and not in production level of quality. So do not use it in production system.