This CorDapp comprises a demo of an IOU-like agreement that can be issued, transfered and settled confidentially. The CorDapp includes:
- An obligation state definition that records an amount of any currency payable from one party to another. The obligation state
- A contract that facilitates the verification of issuance, transfer (from one lender to another) and settlement of obligations
- Three sets of flows for issuing, transferring and settling obligations. They work with both confidential and non-confidential obligations
The CorDapp allows you to issue, transfer (from old lender to new lender) and settle (with cash) obligations. It also comes with an API and website that allows you to do all of the aforementioned things.
See https://docs.corda.net/tutorial-cordapp.html#running-the-example-cordapp.
In your favourite web browser, navigate to:
- PartyA:
http://localhost:10007
- PartyB:
http://localhost:10010
- PartyC:
http://localhost:10013
You'll see a basic page, listing all the API end-points and static web content. Click on the "obligation" link under "static web content". The dashboard shows you a number of things:
- All issued obligations to date
- A button to issue a new obligation
- A button to self issue cash (used to settle obligations)
- A refresh button
- Click on the "create IOU" button.
- Select the counterparty, enter in the currency (GBP) and the amount, 1000
- Click create IOU
- Wait for the transaction confirmation
- Click anywhere
- The UI should update to reflect the new obligation.
- Navigate to the counterparties dashboard. You should see the same obligation there. The party names show up as random public keys as they are issued confidentially. Currently the web API doesn't resolve the party names.
From the obligation borrowers UI:
- Click the issue cash button
- Enter a currency (GBP) and amount, 10000
- Click "issue cash"
- Wait for the transaction confirmation
- click anywhere
- You'll see the "Cash balances" section update
In order to complete this step the borrower node should have some cash. See the previous step how to issue cash on the borrower's node.
From the obligation borrowers UI:
- Click the "Settle" button for the obligation you previously just issued.
- Enter in a currency (GBP) and amount, 500
- Press the "settle" button
- Wait for the confirmation
- Click anywhere
- You'll see that £500 of the obligation has been paid down
- Navigate to the lenders UI, click refresh, you'll see that £500 has been paid down
This is a partial settlement. you can fully settle by sending another £500. The settlement happens via atomic DvP. The obligation is updated at the same time the cash is transfered from the borrower to the lender. Either both the obligation is updated and the cash is transferred or neither happen.
That's it!
From the lenders UI you can transfer an obligation to a new lender. The procedure is straight-forward. Just select the Party which is to be the new lender.
- Resolve party names for the web front-end.
- Replace the Corda web server with a reactive spring boot web server
Feel free to submit a PR.