# Trustlines Network: Open Protocol for Decentralized, IOU-based Currency Networks

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2018-10-07
- Duration: 18:17
- Watch: https://streameth.org/watch/yt-qOiHT6zLMBg
- YouTube: https://www.youtube.com/watch?v=qOiHT6zLMBg

## Description

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more.
https://archive.devcon.org/archive/watch/3/trustlines-network-open-protocol-for-decentralized-iou-based-currency-networks

The Trustlines Network targets the problem of fair access to money by implementing money as peer-to-peer issued IOUs on the Ethereum blockchain. We present the basics of the protocol, as well as the prototype of the mobile app, which aims to provide a seamless onboarding experience to the Ethereum ecosystem.

Speaker(s): Bernd Bohmeier, Kristoffer Nærland
Skill level: Intermediate
Track: Developer Infrastructure


Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon 3 was held in Cancún, Mexico on Nov 1 - 4, 2017
Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

## Transcript

[Music] hello everyone thank you my name is Christopher that's my colleague band we're from brain bud and we're here to present the trust lines network which is an open protocol for decentralized ru based currency networks so we broke the presentation up in two parts I will start by presenting the basic idea and the problem we're trying to solve and then band is gonna take over and he's going to super sense the technical implementation give you an overview of the system and explain how things work and where we currently are with the project so to start off with mmm think about something for crypto currencies which is truly unique concept which is this idea of permissionless decentralized payments everyday payments everyday purchases for all of us this is unique because it enables us to payments without the use of a bank account or any kind of financial intermediary to do a payment this is something which at least on a global scale we haven't actually seen before there are some problems with it which is it doesn't actually work and it's kind of kind of two really good reasons for that first of all the the issuance of these currencies are it's kind of flawed because ideally we're supposed to be able to turn on a computer and and run you know run the network and if we do that we're rewarded with cryptocurrency for validating a block we get some money and then we can go spend that at a grocery store for tokens but of course that doesn't actually work because well mining is kind of a specialist industry it requires special hardware and most people will never validate a block with their regular macbook or whatever so where it's the rest of us get crypto currencies well we buy them on exchanges and that's kind of a problem because these exchanges will they give cryptocurrencies for payments of really poor usability is that we buy them with fee at first and then we exchange them to use something every want to use for payments it's kind of a clumsy user experience it's not really good for for payments so if it were to rethink this and say let's try to create a cryptocurrency that's really good for payments ideal I would present three arguments that it should definitely have it should incentivize being spent so when I have it I should want to go spend it it should not need to be bought with fewer exchanges and it should still be interoperable with the theorem ecosystem or the cryptocurrency consistent because well that's that's what we want right we want to be able to use it with our favorite dabs or protocols we want to use it to buy years to 20 tokens whatever one of the ways we could do this is if we took money as i/o use and implemented it on social networks and we issued it in these individual trust relationships and we use these trust relationships to make payments we'd had this global payment network which is the original ripple idea from 2004 by Ryan Fuger not what ripple is doing nowadays but the original one and and it's basically these individual trust relationships which are people who know and trust each other and the issue char the credit lines and this works pretty much how it works in the real world for example if you go out to a bar and you forgot your credit card most likely one of your friends would borrow you ten dollars or let you pay you know pay for you for the rest of the night so that you could you know drink beers with him you could settle at a later point or maybe next next week you you pay so if people have these relationships already they have these credit lines what we could do is when people issue those bilaterally between two trusting friends they have them what we call a trust line and this trust line consists of credit lines and a credit limit and a balance which indicates money was spent so let's suppose Alice and Bob are good friends and they want to the Alice wants to pay Bob she spends five of her $10 credit line creating an imbalance between Alice and Bob and this IOU that Alice IOU at that Alice issues Bob is then money which was created because we have something of value which was exchanged for this I are you this is good for Bob because Bob knows and trusts Alice and has given her this credit line allowing her to spend up to the specified credit limit it's totally pointless to use money for this or cryptocurrency we don't we don't need that at all actually because people do this all the time and as I explained people do this at bars they'd only cryptocurrency or any kind of money for this this is just basically how friends work what we need money for is when we have trust problems so if Alice wants to pay Charlie she has this issue that Charlie does not care about her argue because Charlie doesn't know or trust him so she's not going to accept that I you and then if we go back to this payment network what we could do is we could or Alice could discover a path of connecting trust lines that would allow her to back the IOU with something or someone that Charlie would trust so we see there is a path of connecting trust lines between Alice and Charlie and if Alice then wants to pay Charlie what Alice does is she spends 5 or $10 credit line with Bob and then Bob spends 5 of his $10 credit line with Charlie so this solves two problems first of all it allows Charlie to receive a payment from someone that he can trust because he's dependent on the solvency of bob and not of alice so that's good for him it also allows Alice to pay a stranger because she can now send a payment to anyone so long as it is backed by someone who trusts that person of course this only really works if Bob is actually willing to do this but for Bob this is not really a problem because his net balance remains unchanged so he still has $20 he can spend I mean he has $15 in one trust line five plus $10 credit line and he has five remaining in the other trust line there's a little bit of a thing missing there which is of course at some point in time Bob might his trust line might run out it might be there might not be a capacity left in the trust line and that leaves him with two options either he has to settle or he has to ask Charlie to increase the capacity of the trust like giving giving giving him a larger credit line neither option is really that nice it's kind of awkward but this is a quite powerful feature of the idea is that we can mostly avoid settling so when we have many users on the same network we have money which flows in many directions sometimes you're getting paid sometimes you are paying sometimes you're forwarding payments in different directions and this social approach to money helps money circulate meaning that that cancels out over time and so for most scenarios real-world settlements are unnecessary and as you can see here what I've tried to do is illustrate how they've making a payment to Bob cancels out the debt that Alice had the charge or that Bob had with Charlie from Alice's payment so that's basically the basic idea that's how money implemented the social graph could work now the next question would be how we access such a system and the way that we would do that is by having an accessibility system which is a little bit superior to buying money on an exchange so you simply just download the app you joined by creating a trust line with a friend and then you can start sending and receiving payments that's basically it so compared to first join in exchange wiring money this is a little bit faster the money that we could use to page other ways is issued on smart contracts and we call them currency networks these courage networks are highly customizable they can be denominated in to virtually anything that people find valuable beers Bitcoin money gold enchiladas whatever is people like they can they can trade and to reflect the denomination they can also use these they can customize the currency networks such that it reflects the denomination they can have user groups be open or closed so for example the euro token network might be more open than a local economy who wishes to control exactly who can issue different trust lines so they may hide they might have a permission approach to it we can also customize rules on interest and the specific value of credit lines now the final piece of the puzzle is of course how can we buy 20 tokens or F and we can use this because every the mobile payment app also comes with a wallet which can hold a theorem or 20 tokens so if Alice wants to buy some F and she has been on boarded to the trust lines network and Dave wants to sell some and they don't know or trust each other what Dave can do is he can list some F on a decentralized exchange and if Alice likes that offer she can take it and if there's a path with sufficient capacity the decentralized exchange will swap the f-4 trust line money so Dave will now have more credit in the currency network that they're both participating in and Alice will now have F in her wallet address so what that solves is the dependency we have on centralized exchanges because we can provide accessibility to cryptocurrencies without the use of fiat money it removes the requirement to have a bank account which I personally think is quite important because we can also provide cryptocurrency and to centralize financial services for people who might not have a bank account to begin with and finally it also allows us to purchase earth with transplant money without having to interact with any data so the basic idea is you should be able to get access to cryptocurrency by joining creating a trust line with a friend and then have access to the holy theorem ecosystem so that's the basic idea and yeah give this to you hi my name is bond I'm one of the developers behind trusted hi my name is band I'm one of the developers behind trust lines so the architecture of the trust x network will be is a three tier architecture on the core of it we have the smartphone checked handle all the logic especially the currency networks and exchanges and as the user interface we are developing a mobile app that comes with a good user experience this is also where the private key will be and which will sign the transactions to actually do transactions within the trust lines network in between we have a middle layer that we call the relay service they are helper services for example for the pathfinding I will talk about them later today I don't want to talk about the mobile app I want to focus on the platform itself so we'll talk first about the smart contract and after that so the currency currency network contract managers all the trust lines within one currency networks that means it keeps tracks of the balances between two friends and it keeps track of the credit limits of these two friends that gave it that they gave each other it has a logic to execute mediated transfers that means it's when you do a transfer within the system it will update all the balance currently and make sure that they will stay within the given credit limits we want to implement implement existing token standards however this will not be fully possible because they are different because our currency network is iru based so that means there will be differences for example the balance of a user can be negative and the transfer within our our system needs another parameter it means the the path over which the transfer should happen so we aiming to for developing a new standard for IU based 20 networks next I want to talk about the decentralized exchange contract so the trust lands network should be a will be a platform to host multiple currency networks so one challenge we need to solve there is how do we want to connect how can we connect these networks and how can we bridge gaps because if you want to do a transfer and there's either no connection or a too long connection especially the beginning we want to get this so the decentralized exchange contract can help us to solve that because it allows to buy a quadrilateral token on in exchange for example with Justin's money and this is can then be used to close gaps and to make cross currency payments let's look at the following example to see how this could work so if Alice wants to pay Dave in u.s. dollar but she's only part of the yeren Network she can make a transaction within the euro Network to buy eath on an exchange this earth can then be used to to buy US dollar on another exchange in the u.s. dollar network for LS and Dave this will be all transparent it will be just one atomic transaction and this is how Alice can do a cross currency payment to Dave so let's now talk about this middle layer I presented before so why do we even need this relay service so as we learnt for payment we need to find a valid path and preferably we want to find the shortest one because that is the one that will save gas because we don't have to update so many trust lines but it's not feasible to do this calculation for the path on the phone because the you have limited memory on your phone and it's not feasible to do it unchanged just because the computation is too expensive so relay service essentially just help a service to calculate this path and in our current set up will be used as a gateway to the blockchain however this could it could be changed later by using light clients introducing this relates others however create a different kind of problem because we no longer can enforce by the smart contracts with path which path will be choosen right so the only thing that the smart contacts checks is that the path is valid so that all the balances stay within the credit lines but we cannot enforce which path this is important because there's flex on one property that we wants to have another system we want to balance out and cancel depth so to incentivize this behavior we aim but this is who currently this is going to work in progress we're not really like done with this we aim for like implementing a fee and reward system to incentivize this balancing out so there will be one fee that we call the in balanced view reward this is to be paid by users adding imbalances to the system and it gets water to the one decreasing the imbalance there's another fear award system for capacity that we also want to include that it's just to incentivize providing capacity and this is basically paid by the one using the capacity to root of rent transfer and gets rewarded to the one providing the capacity yeah there are also mandatory fees that we will have and that obviously the gas fees for the etherium system and there will be probably related server fees because we had need to incentivize running dedicated relay service by third parties yeah so how would how does it affect now the pathfinding algorithm and the pathfinding will obviously look for subsystems capacity and the shortest paths to safe gas but now with the new fees it will also aim for minimizing the edit imbalance or it will cancel out depth so let's look at this for example if Dave wants to pay Bob and their to say a path with the same length one and one over Charlie we can see here that the upper path is worse because it will add it will increase the already existing imbalances where the lower path will cancel out depth so will actually not increase the overall imbalances within the system so if we add those fees the lower one will be slightly cheaper so therefore we'll hopefully choose this path so that was it about what I wanted to present working on our current project status right now is we have a working prototype on the on the robson test net it already we already have implemented the currency network with mediated transfers direct transfers and you can give each other credit lines we are currently working on new features we working on implementing that just the fees I just mentioned we are working on implementing the decentralize exchanges and other features I didn't talk about yet yet we are also working on the mobile app you can you can watch our progress on our github repository and if you want to know more about the general idea we have a white paper on our website you can also check that out I want to emphasize that we aim to create an open protocol so we're working on open API s you can also check that out on our repository for the earliest service we aim for a restful api and we want to implement we want to develop Java Script library that makes it easy to to also develop third-party mobile apps besides the one we will actually build and we also want to aim that it will be easy to use our mobile app but also a third-party mobile apps together with each other so make payments from one app to the other yeah so let me summarize that we at promote technology work on an open protocol for decentralized I use base currency networks this will enable global payments based on a network of already existing individual trust relationships we think it's an old but powerful idea that can increase adoption of cryptocurrencies and made it easier to access for everyone thanks everybody and if you have questions or if we want to talk about the idea please feel free to approach us [Applause] [Music]
