Let's code debt! Basic Loan smart contract implementation - by Leonid Logvinov (MakerDAO)
ETH Warsaw·Thu, Oct 7, 2021, 12:00 AM
👨🏫 Leon Logvinov, Full Stack Engineer at Maker Foundation gives an intro to coding debt on Ethereum during #0xPoland meetup. Agenda: 3:44 Intro to Ethereum 4:20 Classic contracts vs smart contracts 8:12 ERC20 tokens 11:28 Debt as the simplest contract 13:46 Step by step BasicLoan contract implementation in Solidity 20:36 BasicLoan properties 21:21 Designing a lening pool 23:51 Intro to DeFi 26:22 MakerDao & DAI 29:00 Q&A 0xPoland is an initiative to build an active community of blockchain developers. If you want to improve your coding skills, make sure to join our monthly meetups, workshops and a hackathon in May 2020! ➡️Sign up for our events here: https://www.meetup.com/0xpoland ➡️Follow us on Twiiter: https://twitter.com/0xpoland
Transcript
uh hey my name is leah and i'm working as the full stock engineer at the maker foundation here at warsaw and today at this presentation we're gonna code that and look at that as the basic building block of finance let's start with the boring stuff the disclaimer all the information presented here is for educational and informational purposes only all views are mine the code presented has not been audited do not use with any real value no content of this presentation should be introverted as legal advice i'm not a lawyer and a lot of topics presented are severely simplified this is not an investment advice either after that for an intro let's go to the agenda and see what awaits us today so first we're gonna start with why should i care so what can we build with that why do we need those complex and weird primitives second we're gonna talk about ethereum and what is it and what does it make possible and then we're going to go into the differences between the classic contracts and the smart contracts and we're going to compare them across different fields and points of view we're going to talk about the erc20 tokens which is the standard for representing value on ethereum and for interoperability of value then we're gonna look at debt as the simplest contract in the classical understanding the legal understanding and see what that essential is then we're gonna look at that from the smart contract perspective and think how can we represent that on the blockchain after that we're gonna start coding our basic smart contract that's gonna represent that alone and we're gonna go step by step and implement this contract so that it's fully functional at the end we can analyze the properties of this contract and we're gonna think of how can we extend the system and how can we build more usable systems on top of the primitives that we've just built in this presentation after that they're going to be a small introduction to d5 and talk about maker dao and dye as you see some of the topics covered topics covered in the previous presentations but we're going to go deeper here and we're gonna touch the actual code and build on top of the ideas presented by mark in the previous presentation so without further ado let's jump in so why should i care like what can i build with that and what's the problem here so using the concept described today different faults have built decentralized lending borrowing protocols that allow everyone to land borrow at the competitive rates and low margins not only that they've built a lot of different products but that's what we're gonna focus on today and the current trades on the usdc and usdc is this token that represents us dollar around 128 and 175 percent and we see that this is pretty close there is some margin in the middle because it's more expensive to borrow than to land uh but at the same time uh banks give us much worse of a margin so for example in my bank i get 0.1 on usd for landing and none for boring because there are no credit products available for me right now that are allows me to borrow usd only the police office which is close to 8 to 10 and also there are no products available right now that allow me to borrow with just the collateral and no income verification this is like a completely different type of financial product and currently this is reserved for private banking clients but we will build a technical prototype ourselves today and it will be available to anyone in the world not just the private banking clients in the developed countries so just remember this is just to showcase the technical possibilities and illegal financial or business aspects around the scope so ethereum ethereum is currently the biggest smart contracts platform and allows anyone to deploy and interact with smart contracts the smart contract is basically just a piece of computer code running on the blockchain that can manipulate its state it is immutable verifiable auditable deterministic and it's running on the turin complete virtual machine and ethereum allows us to run this virtual machine on the blockchain so how does the smart contracts differ from the classical contracts and how can we compare them so when we look at the paper contracts and smart contracts we can compare them on different fields of comparison let's start with the logic smart contracts use boolean logic it's either true or false there are no shades of gray and there's always certainty in the paper contract there's always room for interpretation did something happen or did it not or what did they mean by using these weightly formulated words uh this has its pros and cons predictability so paper contract is very flexible because it was designed to describe the human interactions and smart contracts are very rigid even in case of bugs because they were designed to be that way and this is their benefit but it's also a con dispute resolution so when something goes wrong what happens with smart contracts is code is law and things go as they were coded and there is no dispute resolution like if you've made a mistake this is your problem in the classical world we have a well-established dispute resolution uh procedures you can go to court and you can argue that you've made a mistake you can revert the contract which you can do with smart contracts but there are some people working on some dispute resolution protocols and you can build dispute resolution on top of the system you can think of that in terms of soft promises versus hard promises so paper contracts give you soft promises and if you want to harden those promises you cannot do that but smart contracts give you hard promises out of the box but then you can build soft promises on top of that trust in the paper contract world trust is required but not a given but in the smart contract world trust is mathematically built in into the system and you don't need to trust the party with whom you contract because you know that here is the code and it will be executed like it's written there is one important point here that smart contract and regular contracts can be actually combined smart contract can be part of the regular contract and smart contract can allow you to execute some operations uh in an automated way so those are not completely separate things they can intersect in some cases [Music] let's look at a smart contract like what it is essentially every uh not smart contract the classical contract every classical contract is a set of obligations called contractual obligations so if x then bob is obliged to do y if bob fails to do y for whatever reason alice can take legal action and the state can make bob do y so this is the basic schema of what the contract in the legal understanding is when we look at the smart contract it's completely different smart contract is a set of computer instructions and conditions that change the state of the system if x then 10 units of bob's balance are transferred to alex note that bob is not obliged to transfer and cannot prevent it from happening other than somehow making sure that x is false so this balance is just transferred on demand of bob where where in the first case bob was obliged to do that and bob could just deny to do that and that will delay the process by a lot here's a 20 tokens uh so in order to do something useful on the blockchain we need some standards so that we can understand each other standards introduce interoperability and one of those basic standards on the ethereum blockchain that is very popular and useful is erc20 tokens um erc20 token is basically a contract that implements the provided interface uh don't be afraid now we'll go through each line line by line and i'll explain what doesn't this interface mean so whenever the contract implements this interface we can call it an erc20 token and then we can operate on it as a token and there is a lot of different tools that can understand the standard and make use of the standard uh our contracts that we will code today will also base on the standard and that's why we're talking about it right now so the first function is total supply which basically returns the amount of tokens in circulation the second one returns the balance of the account nothing complex here the third one allows us to transfer tokens uh to some address so from me to you i call this function that's why there is no argument for me because the blockchain knows who called the function so there is an argument for the recipient and for the amount of token being transferred and then there is also an allowance mechanism or approval mechanism and to understand that we need to understand why is it here and why do we need it so we have our tokens and we can spend them that's cool but we want to use them in the more complex scenarios we want to code systems of smart contracts that operate with those tokens on our behalf when we allow that to happen so that's why we want to approve the smart contracts and give them the allowance so that those smart contracts can spend our tokens uh this will allow a lot of different use cases one of the use cases will be described today but for now we'll just remember that the approve function approves someone to spend some amount of my tokens and in case this someone in the smart con is the smart contract we can read the code of the smart contract and understand exactly the situations when they will spend my tokens so my tokens will be secure because there are some preconditions before they can spend them and the second function allows them to spend them uh oh no the second function actually checks the allowance it's the getter and they can also not spend more than the allowance i've given them so even if something goes wrong i don't lose all of my money but i can lose up to this amount so this limit the risk the third function allows someone else to execute the transfer on our behalf so if i've given them allowance they can call this transfer from function just similar to the transfer function but the caller is actually not the owner of the token but the operator so-called of the token so now that we understand the erc20 tokens we can looked at that as the simplest contract in the legal system because that is just one obligation um here we have the most basic contract uh obviously don't recommend using it but this is the structure of the most basic debt contract you have two parties you have the lender and you have the borrower which are contracting together you have date uh you have the loan amount and you have the date by which the loan should be repaid and the repay amount which is usually more than the loan amount because you need to pay to loan the money this is the fee and there are the signatures of the lender and the borrower that they agree to that so this is the basic structure and assuming that alice transferred the funds to bob upon signing this defines just a single obligation for bob to repay the debt on time if bob fails to pay back his loan alice can sue bob and upon winning ask the government to seize bulb assets so we see how it works here they agree and then bob has an obligation to transfer and if he fails then the only thing alice can do is go to court but then that as a smart contract uh should be different because uh in smart contract world we don't have cores and we cannot just seize real world assets so we need to think how to be secure without relying on courts how to be secure with relying on the blockchain and the mechanisms that it gives us so we need to have collateral to protect against damages because uh let's look at this contract before what happens if bob doesn't pay his loan on time then alice is owed 105 usd and if bob doesn't date this is alice's damage like she just lost 105 usds but if we have collateral we can protect against that uh hopefully or not hopefully but our damages are limited in the case of the dark smart contract because the maximum amount that alice is owed uh is 105 usd because as soon as the loan is due she can get back her 105 usd from the collateral uh in the real world it's not like that because if bob doesn't pay on his obligation then there are some fees on top of that so the damages are not limited but in our smart contract world all is good um let's go into the actual code and start to implement the basic loan and solidity and see how we can implement the basic building block of the finance manually debt on the blockchain we'll start with the empty smart contract called basic loan uh and then we describe the terms of our loan this is the structure where we store the data about the terms so there is a loan amount loan die amount is because we will be using the tie token for that and diet token is soft packed to usd so basically this loan will be in usd and we will be using ethereum as the collateral and as we've talked before about the ethereum ethereum is the native token of the ethereum blockchain and also has its value so someone will be blending dye and putting if as the collateral so we have loan die amount fee die amount each collateral amount and repay by timestamp and we store a structure in our storage on the blockchain to access it later we also need the enum for the loan state because there are different operations you can do on this loan you can fund it you can liquidate it you can repay it and some of those operations are allowed only in some states and not allowed in other states so we need to track uh which state are we currently in and for that we declare this inun we see that there are uh five states actually created funded taken rebate and liquidated but in the last two states the contract will be destroyed and that's why we don't describe those states here the next step is the modifier the modifier is similar to a middleware it is this function that can be executed before the other function and can check some preconditions this is the simplest modifier and it just checks that we are in the expected state and throws otherwise some other state variables that will be useful for us is the elandra address the borrower address and the address die being this token that represents the us dollar so in the contractor a constructor uh the one who deploys the contract passes the terms and the die address and we record all of that in our storage to use later we also record the message center as the lender and set the loan state the initial state to create it let's look at the first function the first function will be used to fund the loan it will pull the funds from the lender it will pull the diet tokens from the lender and lock them into con into the contract and those funds will be available to borrow later so this function will be executed only in the state loan created because we cannot lo we cannot fund this contract twice we shouldn't be able to and we set the state to fund it and we pull the tokens using this transfer from function that we described before in the erc20 standard from the message sender to this address and we pull exactly this amount of die here it's important to understand what happens in the blockchain if there is an error so if there is an error the transaction gets reverted and all the state changes that happened before also get reverted so it's very secure approach and a very rigid approach but it allows us to not uh care about state cleanups and things like that so here for example what happens if the lander does not have enough dye if loan diamond is more than the lander's balance then transfer from function will just fail and our state will be reverted so the lander later can get more die and try this function one more time second function is take a loan and accept loan terms it's only in the funded state and we first checked that there is enough collateral sent to this function because when we call this function we send ether to it as the collateral and this ether gets locked into the smart contract and we throw if there is not enough ether record the borrower record the state and actually transfer the diet tokens to the borrower therefore granting the loan third function is the function that's used to repay this loan uh so whenever we can repay this loan uh we check that the message center is the borrower uh why do we need this check we need this check uh because in the real world anyone if anyone repays your loan you're good with that like why would they but it's good for you here when they repay they get the collateral back and you don't want that and that's why we checked that the borrower is the message center because the collateral amount should be actually more than the loan amount um and when we check that we send the diet tokens from the borrower uh to the lender including the fee and again this will fail if there is not sufficient diet tokens at the end we call self-destruct on the borrower address and self-destruct will release all the collateral it will transfer old ether uh back the borrower um liquidating the loan so this function is uh called by the lander to liquidate whenever the loan is not paid and we don't need to sue anyone or do anything complex we just call this function and the whole collateral is put back to the lander so the lander doesn't lose any money so we see here side by side uh this classic contract and the smart contract obviously the smart contract is more complex but it's still 50 lines of code so nothing critical but it executes automatically and there is absolutely no trust requirement here and no court system no requirement so you can use this contract to borrow from someone from across the globe you don't even need to know them you just need them to accept this contract and interact with them and if they don't pay back the loan you just liquidate their collateral so that's the beauty of the smart contracts let's look at the properties of the contract that we just coded so it has fixed rate i mean interest rate uh there's basically no interest there it is just the fee the provision for granting this loan it has a fixed term because we have the fixed timestamp it is over collateralized because in order for it to work we need a more collateral than the loan amount otherwise if someone doesn't repay the loan then the collateral will not help us uh has the single lander and the single borrower and the borrower needs to be known beforehand but he doesn't need to be trusted this is interesting but we need to go deeper we need to build something more useful more real world this was just the demonstration of the power of the smart contracts so let's design something called a landing pole a landing pool is the system of smart contracts where you can borrow to the system and land from the system and you can borrow and land at any time and any amount assuming there is enough liquidity and landers don't need to know borrowers and they don't need to trust them it would be nice for landers to always be able to withdraw but given such a guarantee means that nothing can ever be landed for any amount of time so we will slightly relax this guarantee to build a practical system a landing pool is actually similar to a bank but you can go to a bank and borrow money and you can go to a bank and deposit money and some other clients do the same but you don't need to know them for you it's just a useful financial institution and something similar can be built on the blockchain so let's think how can we build it with the knowledge that we already have the mechanism that we will use here is different interest rates basically the same as banks use and we define something called the target utilization ratio let's say at 80 percent and our system has some assets in it and let's say that the target for our system is that 80 percent of acid on average are borrowed and the other just stay there as the reserve and whenever this target collateral utilization ratio goes up our interest rates also go up and that means that it's more expensive to borrow so people who borrowed before will start to return their loans and repay them which will bring the utilization ratio down and the other way around on the other side of this curve if not enough people borrow then it becomes cheaper to borrow and it incentivizes people to borrow so there will be always this balance in the system and even in the case if there is not enough reserves for some huge lender to withdraw the funds that he wants to withdraw uh he can always wait because he is getting a huge interest rate on this funds in this situation and that is the relaxation of this constraint mentioned before that we're going for in this system so this is uh one of the most popular products in the d5 basically right now people are just blending and borrowing money between each other and what is d5 so d5 generally refers to the digital assets and financial smart contracts protocols and decentralized applications built on ethereum in simpler terms it's financial software built on the blockchain that can be pieced together like money leaders so you can combine those contracts together you see how before we talked about the token standard and then we built alone on top of the token standard and then we build this money market on top of the loan concept and the collateralization concept in the d file you can combine protocols like that together to build new more interesting protocols here are some examples of the products that either exist or can potentially be built on the blockchain you can build multiple types of loans over collateralized under collateralized uh different terms whatever you code it's that you're in complete programming language whatever you can imagine when you can build loans you can build leverage for trading so you can short some tokens and you can long some tokens you can build exchange traded funds you can pull some assets into the baskets and trade them together you can build trust funds because you can add any constraints on how the money can be spent and how the assets are managed you can build lotteries for people to gamble you can build no lost lotteries no lost lotteries is basically where people pull the funds together and they get some interest and the price that they get in the lottery is this interest from all the funds pulled together but they get back the ticket every time and this is an interesting concept that is implemented on the blockchain and you can try it you can build option contracts options are those financial instruments uh used in the markets that allow you to have an option to buy some asset uh at some price in the future and with the smart contracts you can build something like that and you can also build prediction markets prediction markets is a concept that allows you to bet on the outcome of some real life events [Music] maybe this is a lot of information to handle but i'm just leaving it here right now so later you can google and explore the uses of smart contract that interest you so die and maker dao maker dao is a centralized organization dedicated to bringing financial stability and transparency to the world economy maker dao enables the generation of dai the world's first unbiased currency and leading the centralized stable coin dime mitigates volatility through the autonomous system of smart contracts called the maker protocol as well as through the centralized community governance as dye is backed by a surplus of corrotorial that has been individually locked into an audited and publicly viewable ethereum smart contract anyone with an internet connection can monitor the health of the system anytime at dye stats and why is it important it is important because as soon as we have the dollar on the blockchain all those financial applications become interesting and become usable because if someone can loan bitcoin using ethereum as the collateral that's funny but that's not useful and no one will actually lock a lot of value into that because there is a lot of volatility and die is this most basic building block that allows to build actual financial systems and actual financial applications on top of the blockchain so let's go back and see what we went through today and what we discussed and sum up so first we talk about what can be built on the blockchain on the ethereum and why should i care then we talked about the ethereum and the differences between the smart contracts and the classical contracts we described the erc20 standard we looked at debt uh as the single obligation contract the most basic classical contract then we looked at that and how we can implement it as the smart contract then we've done this implementation in solidity step by step analyze the properties of the contract that we came up with talked about the concept of the money market and how we can implement something like that using smart contracts talked about defy and die uh thank you for your attention today and i'll now go to the questions and we'll be happy to answer your questions for some questions it took solely 20 minutes for to ask questions and uh in the comments after my presentation so i was trying to answer all of them in the comments as well so let's spend a couple minutes we can iterate through some of the questions one of the question was why solidity not using already existing language loan would you like to explain a little bit yes this is the question that comes up a lot and the short answer is because the platform is so different and the constraints on the platform is so different solidity is similar to other programming languages in terms of syntax like when you look at the code you basically understand what happens there it's similar to c class or java or javascript or whatever you're used to but the concept underlying the language are different and they're very blockchain specific and in the computer world whenever a wholly new platform comes up there is a new programming language so for example why javascript for the web when we had all the other languages before because the browser is so different and they're trying now to do web assembly and dark and all the other stuff but it doesn't work that good slowly obviously has its pros and cons but they needed a language that is suitable for the blockchain and blockchain has a lot of constraints like gas or the storage model because the storage is very different from what we see in the classical computing yeah uh i think it's a great answer and i actually yeah so we have actually questions about loan presentation first too long can you see well sorry how can we be sure that we get our tokens back when we borrow them so we can be sure that we get our tokens back but we can be sure that we will not lose money as long as collateral's value is more than the value of the tokens so therefore we're talking about the collateral so for example if you're borrowing 100 usd and given 150 usd as the collateral and then you can't return this hundred usd then your call collateral gets liquidated so the lender gets 150 usd instead of the 100 that he borrowed so he's happy you're not happy but you defaulted on your obligation so there is obviously this trade-off between the amount of the collateral so the more collateral you put the more secure is the loan but also then like you need to have more collateral which is a downside uh before we uh uh answer the next question i want to say i just look at statistics on facebook and we have almost 200 people who are watching today so thank you very much and we can go to the next questions are there any other than ethereum defy friendly blockchains there are some competitors at different stages i think ethereum is definitely the most popular and the most user-friendly and developer friendly right now and it's number one by the volume by the transaction amount by the fees but there are some other like ethereum killers uh and they have a lot of interesting ideas and it's interesting to watch them and maybe at some point uh they will take over ethereum maybe not we'll see yeah it's difficult to predict as of today ethereum is by far the most active uh wifi and uh developer community but there are you know people building all the time so it will be really interesting to see how it unfolds we have a next question i believe a general question from my team why would you want to borrow 0.5 f by giving one if collateral if you can use your original one if to start with it's a good question i think uh you want to know zero point worth of if by giving one if collateral would be the right way to fix it yeah lon you want to answer that uh i can answer that so you wouldn't want to do that but you would want to if you have ether then you have this money either and you can't do anything with that and if you want some liquidity for example you want to buy a car or you want to pay some bills then you need to sell this keys or you need to take liquidity from someone else but here you can basically borrow some amount of this ether in die and use this money somewhere else whenever you need liquidity so it's similar to the mortgage when you think about it when you buy a house you put 20 down and the bank gives the other 80 percent and you're the owner of the house so you put the house as the collateral and the house's value is for example a hundred thousand k but then your loan is 80 000 k so it's also over collateralized because the value of the collateral is more than the value of the loan we have more people maybe i'm gonna answer that one do you have some experience with polka dot guys can you tell us something about it so polkadot is a great upcoming blockchain uh from similar uh community than ethereum those guys were building ethereum node before and it's a great team we have a lot of great friends there and um yeah there are many polish people working there as well so we are huge farms polka dot has an idea how to scale a little better by building blockchains from blockchains so you have blockchains and multiple other blockchains connected and they can interact with each other in fully permissionless way without the need for trust so polkadot just launched the mainnet couple months ago so they're very very fresh and new they're kind of a new kid on the blog they were a long way coming but very very recently they launched so there is a lot of community there's a lot of development a lot of develop a big developer community much smaller than ethereum but i think second biggest after ethereum still and uh it's really exciting we've done in it was a couple projects in polka dot ecosystem that was mostly building blocks of polka dot ecosystem itself so it's not yet really we don't really see working projects he has a lot of people building so we expect in a year or two there might be some very interesting projects coming yes there's more people more question coming i'm gonna read that one and let leon answer maybe after implementing e1 so ethereum assembly it will yeah you'll explain what the e-waste means and we will be able to use more favored languages what do you think i hope so so e wasn't is this idea slash proof of concept uh maybe more now uh that we can use not the ethereum virtual machine but the other virtual machine similar to web assembly on the ethereum uh and that will allow us to have the more like normal compilation target and all the languages that can be compiled to webassembly will be also able to be compiled to ethereum there are obviously a lot of asterisks but there is some work happening on it right now i personally haven't tried ewasm but i've tried it wasn't and tried compiling something to webassembly and run it in the browser and it was nice and good i don't use it in production yet but why not in a couple of years i think it's also important to understand that the language is not that important you need to understand the new programming model which is slightly different it's not completely different if you know how to program you know web or mobile or something and you understand how programming works the algorithm the basics of basic understanding of computer works databases this kind of stuff you can learn solidity in just i think couple days maybe a couple weeks tops if you put your heart to it especially so it's more about different programming model like the memory model is different the pay for execution model those are different security considerations that you need to take into account so this is important the language is really secondary if the java or solidity or whatever you ain't gonna program in java like you know it as of today because it's gonna have different memory model because you're gonna have different security considerations because it's gonna be need to deterministic and you know that's gonna make it really something java like rather than java itself or c sharp or what whatever your favorite uh question is and i think there is also a question about viper language have we tried viper language we tried micro language it's fine it's a little bit better than solidity and the truth is it came just too late uh to make to the main to the blockchain mainstream it's a little bit better than solidity but already so many people knew solidity and so many products were written in solidity and uh you know all the auditing films were doing solidity so that people didn't switch and i think viper is now a ghost lag which i don't think anyone is using it no that i i know zero projects that are using viper language and the questions keep coming i i see three more questions let's do those three more questions and feel free to ask more questions right after that because we're gonna have a networking party uh virtual networking party so let's answer the last three questions what are now the possibilities for storing large amounts of data on the blockchain london you want to take that one yeah i can take this one so depends on what we call the large amount of data if we call like a couple of terabytes large amount of data or petabytes then your only solution is the private blockchain and the block the public blockchain is just not a tool for this task if we're talking about the couple of megabytes then it depends what you want to do with this data and how you like do you want to retrieve it uh from the smart contract or do you want to store it and retrieve it from the outside because there are basically three storage mechanisms on the blockchain you can store data in the so-called storage storage it is very expensive but you can read it from the smart contract and it's available and it's indexed you can store data in the logs and after the transaction is executed those logs are stored on the nodes and the smart contract cannot read the logs but the client and the lite client can easily read the logs and uh you can essentially also store data in the call data so when you call the contract with the arguments those arguments get recorded uh on the blockchain they don't get indexed it's hard to iterate over them later but this is the cheapest storage method by far yeah i would add there is a good story on one hackathon one of the teams wanted to build a storage on blockchain for things like persistent permanent storage and they calculated that if you get a if you get a lamborghini photo in high definition it's gonna cost more to store on the blockchain they buy the actual car so yeah blockchain is very expensive to store data and it's probably not a good place to store data and um but it's really good at doing different things like in security and trust right so so the things you want to build on blockchain are the kind of things that are trust heavy and not very big in sense of storage and that's why the very first thing that kind of happened that is right now happening on the blockchain is the centralized finance because it has exactly those properties and then someone addressing someone said okay what about private blockchains yeah this is a different kind of animal uh private blockchains and i think it gets mixed a lot because you know blockchains public blockchain is probably it kind of sounds the same but it's a different thing in public blockchain you have this trust that comes from the system economic incentives and all that stuff right a private blockchain is more like there is a committee of people that tell what the truth is therefore there is not a lot of disruption to be done and new stuff to be built on private blockchains there is not such a potential as in in those public blockchains we do expect that private blockchain is going to improve a lot of processes in corporations and collaboration between different companies so we can think about it as a you know like a little bit more secure cloud something that allows those companies to improve their processes but you we don't expect like device to happen on private blockchain but there's something that doesn't happen private blockchain is something by definition built for uh companies to optimizing other processes in the site company or across the companies i don't know if leon is agreeing with me maybe i'm exaggerating a little bit no i think that's not very uh that's not very uh controversial and last but not least i would like to say that someone continuing on the topic someone said ipfs for storage sure so a lot of those uh a lot of those um a lot of those uh applications that want to use the centralized stuff financial institution yeah we would like also to have some pictures like we would like to have avatars of people or whatever else right so for those people there is a new category of technologies that have been developed called distributed storage and ipfs is the oldest one the most well-known but there is a file coined or that is actually related to ipfs but there is also swarm there is at least two or three other uh other other other platforms so if you wanna build you know your facebook on blockchain then probably very little of that facebook gonna be on blockchain the majority of that's gonna be somewhere on distributed technologies and in fact they are very young and they're just starting out i think ipfs and filecoin launched uh like again two months ago or something right the ipfs is an old system but the incentives around it that allows you to sort permanently or persistently there is a slight difference between those words we're not getting into it but in a way that you know it stays in the network for a long time uh i think there is uh i think they launched a month ago or two months ago can you correct me here no i wasn't following but it was a short time ago yeah so it was it was short time ago so those things are all things to be built in the future so now it's all about defy but once the defy space gets a little bit colder and you know more stable and slower slower growing which i expect gonna take a couple years because it's super hot and it's gonna take a little bit of time you know that's gonna that's gonna uh that's gonna be a next thing to be disrupted by distributed technologies but we're probably at least a couple years away from that it's like even if today someone is building before it's gonna be stable before people gonna be using it it's probably those are not easy products to build this is not web this is not like free senior developers three months boom you have mvp working it's a lot of trial and error discovering researching you know learning and only on the other side with some probability there is a success um so yeah did i say it was the last question three questions ago so matteos let's do this let's do this uh let's do this uh last question i'm gonna read it leon i hope you're gonna answer it the only incentive for you to users to balance die supply from market mechanisms perspective is an arbitrage i mean to buy on the market die and pay the collateral or you should die and sell on the market i'm not sure if you follow the question yeah that is basically true and that is called soft peg and the hardback as some other stable coins have so for example let's compare diet to usdc with the usdc you have the u.s legal entity and you can transfer us usd to it and it issues usdc using the rate one to one and then you can also redeem those usdc for usd and get us dollars back and it's a very nice system in its properties as the price of the usd is always one because as soon as it goes like even slightly up someone can arbitrage a lot of it but the problem is this u.s legal entity it should be trusted and if it defaults goes bankrupt then those usdc tokens are basically worthless because there is no entity that can redeem them back for the usd diet has a soft bag which means that there are market mechanisms as you mentioned that bring it to the one dollar amount and if that is slightly above one dollar then you can arbitrage and do some things to put it back to one dollar and the other way around which results in die not always being worth one dollar sometimes it's slightly less sometimes it's slightly more and it depends on the amount of liquidity but the system gets bigger and bigger and the system gets more and more liquid and we're making a lot of progress so with time it will be more and more stable but it is secure it is more secure than usdc uh because uh dye is fully decentralized and yeah there is no u.
s legal entity behind that just storing all the dollars wonderful so uh thank you for the last question i i see more questions are coming but uh our time is up but what can we recommend for the junior saluted developers okay then let's do one more so um so i guess one question is is junior uh junior uh solidity developer is a tricky position to be so if you're a junior developer in general my advice would be to go through another specialization into blockchain for example for front-end development uh because um solidity developer you know there is a difference between coding let's say banking application and and coding uh blockchain application if you if you do a banking application and there is a bug and let's say a million dollars gets randomly transferred to the wrong person and there is the whole banking system uh transactions are reversible and there are different ways you can undo what have been done if that face for some reason there's the whole legal system and you can you know go to court and the extreme cases and you know fight person fight person to to get the money back right but it's a little bit different on blockchain if you make a mistake on blockchain if there is a bug it can cost you can lose millions of dollars and there is no way to revert the transaction there is no wait there is no way to there is no way to uh undo the damage and oftentimes those are anonymous people not always but oftentimes anonymous people right so you probably want to have you you you want to feel pretty confident about your skills uh what are the ways to get more confident about your skills well first of all uh continue working continue joining xerox poland join one one of our workshops uh and you know like um it's gonna be us it's gonna be maker people it's gonna be other people as well watching the group and looking for people to hire and uh even if you don't necessarily there's a lot of work and solidity there's a lot of work in front and then tooling that requires basic solidity skills to do so so those are great ways to get into it if you're a little bit more experienced developer developer then getting into the space should be fairly easy and yeah like just learning another language if you know any language good it's not really hard to learn another one so just take some time off learn the language make sure you understand all the details about security and so on and i think there is plenty of jobs in the space with that positive with that positive message we will end our transmission but it is not the end of the event please again come i will answer the following question on our networking group can we see the networking link once more yes i see people joining mateosh who is doing yes this is the link join us there ask any question you would like and we would love to answer we'll be hanging out there there are different tables you can join you can see where the different people are sitting just click on the table join the discussion and we'll be happy to answer any questions you might have it was absolutely wonderful to talk to you today uh lan thank you very much for coming thank you for the great presentation uh we were overwhelmed by the amount of people that were watching this first episode of xerox poland we hope to see you again in a month we hope to see you on workshops and ultimately on hackathon as well thank you very much and see you on on remo see you on remotco which is the virtual networking thing that we're going to right now thank you very much thank you bye
Automatic transcript — names and jargon may be misspelled.