DAPPCON 2019: NFTs and zkSNARKS, Off-Chain Assets into DeFi - Philip Stehlik (Centrifuge)
DappCon 2019 · August 2019 · 22:22
Philip Stehlik of Centrifuge discusses bringing off-chain assets into DeFi using NFTs and zero-knowledge proofs at DappCon 2019. He covers how real-world assets like invoices can be tokenized and used as collateral, explaining how zk-SNARKs help preserve privacy for sensitive business data while still enabling on-chain financing.
Speakers
Topics
From DappCon 2019, hosted by Dappcon Berlin.
Transcript
hi folks my name is Philip I'm working a project called centrifuge and I'm delighted to tell you a little bit about what we do with bringing off chain or real world assets into the defy space using energies and ZK snacks to keep some things private that we don't want to show on chain before though diving into content like anything we do we work on we tie back to the mission center huge and that is I'm changing the rules of global trade to foster economic opportunity and so you'll see you're kind of keeping that in mind as we go
through the the storyline like why do we actually build this thing why do we want to bring our chain assets on chain so this talk will be about tokenizing off chain assets with centrifuge so that's one component using ZK snarks for a nifty minting that's the other part and then lastly to get on chain funding so d5 for us is really getting funding where we use these opportunities as collateral so those are the three main components but like why do we even want to bring real world or chain assets on chain rights to that like why you can go through that house so like why can we
not just have everything in crypto the reality for us is that there are many things that just live off chain that have real value and that want to want to be financed I'll give you three examples one thing we talked about off-chance that is actually an unpaid invoice if you are business you want to get paid you're gonna get money from your customers and a lot of these invoices are payment terms that are 45 90 180 days out right so you have this asset that's kind of locked you cannot get the cash and you want money right now as a business another example is we're working with some real estate lenders who are underwriting mortgages and giving out mortgages and they are looking to tap into different sources of capital or
cheaper source of capital right if you're a lender you're getting your money from somewhere to for the mortgages you give out if that one lender disappear you cannot run your business any more like underwriting loans and giving out those loans so they are looking for alternative sources of capital that they can have to tap into and the last thing as another example is we're working with some with a platform that works with artists when you have a hit song as an artist you want to pour money into marketing to continue writing that way for the office hit song but the royalty payments come in way way later like as an example until recently could take up to two years to get your royalty payments from Spotify streaming and that sucks so there are all these
kind of different types of off chain assets that really could benefit from liquidity and those three use cases are actually something that we have been working on with some project projects so you might not have heard about centrifuge in general before going into the detail on the flow the centrifuge has the component for exchanging financial documents in a peer-to-peer fashion in a private secure and verifiable way so you can send documents around like invoices and have an unalterable single source of truth and that becomes important when we talk about tokenization later you want to only be able to tokenize one thing once and then you can of course tokenize
these documents and access the etherium defy ecosystem through something we call tin lake it's basically a way to take n of T's and turn them into USU 20s I'm going to talk about that but let's walk through through an actual use case of an invoice so if you have two companies they do business in the older traditional way right sue tie LLC's selling tires to the big car manufacturer and at some point they want to get paid so they send an invoice through centrifuges peer-to-peer network we're using the p2p for the peer-to-peer interactions and an inverse is nothing else than a structured set of data that's being sent around
so ty or LLC on one side is preparing the message assigning and sending it over to big car who receives the invoice verify the signatures and basically does the approval of an invoice and smack a message in it go back and forth and they're kind of attaching signatures to that kind of like a state channel if you want but at some point they won't actually publish the unalterable part of of that single source of truth so the other layer of centrifuge is aetherium where we have three components the first one is actually to find each other on that peer-to-peer layer each of the participants publishes their public key
and something we call PIV the peer-to-peer node identity contract so you can look up participants and on the other side of course verify the signatures of messages that have been received and during that exchange that I mentioned earlier at some point you want to kind of publish on notarize this invoice status so we call them anchors so each participant can at any point in time publish an anchor which is basically Rudy hash of the document data on a theorem to have an unalterable source of truth which comes into play later on when you want to mint a token or an N of T or the knowledge and able to enter T based on the data that has
been exchanged these n of T's go into what we call tim lake to turn them into your 20s because the whole defy ecosystem only understands the su-22 day you cannot take an end of T and put it on the compound for example or even the multi-level die you cannot put an F key in there they only understand your 20s so Tim leg is a way to pool these kind of T's and issue you twenties correlating to the value of that pool and then do something with that so that's kind of the overarching system and I'm going to walk you through the end of T minting and parts next so high-level how this works is that an
invoice or a mortgage or whatever kind of document that exists on the peer-to-peer layer it's basically just a set of fields line items like nested field structures and what centerfielder does it takes these and turns every single data field into a leaf over Merkle tree and that root hash is was getting committed on to aetherium so that allows you to do pretty cool things like providing on your mark approves to validate specific fields of a document or also then for the knowledge books so the journey from like from the off chain document or the off chain asset to financing is you have this option document on one side then you mint or the user mins and nft in this case an
unpaid invoice nfg right so you see the amount and so on but way less information is being revealed then what you have on the arc chain data set that get put into tin like moving on in to make a compound in others but there's one problem here is that you don't wanna lay open the amounts of your invoices you don't wanna necessarily open who are actually the customers that you interact with there when you want to seek financing so that's where the knowledge groups come in basically what we did is we turned the sample inverse sine of T with with only some fields revealed into is your knowledge n ft where you provide
a proof to mint and you provide proof to assure that the value of the n of T is lower than the value of the option acid so you can only lend up to the amount of the opportunism and replacing the customer basically with the credit score of a customer so you can proof that a customer is in a set off the kind of a list and you can publish the credit score which can then be used for underwriting without actually reviewing the actual customer that that was there I think most of you have heard of the kiss marks at this point but just briefly so ZK snark Co knowledge proof allowed to demonstrate stuff about something without giving away any any
information they are easy to wear if I and really hard to fake impossible to fake like one simple example for the knowledge proof is that you can prove that you know the preimage of a hash but only reveal the hash tag so instead of the preimage itself whoops one too many for our zero knowledge portion we worked we used Socrates so to generate the circuits and generating the proofs Socrates is a really cool tool where you have a DSL to construct snarks so you see it's like normal programming language they are instead of like generate manually creating a circuit and we closely work with Stefan who is one of the
contributors to Socrates to help us implement this your knowledge kind of team minting and the verification tip - Stefan so how does our zero sine of T actually work so the public inputs for the verification is that credit rating that I mentioned earlier what you want to prove that is n of T you went to a customer that has a certain code rating the amount of the n of T so that the amount that we compare against the invoice amount and then some route hashes that are being used to kind of verify proofs privately we have the document tree so remember that off chain invoice where you have the amount and
you also have the signatures that have been attached like when this King Kong happened between Thai LLC and big car and on the other side we instead of having just the customer we have something we call a company rating tree where somebody publishes the rating of the public key from company one two three four five - a rating and later on you can basically find the rating tree and compare it against a root hash that has been passed and the snark what it does a verifies that the Merkle proof for the company rating tree and the key of matches so finding and making sure that the public key of the customer is
actually the one that's on the rating tree it verifies the signature of the customer and then of course it also verifies that the inverse amount is larger than the amount that should be represented in the NFT so that's the snark that has been generated to implement that we had to change a couple of things on centrifuge on the peer-to-peer layer so before enabling zero knowledge minting we used kakak for hashing that's really costly when you do that it's your knowledge so we change at the Petersons also the signature verification scheme we had to change and also they are step on helped he implemented maybe job job as the
elliptic curve that's underlying for the hashing and the signature verification so that's kind that's how we construct the n of T basically publishing only the rating and the amount of the end of teens of the invoice so we have this want to pull n of T now a lot of stuff is private what do you do with that how do you get into define so that's where what we call tin lake comes into play so often assets are often quite unique right invoices each of them is unique but similar in some sense these mortgages are very unique very unique customer and very acid that's been underwritten as I mentioned if I can't talk Yesi 721 today now you cannot put
that into any kind of lending pool or whatever but everyone understands you see 20 so we we built in Lake because we only do entities and nobody understands entities so we built in Lake as a framework to underwrite assets to set the value of these assets so like the mortgage companies underwriting and setting the value of you talk with mortgages to deposit entities so in this case an invoice or a mortgage it could also be a crypto Kitty or any kind of other NFT it doesn't have to be a centrifuge a 50 and then draw a currency from somewhere and basically you fractionalize a large asset or you create a pool of assets that kind of a similar as in class
so how that flow works is so where do we have this energy that might or might not have some zero-knowledge things in it you have a borrower remember the three examples that could be an artist it could be the mortgage company that could be a company with an invoice that's outstanding and they deposit this energy into a tin like pool these pools are unique for the asset class so there's one pool for invoices one pool for mortgage juice etc etc because yeah it makes it easy to underwrite and then from this pool of NF G's we generate something we call collateral value tokens that represent the value of that pool and that's then getting pushed into maker compound it situates to draw
whatever you want to loot and use as an ik acidity usually there's an astable card that comes out of it so far we have been using dye that's getting them passed on to the borrower and there's some mechanisms in there that Pettine deck operator can receive some value for the underwriting and so on but just keeping that very high level here right now so to sum up the building blocks that we have we have the sender future the peer exchange we have the ZK know as UK proof generation with Socrates that getting verified on Molly theorem the minting through our contracts and lastly tin lake as the actual system to bring these entities into into the defrost
phase where we are today so centrifuge has been buy from Maynard since May roughly we presented at Zeke on one our minting like watch more in detail on the zero knowledge side so my colleague Lucas and Stefan demo booth ended up their tin lake is live since July we financed the first two and a thousand die together with maker foundation so we have been collaborating closely with them because of course they want to get all kinds of assets into multi collateral die that are not only crypto and we roughly have one new asset provider as a producer coming live right now going through that first like run through ten vacant and we working of course on multi Claro die
compound other lending products getting these TV tees in there also working with some some traditional funders who just have a bunch of cash that they want to deploy and lend out and use Tim Lake for better tracking of the underwriting process and then also some decent less underwriting right what I mentioned earlier right now there's one pool operator you can imagine that there's many people underwriting an asset or staking towards an asset participating in in the win or the loss on each of these assets so you can decentralize the undermining itself and some more from there so that's that what we do I'll bring these real word assets into D Phi and we have about four
minutes for some questions so if you have some I'd be super happy yeah so the question was who is liquidating the CBTs or who is providing who's taking them basically in giving die for that yeah so and this in the first case we have basically simulation of MCD where there is just a contract that the dye gets deposited into and that allows to draw like allows the compound pool to draw from there so everything else is working as I just described with like basically we have different adapters that will provide that we writing for the dye or
USD C or whatever providing and in this case is just a contract that we marked out MCD and so on whatever I mean earlier is that multi collateral die is gonna support a bunch of different collateral types right a bunch of UC 20s and I don't want to speak too much for the maker folks because they can do that much better but if if you look at all of the crypto assets today all the different you see 20 tokens that exist there really correlating like when everything goes down they go down these kind of assets an invoice or a mortgage is not going to be affected by the course of crypto which allows a stable coin like and that collateral just stays much more stable
that's why getting that that type of asset into into there is very interesting but let's say healthy choices I didn't we're gonna go to this slide for a second so the question is basically how do you avoid faking invoices so the cool
thing is like I mentioned in the very beginning that each of the parties has a public key published so you can basically set up a gate on on a team like Poole and you can say I only accept NF keys where the customer or the supplier or the amount or the currency or whatever kind of field you want I only accept these kind of in in in the first place so and you can proof that right so if there was no signature from either one of these involved parties then you're not going to accept that so we're gonna see so we're already seeing in different pools for wet pools for companies that were like fortune fortune 2,000 companies where the customer was that so that's one way to regulate it and then also the energy is getting deposited in the first place then the underwriting happens by the pool
operator and they are incentives to keep the pool clean because they want to make sure that the assets don't default in there so and only ones they underwrite and assess the value of each of the assets only then the actual lending can happen and so that underwriting can also be automated of course or decentralized it's a - etc but there's these two kind of so the question is basically when you're paying it was back how does the loan get paid back so in because tin like only deals with energies it doesn't really
know it's an invoice or mortgage or whatever so there's the there's no direct tie to paying the invoice back so in this case it's really a loan to the supplier based on an asset that they can prove is real and valid so the repayment actually is not directly tied to kind of the flow of the invoice payment and that's kind of where like if you see this so this flow is is off chain we do have a way that you can basically include payment instructions on this invoice so you could say your customer please pay me back in dye but the reality is and then you can route that dye payment to some contract that then repays the loan for example but the reality is that the majority of
corporates or businesses today they'd have no way to pay back and die so that's why that's not there yet but that's definitely something we would like to do in the future but step by step so this is not replacing QuickBooks or zero in that sense it's merely about the sending the data around so it's not replacing the the accounting system so we have an adapter for SA P for example a huge accounting system the invoice is getting done they're matched against purchase orders and all this kind of stuff and in the end there is like okay we approve this invoice and that's where
like an API call happens to send a future node and then basically triggers that that communication back and forth then then the underwriter so that's similar to what you said if the universe is not paid and time the loan still has to be repaid or the two words to make and if not then you have starting to have defaulting assets and I just have a quick time check do we have time for one two minutes yes yeah so the question is what assets are we actually working with today so the three examples that I've mentioned in the very beginning so invoices so we have been financing in Oasis real estate
loans so we have two different real estate platforms basically that underwrite mortgages and using dye in this case that's source of capital and then the last thing is or one of the other things is the royalty payments so those are some so it's a project that we that we created and and it's literally a set of smart contracts that each of the operators deploys themselves so we're not operating it that's what they do we help them of course operate it and like explain it to them and so on yeah sweet I'm gonna end it there just on time yeah thank you so much if you have any
questions find me or anybody else