# nEWS LETTER 2 ## netting out debts with fhe Barry, [2/23/24 1:37 PM] I am trying to get a sense for how much of the liquidity inside of daimo is just moving around and how much has been onboarded Barry, [2/23/24 1:38 PM] For example at devconnect you gave everyone like 50 usd Barry, [2/23/24 1:38 PM] and i actually got pretty far with 50 usd and could pass it around and didn't actually need to re up because i kind of paid for stuff when iwas running low to get money back Barry, [2/23/24 1:39 PM] The reason i ask is that i am thinking about doing a kind of FHE application where you are able to create debts to othe rpeople and then you use FHE to search to see if the ppl you owe owe money to someone who owes money to you. Cos if you find that you can just cancel all the debt without the system needing to add more liquidity. 1:40 PM So i am trying to think how much of the money moving around can we just net out using crypgoraphy + social graphs 1:41 PM I kinda want to make "cryptography is taking the currancy out of cryptocurrancy" happen :) 1:41 PM Like there are a bunch of applicaions where people are able to split bills witih eachother. 1:42 PM But there is no like golbal registry of everyones debts that are constantly being compared to everyone elses to see which ones we can just get rid of 1:42 PM Cash flow problems are a big problem for a lot of buisnesses 1:43 PM For exmaple imagine i owe Nalin , Nalin owes DC and DC owes me. 1:43 PM In the current world i got to get a loan to pay Nalin , Who pays DC when gives the money back to me which i return to the bank 1:43 PM It seems like our world does not have tools to deal with these types of circuilar payments. 1:43 PM Like imagine if the whole world everyone actually owed everyone else enough that we could just cancel all debts. They used to do that in the anchient times it was called Jubilee 1:46 PM Its very unlikely that that is the case there is bound to be some imbalance. 1:46 PM But its probably possible to cancled a significant portion of debts Nalin: interesting, this minimize transactions to settle balances problem is NP complete btw, also similar to how bitcoin lightning network channel rebalancing worked https://antoncao.me/blog/splitwise Yeah we gonna do this in FHE :D 8:42 PM But shoudl be just an aproximation and also the group size is gonna be small cos you kinda have to do that for livness stuff. 8:43 PM Yeah its also kind of lighting network backwards 😂 ## FHE is happening Barry: How's the progress on the fhe to cancel debts in social graphs going going ? Janmajaya, [3/5/24 5:41 AM] sorry again! Got busy with other things. But will finish today Janmajaya, [3/5/24 7:23 AM] btw was busy with figuring out encrypted inference for Resnet architecture using CKKS (another FHE scheme) Janmajaya, [3/5/24 7:24 AM] was able to simulate whats required Janmajaya, [3/5/24 7:24 AM] I think we're only 2-3 months away from running encrypted inference for Imagenet type dataset (in prod!) :) Barry, [3/5/24 1:00 PM] Wow Janmajaya, [3/5/24 2:12 PM] Can you check this out - https://github.com/Janmajayamall/fhe-debt/blob/main/prototype.py ? Janmajaya, [3/5/24 2:13 PM] It is python implementation of the FHE circuit. It follows the greedy algorithm. After each round, all parties collectively decrypt the id of who (max_pay_id) pays who (max_recv_id). After that max_pay_id and max_recv_id decide how much max_pay_id pays max_recv_id. For example, let's say max_pay_id in total owes 40 and max_recv_id is in total owed 100. Then max_pay_id should pay max_recv_id (greedily) 40. If they find min(40,100) in plain then both max_pay_id and max_recv_id learn each other inputs. But if they were to calculate min(40,100) in FHE then it only leaks max_pay_id's input to max_recv_id and that max_recv_id's input is >= 40. This is better than calculating min in plain because only one of the learn other's input. And this is the best we can do (at-least in greedy algorithm), since output of min is one of the inputs. What do you suggest, should they calculate min in FHE or in plain? I will port this exact thing to FHE circuit. But, for now, it will be single key. In multi-key there's an added key gen phase (like DKG). And the performance degrades by roughly 2x or so but rest remains the same. Nothing changes in the FHE circuit and the client communication & compute per round, apart from one-time key-gen phase, stays the same. Do you think that will be fine for the prototype? Taking this route because tfhe-rs does not have multi-key implementation and Gauss (our library) does not have tfhe (binary fhe scheme) implementation yet. Only library that has multi-party tfhe implementation is openfhe (which is painful to use and is in c++). Barry, [3/5/24 2:17 PM] Oh cool let me check Barry: Not quite what i had in mind but let me ping you more info laters. ## grape vine Barry, [2/23/24 2:11 PM] I think one of the key inovaitons that facebook made was that everything on face bock could be traced back to an individual user who was using their real name. Because of this your moderation task just got tones easier because the stuff people woudl actally consider attaching to their real name was really small. Barry, [2/23/24 2:11 PM] In a similar way the graph of graphvine has everything attribiuted to one of your friends. Barry, [2/23/24 2:11 PM] So your connections are kind of how you see the world. Barry, [2/23/24 2:12 PM] That is true for the user name consensus problem for example Barry, [2/23/24 2:12 PM] That given a social graph where there are two vitaliks you can pretty quickly figure out which is the "real" vitalik Barry, [2/23/24 2:12 PM] Because its just a matter of what your friends think, or how closely they are connected to him Barry, [2/23/24 2:15 PM] Anyway not sure what im saying here. I am still just playing around with these concepts to how to think about this What would ethereum be like if it was social graph focesed ? Google was a machine that organised information. But then facebook came along and they built a machine that made new information. So gogole is not in a big toruble because they cannot see the new information facebook is making so they can't organise it. In the same way ethereum is a machine that allows you to trust. It does this by "trust no one" there are other ways to do that. The thing that will be better than ethereum in every way is a machine that makes trust. ## p2p peereum: ***The fun think about a skunk works is that you get to pick a project that you think its gonna be the future thing. I currently think that p2pereum should be that project :D*** I was thinking that we shoudl try and make an economic world game where there is no money and everything is just handled with pair wise debts and people can just pcd cashout and try and get away with it. But genrally they don't cos it would be screwing over their friends. 1:50 PM And then i want the game to have an FHE tool where you can check if their are cyclic debts. Basically i owe you , you owe michel and michel owe me. So in the real world i would get a loan to pay you , who pay michel who pays me back and i give the bank back tehir money + interest. 1:51 PM So the game should encorage cyclic debts and people just end up using it for real world stuff because there is no nightmare to onboard people and you trust your friends anway and things just actomatically get netted out by fhe so you don't worry about your debts getting too high 1:52 PM even if your debts get too high and you own like 1k usd to various people you can always just pay for a friends dinner or morgage payment or something to balance things out 1:52 PM The exact behavior we had at devconnect with daimo, well i did anyway. I never onboarded anything i just kept getting dinners for people and then having them pay me back with daimo. So that i always had positive balance. Edited2:07 PM Like if we can end up buildilng the system where people actally care about their reputation and everything else just happenes via usd or venmo that seems like a major win. 1:53 PM Like the poitn of crypgoraphy is not to pay ppl using joe lublin (or who ever is the largets holder is) coin 1:54 PM "Cryptography is gonna take the currancy out of crypgo currancy" 1:54 PM ----- 1:54 PM I need that groups 🤪 1:55 PM So many ideas 1:55 PM Sat, Feb 24 ----- 8:30 AM I have been thinkin gabout what an ethereum zkunks works would be trying to do. If you were trying to build a replacemnt for ethereum or the thing that woudl replace ethereum what would it be ? 8:31 AM So obviously ethereum is many things and i am not trying to change all the parts 8:31 AM I suppose i am mostly trying to change the EVM , execution , mempool pool, consensus parts 8:31 AM probably ethereum will remain the "hard disk" 8:31 AM So comming at this from antoher angle, what is it that makes ethereum difficult today. Lets notice some stuff 1. Hacks 2. onboarding 3. Trust 4. privacy 8:32 AM Well we spent some time trying to make private smart contracts and got an impossibility result about everything with global state. 8:32 AM Like uniswap is just impossible to do 8:32 AM Ethereum also has this global ojective views about everything which means consensus and you got to figure out which is the one objecting truth 8:33 AM Anyway we noticed some stuff now lets think about facebook a bit 8:34 AM The main inovation that facebook made was having everything on face book connected to a single user name. And that was everyones "real" name 8:34 AM This meant that people behaved themselves much better on fb 8:34 AM Becuase it was attributable to them 8:35 AM What would eth's emergent behavior be like if ppl were only able to do stuff that was attahed to their real names ? 8:35 AM *many possibilites* 8:35 AM Many pair wise use cases and probably the tennor of smart contract development would be differnet 8:36 AM Feel this migh tbe a fun side missions to maked "doxed" ethereum a part of smart contract space where you could only interact with ppl via their real name 8:36 AM Or every eth address had someoens real name associated with ti 8:37 AM You could do the same thinng about fb on boarding where you only get collage students so you know its harder to game 8:37 AM That sounds like it would be super fun. 8:37 AM Anyway thats no the main point of this tirade 8:37 AM What would a peer to peer ethereum look like 8:38 AM Cos eth is not actually peer to peer at the moment 8:38 AM Not in the literal sense of i know my peers and interact with them. 8:38 AM Its peer to peer on the consensus level but not on the smart cntract level 8:38 AM Ethereum has global state which basically collapses everyone into a single peer 8:39 AM thats what uniswap is doing with the difference between the liquidity pools 8:39 AM making a single atrificial entinty 8:39 AM So i think the skunk works should work on a really peer to peer ethereum. And taking advantages of the unique affordances of that 8:41 AM Let me give some examples 8:41 AM * Onboarding * You onboard to p2pereum. You say oh yeah i want to get on this thing cos its very fun. You think of should i go to an exchange and get some eth or what every ? Thats how it worked before. But no you don't have an objective state in p2perum so you go to find a friend who is inside the graph. The basis of p2perum is a socal graph, you peers. You got to get a peer and preferablly a well connected peer. So you contact "THAT" freind. You know the one and ask to get added in. They sit you down and talk to you and say, "this is not a game here, I have a reputation inside p2pereum and if you mess that up imma be pissed". You don't quite understand but that friend has a kind hard and agrees to peer you to a total value of 100 usd. Just to start with. * You have no idea whats going on you used eth so you assume usd is a kinda stable coin. You offer to send your friend the money back that they are peering you with. They just smile and say "don't fuck this up" * You get into p2pereum. You get your command line open and you see that you have a profile which contains the max balance you are peered for. You also see your connections. "THAT" friend is there bless his heart. But you got nothing else. * You type `prove_new` the world spins and shakes a bit. * You type `find_path` it gives you an error and says you need to enter a user name. You type "Vitalik.eth". It spits out a number 2 and a username "THAT" friend. * You type `pay vitalik.eth 1 usd` nothing happens 8:52 AM * you check profile it now says 99 usd debt 1 usd 8:52 AM * In the background your computer starts running FHE with everything within 2 connections of you to try and minimize the number of settlement payments that needs to happen. you see that money is actually a zkp and p2pereum replaces zkps with FHE which means instead of money being global is becomes local. 8:54 AM * Now you do what you came here to do you type `contract help` a man page pops up that says you can make a contract and everyone within 2 connections of you will run that FHE circuit and spit out hte result of the computation. The FHE circuits for minimising payment was an example of such a circuit 8:55 AM There are others for borrowing and lending , voting , coordinatoring, dating 8:56 AM There is no objective truth you see everything through your peers eyes. They curate the world for you and you for them. 8:57 AM Well you don't see everything you just see some stuff 8:57 AM cos its private or some stuff is private 8:57 AM You sit down and think what can i build with a private programable socail graph 8:58 AM you remember someone saying that its more powerful than eth cos eth is just objective money. But what really moves the world is social connections 8:58 AM You struggle to understand. You remember story from the bible where basically moses wonders the desert for 300 years and finally when he arrives where he is going he is not able to enter, he died after the first step. One meaning you could take from this is that after being trhough a hardship or an adversarial world, it is difficult to adjust to life in a less adversarial place. You reflect on this as you struggle to see is this the thing or was the other thing the the thing 9:00 AM Mon, Feb 26 Btw I got yo cancel our Thursday call. I'm traveling to the rain Forrest but will be back the week after 5:52 PM Also looks like I'll be able to make end of March in us 5:53 PM Ima see how I go in Ecuador and then come to us. Just let me know the details and I can think who to invite. 5:54 PM I was thinking to ask Jay fhe guy , but it's unlikely he can get his visa in time 5:55 PM Tue, Feb 27 ------ 12:46 PM I want to do a zuzalu cymara baby. 12:46 PM So next zuzalu we all get our DNA sequenced 12:46 PM Then we get some kind of signature for our DNA 12:46 PM and we add it to our FHE profile where the sequence is commiteed to on chain 12:47 PM Then we use FHE to merge all our DNA's together into a single dna sequnce 12:47 PM Where each person gets to contibute the same amount of genetic information 12:47 PM And this is our Zuzalu cymera baby of everyone 12:47 PM I think the correct IO (mouse , keyboard) is social graphs, So bsaically having all this stuff framed by your friends / direct peers 1:22 PM Wed, Feb 28 I think the thing that ppl useally miss when they think about private VMS is that actually counter party discovery is the hardest part 1:39 PM You can check peakabook on eth research 1:39 PM That problem is compounded by the ability to find out someone's private state by continuing to ask questions 1:40 PM It seems to me that reframing VMS as peer to peer machines solves both these problems 1:41 PM Ethete is actually not peer to peer 1:41 PM The consensus is but not the execution 1:42 PM How can we have a multiplayer computer if it's not peer to peer 1:42 PM I think the right thing to build is p2pereum The thing that our new tools 2pc allows is for us to go deeper than 2ppl and keep privacy. It allows you to search deep in the graph as long as you are clever about you algorithinm. One potential killer graph is an expense tracking app that searches for circular obligations and then cancles them 1:14 PM What percent of depths and be cancled cos of this ? 1:15 PM Example: i owe you, you owe Brian , brian owes me. I borrow money to pay you , who pays Brian who gives the money back to me. 1:15 PM This is a major source of friction in our economy with whole parts of every company devoted to cash flow 1:16 PM It also seems like a much nicer building block for defi type applications. Because it's inherently social I think that moving everything to the social domain will make everyone build pro social applicaitons. There will be no more defi or nft type dynamics. Instead the goal will be to build tools that peopl euse to coordinate with their friends. What would ethereum be like if everyone used their real name just lke facebook. The dynamics therew ould be very different. ## Yan gets an ear full about super computers made of people Yan Zhang, [2/27/24 9:58 PM] Can we do a call sometime? Barry, [3/4/24 5:12 PM] Sure. Barry, [3/4/24 5:12 PM] How urgently would you like to call ? Barry, [3/4/24 5:13 PM] I want to talk to you about an education projects that leverages the ideas of consensus protocols to allow one person to teach millions Barry, [3/4/24 5:13 PM] Basically you do many tests of the students and then get the ones that pass the test to teach the ones that fail. Barry, [3/4/24 5:14 PM] Then you retest Barry, [3/4/24 5:14 PM] Then you promote the teachers of the students who passed and demote the teachers of the students who failed Barry, [3/4/24 5:14 PM] Then you repeat for another problem Barry, [3/4/24 5:15 PM] You teach them , give them test , if they pass you get them to teach the ones who failed. Barry, [3/4/24 5:15 PM] So this works Barry, [3/4/24 5:16 PM] But if you have a million students are you gonna need to correct a million tests ? No Barry, [3/4/24 5:19 PM] So you have all the students correct one students exam. You then correct that exam. You give a high rank to the students who agreed with you. Then you continue of your training tests until you have a set of students are constantly agreeing with you. Then they take you place at the top and you get them to build a similar higherarchy. Barry, [3/4/24 5:20 PM] The nice thing about this is that by correcting and getting feedback on the corrections the students are actively learning and improving. Barry, [3/4/24 5:22 PM] You can also correct abstract things not just answer is 10. You can check proofs are correct for example which iiuc computers can't do. Barry, [3/4/24 5:22 PM] I thought you might like this concept because it intersects with your interests. Barry, [3/4/24 5:23 PM] I have a more advanced version of this that we can use to do math research where millions of students join and get assigned various Lemmas to prove. Barry, [3/4/24 5:24 PM] That's kind of like a super computer made of ppl v Barry, [3/4/24 5:24 PM] But it's better than regular computers cos it's easy to program Barry, [3/4/24 5:24 PM] And can do all the things computers can't do v Barry, [3/4/24 5:25 PM] Like computers can't prove something (well some stuff but in a brute force way) Barry, [3/4/24 5:25 PM] But this ppl super computer could be creative and solve problems Barry, [3/4/24 5:26 PM] But we got to add mad error correction and direction for it. Barry, [3/4/24 5:27 PM] Imagine have some math problem running and waking up in the morning to check a few proofs are correct and having they system solving the optimisation problem of who is taking to who Barry, [3/4/24 5:27 PM] Who is helping who Barry, [3/4/24 5:27 PM] And there are a million ppl working each solving a hard part of a big problem Barry, [3/4/24 5:28 PM] And you don't need to be super focused on a single path to solution Barry, [3/4/24 5:30 PM] With high ranking ppl you can be like "propose a series of lemas that need to be proved to prove the rhiman hypnosis" and the system will send that to you to see if it makes sense and then these ppl automatically get assigned medium ranking ppl to prove each Barry, [3/4/24 5:30 PM] Ah that's probably showing how little I know about math. But I think I'm general we can use these tools yo explore problems ## history https://hackmd.io/eHR1w36WT4OOWr9YtRtQSQ