1. How the Royal Bank of Scotland is approaching research and innovation
2. What we have looked at in the distributed ledger space
3. Example: Building a digital wallet on the Hyperledger Fabric
4. What we've learnt about Hyperledger and other DLs
5. The challenges we face as a bank and as blockchain developers
6. Thoughts for the future
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Banking on a Blockchain
1. Banking on a Blockchain
Mark Simpson, Distinguished Engineer
Innovation Engineering @ RBS
2. Key points:
How RBS is approaching Research and Innovation
What we have looked at in the distributed ledger space
Example - building a digital wallet on Hyperledger Fabric
What we’ve learnt about Hyperledger and other DLs.
The challenges we face as a bank and as blockchain
developers
Some thoughts for the future
3. What is a code spike?
Identity a disruptive technology
Find a specific use case
Find some experienced engineers and give them four days
Build an MVP or fail fast
6. Requirements for building a
digital wallet
Move money from ‘real’ account to wallet
Make multiple transfers between accounts in wallet
Make payments out of the wallet to payment systems
Query wallet balances
Detect transaction errors
Query history of transactions
Obfuscate fields in transactions for certain users
7. Where to start?
use the example !!
https://github.com/hyperledger/fabric/tree/master/exa
mples/chaincode/chaintool/example02/src/chaincode
8. Extending the contract for multiple
transfers - complex types!
go - chain code
type Transfer struct {
From string `json:"from"`
To string `json:"to"`
Amount float64 `json:"amount"`
}
type DigitalWalletBlockChainTransaction struct {
Transfers []Transfer `json:"transfers"`
RequestedAt string `json:"requestedAt"`
Reference string `json:"reference"`
Description string `json:"description"`
Action string `json:"action"` // "action": "deposit | reserve | unreserve",
Notes []string `json:"notes"` // "for reserve, the from is 'userid ' and to is 'userid-reserve'",
}
9. We can easily send complex types into
the fabric from javascript
//Build the payload
var transferPayload ={ "transfers":[
{"from": "billy", "to": "greg", "amount": 1000.0 },
{"from": "billy", "to": "mark", "amount": 1000.0 }
],
"requestedAt": "2016-01-03T10:00:00.000Z",
"reference": "dispersals",
"description": “billy sends greg and mark some cash",
"action": "transfer",
"notes" : [“enables rollback of whole transaction on fail" ]
};
//Function to call it
function transfer(transferpayload){
var request = require('request');
request({
url: blockchainServer+'/devops/invoke', //URL to hit
method: 'POST',
json: {
"chaincodeSpec":{ "type": "GOLANG", "chaincodeID":{ "name":chainCodeStatic,
},
"ctorMsg": {
"function":"transfer",
"args":[transferpayload]
}
etc….
10. Querying account balance is then quite
easy
function queryit(account){
var request = require('request');
//Lets configure and request
request({
url: blockchainServer+'/devops/query', //URL to hit
method: 'POST',
//Lets post the following key/values as form
json: {
"chaincodeSpec":{
"type": "GOLANG",
"chaincodeID":{
"name":chainCodeStatic,
},
"ctorMsg": {
"function":"query",
"args":[account]
}
}
}
11. What about Errors ??
You get an error if you send a bad payload or call an
invalid chaincode
(back in February) Errors did not propagate out of chain
code even if you returned an error. There was no error
code on the transaction in the block
But, state is rolled back if your chain code returns error.
You can now detect transaction errors using the following
code:
https://github.com/hyperledger/fabric/tree/master/example
s/events/block-listener
12. How did we do against
our requirements?
Move ‘money’ from real account to wallet √
Make multiple transfers between accounts in wallet √
Make payments out of the wallet to payment systems √
Query wallet balances √
Detect transaction errors √ (nearly)
Query history of transactions X
Obfuscate some fields in transactions from certain users X
13. Transaction history - single version
of the truth ?
https://github.com/hyperledger/fabric/wiki/Next-
Ledger-Architecture-Proposal#pointintime
14. What did we learn?
Writing and calling contracts is straight forward.
Asynchronicity is a challenge.
Maintaining a single version of the truth is a battle.
Tooling is work in progress.
Devops - interesting….
16. Working with R3
‘ There is only so much fun you can have
with blockchain on your own’ - Richard
Crook - head of innovation Engineering.
We are active members of the R3 group.
R3 gives us the ability to openly collaborate
with other banks under non disclosure
agreements.
17. key challenges
collaborating with each other
security - data at rest
scalability
bad press / building understanding
contract safety
integrating ‘safely’ with the existing banking systems
(http://bankofapis.com)
managing change
usability / consumerability
18. Some thoughts for the
future
When will we see banks use ledgers in production?
Will contracts be used as legal language?
How de-centralised could the banking system
become?
Why don’t google, facebook, amazon appear to be
interested in blockchain?
Does blockchain give people the opportunity to secure
their own personal data?
Could a blockchain be run entirely on mobile devices?