 So this talk is payment channels in production. And it's myself and Arjun, and we're going to talk about what we've been doing for the last year or so. Little overview of what Spank Chain is. Show of hands, who knows what Spank Chain is? Good branding. We don't have a booth, but we all have pink hair, so just come find us. This is a quick overview. So today is the 10th anniversary of the Bitcoin White Paper. Let's see how we're doing. So this is something that Satoshi said in a mailing list. He said, I would be surprised in 10 years from now if we're not using electronic currency in some way now that we know a way to do it that won't inevitably get dumbed down when the trusted third party gets cold feet. And Satoshi knew it was up, because he knew that micro payments for adult was where the party was going to be. Show of hands, who knows how payment channels work? If you don't, find the slide later. For DevCon 4, this is a tale of four payment channel systems that we've made. Part one, the demo. So this was August 31, 2017. It was pre-ICO. Started working with Sergey in Russia, Yucustov of Machinimi. And the magic word is hodl. So this is what it looked like. It was called Vinos. This is me doing a video walkthrough where I asked Janice Griffith to spank herself, and she refused until I said the magic word, which was hodl. It was not please. It was not pretty please. It was hodl. So we did this demonstration just to show that our payment channel system worked in advance of actually doing the ICO, because we wanted to improve the technology. It took three tries. There was a bunch of bugs. And then so each of these times we had Janice Griffith there at our Hollywood mansion ready to do this demonstration and then could not get it working. The second time was actually because Xerox was doing their ICO at the same time. And we could not get any of the transactions through. It was very, very sad. The second system we launched after the ICO, we launched on April 2, which was one day later than our target date of April 1. And it was the simplest possible payment channel implementation looked like this. Actually, this is what is still live on our site, because we had to revert it, which I'll get to in a minute. But you had a wallet, and you send money to the wallet. And that's like a legitimate Ethereum wallet. And then after that, you click load up your spank card. And you send the money to the payment channel as represented by the spank card. And so this was a unidirectional ether only custodial payment channel setup. So the users had payment channels with the hub that we were operating, but the performers did not. They had to click withdraw through a separate interface. And in the time between they got the money and they hit withdraw, we held the money. And so we had custody. Again, I was working with machine-to-me libraries and contracts, and we brought on Keokan. The metaphor for the spank card was a hit. Something that we've learned about payment channels is nobody gives a shit. It works like a card, so we represented it like a card. Everybody knows how a card works. You put money in, you spend it, and when you're done, you take whatever is left. So now I never need to tell any of the users what payment channels are. Fun things we encountered along the way. So querying in FURA was non-deterministic. We would get a transaction in, and we would see that it had worked. And then we'd query in FURA, and in FURA is eventually consistent. So half of in FURA is like, yes, this worked. And then the other half is like, I don't know. And so we had that problem. Truffle timeout is 240 seconds. So in production, when you have transactions and you have a variable amounts of gas, sometimes your transactions just time out, and that sucks. You have to go trace them down. So fast-forward to June 9th, we hardened our wallet, and then we shipped our open beta. So this was the same wallet. Roughly, actually, this is the wrong picture. Yeah, so this is when we upgrade later. But anyway, we got hacked, actually. We never talked about this one. It didn't really seem like a big deal. But we actually got hacked before the most recent hack for a lot less money, because in the process of migrating to a different infrastructure, we let our Gethnode firewall slip for two minutes. And in the two minutes, within 30 seconds, the $1,500 in ETH that we had on our hot wallet was drained because the Gethnode was unlocked, and somebody just sent a JSON RPC request to send themselves all the money. So then we did an upgrade. We launched that September 1st. Move fast and break things, they said. So the upgrade was a non-custodial wallet. It had Perun-style peer-to-peer virtual channels, which we call threads now, too. The contract had support for ETH and ERC-20. So on September 1st, we launched the wallet, which looked like that. So we integrated the wallet and card into just one balance and basically just showed a pending transaction until all of the wallet funds were there. And so we actually took the liberty of, when you send the wallet the money, we automatically deposit it into your payment channels because we figured there's no other reason why you're sending this thing money. And we joined forces with Kinext to work on the hub. So now I was going to ship payment channels, but then I got hacked. So the hack. We lost $40,000. We got it all back and we made a friend. So this was the post that we published in the aftermath of the hack. So the hack exploited a re-entrancy bug and an integer overflow, which allowed the hacker to call back into the withdrawal function and basically give themselves all of the money. It wasn't quite the withdrawal function. It was a function that allowed them to exit a channel that had not been joined by the counterparty, but they opened the channel and then exited the channel that had not been joined. But that function, they called back into it because it only deleted the on-chain data about the balances after the transaction had been sent. And in the course of sending the token transfer, the actual token contract was not what we thought it was. It called back into the function and gave the attacker all our money. There was another bug. So when I called the attacker up, I said, you know, I'm gonna be in Sole Money, so you have Spank Chain. Do you know why I'm calling? Said, yes, a little bit nervous. So from there, I said, you know, congratulations on being the real winner of the EthSF hackathon. Very impressed with your work. Can I have all my money back? If you give it back, I'll give you a $5,000 reward for your contribution to exposing our vulnerabilities, which we really appreciate. And they said that seems reasonable, texted me the private key. And then they said, well, actually, there's another bug in your contract, and that will allow me to get back the 4,000 booty, which is our stablecoin. Peg to a dollar, get it, booty, peg, right? So they said, yeah, we'll get you 4,000 booty back. And I said, well, if this person can get the booty, then somebody else can get the booty. And my plan involved getting everybody back online, and I was like, okay, fuck it. Let's let this person do it. And I said, look, if you can get this back within 24 hours, I will pay you the dollar price, $4,000 for it. And within an hour, actually, 65 minutes later, I had my 4,000 booty, so I sent them 4,000 ETH, and I called them back up to say, hey, pleasure doing business with you. And they were kind enough to do pro bono audits of two of our other contracts too. They didn't find any vulnerabilities in the spank bank and gave me some notes on the mallic dow, so that was cool. So in the aftermath connects, we worked together, they prepared a transparency report, and we did in-depth, full-team, line-by-line audit to the contracts and hub systems every day for several hours, and identified 10 total attack vectors and published all of it as part of the transparency report. This is what it means to be in production, guys. Get ready. So then we did a reboot. We decided to rewrite the contracts from scratch, and we made significant improvements to our UX while we were doing it, and this was a combined team effort of Kinext, QCAN, and SpankChain all working together for the last two weeks, nonstop. We were trying to get it done by DEF CON. We figured if we code nonstop between now and DEF CON, there's some chance that we'll ship this by DEF CON, and then we got pretty far, but we will probably have to ship it next week. So we did the reboot. Couple things that I wanna go over on the reboot because they're really cool. So before, we had a payment channel system, right? And payment channel systems, you open a channel, you join a channel, sort of, everybody knows this sort of standard flow, but we reimagined it, because we'd been dealing with this for a while, and there was a bunch of really annoying user flows. So, for example, when the user wanted to deposit money into the channel, they would have to call the create channel function, and then the hub would wait until it saw that happen, and keeping in mind that we wait several block confirmations, like five block confirmations, so it's not just like 15 seconds, it's like a minute and a half, right? And then after that, the hub would join the channel, and then they would deposit the money and do an exchange. So that took several minutes of waiting for the user, right? Another annoying flow was, especially more annoying, for the performer. When the performer wanted to join a channel, they would also have to call create channel, and the performers don't have any eth, and they're not supposed to have any eth, they're the ones getting paid, so they shouldn't have to, and so we actually ended up writing a little bot that when the performer was about to start a show, we would send them a small amount of ether so that they would then be able to open the channel, and that was crazy, and then we would join it, and then the performer withdrawal was even worse. So when the performers wanted to withdraw, especially in the upgraded version, they earned booty because we used Finney, denominated eth in production for a while, and then we, I don't know if you guys have been paying attention, I know we're not supposed to talk about prices and stuff, but everything crashed miserably for the entire year, and so anybody who had any money on Spank Chain lost a bunch of it, and that sucked, and so we realized stable coins are actually really helpful. So performers, we started earning in booty, and then when they cash out, they wanna cash out in eth, so they can send it to whatever exchange and get it in their bank, but the process of going from booty in your channel to eth in a wallet was really annoying because you had to either close, there was a couple ways of doing it, you could close the channel, and then you'd have the booty, and then you would send that to the hub, and the hub would give you back eth, or you would wait for the hub to deposit eth into the channel, and then you would swap in the channel, and then you would close it, but then the next time, you would still have to go through that process of creating the channel and joining the channel again, and it was a mess, and so what we ended up being able to do is get every combination of deposits, withdrawals, and exchange in a single on-chain transaction. So performers, when they want to start a show now, they just sign a thing, and the hub will deposit into their channel directly, one transaction, they don't need any eth. So for every operation that is not the user depositing into their own channel to fund it, the hub will be able to do it so long as they have a user signature, and that keeps things in sync, and that's gonna be a much better model, and I'm really excited to launch it. So also wanted to announce our decentralized exchange, which will be called Come Swap. I'm gonna give a demo of this actually in a second, and I wanna talk about the future. Other things that we're building, affiliate system with instant payouts, another great use for payment channels, we're very excited to integrate with the NoSysSafe Multi-Sig Wallet, and we're looking for partnerships for fiat off-ramps so that performers can earn booty in a channel and then spend it with a card because then they don't need a bank, and then we win. And this is, I don't know if you guys all saw this, but we're also very interested in entering the crypto-telladel-donic space and using the work that TeamDaddy made in the status hackathon. That is a dildo that he is holding on stage, which is controlled by the Ethereum mainnet. I'm like, yeah, it's pretty cool. So let me show you guys something neat. This is gonna be our exchange interface, simplest ever exchange interface, best UX on Earth. You push the button, you get what you want. Here's how it works. As you increase, oh, you can't see them shooting out of the card because the resolution is whack. But normally what you'd see is the little globules would shoot out of the card. And then they'd make this big glob. And then when you hit confirm, it pulsates for a second, and then it disappears. I was trying to get it to coagulate and then drip, but we're limited by the technology. All right, so that's all I got. And now I'd like to invite Arjun up and here's his presentation. Cool. Thank you. Hello, hello. I'm Arjun. I am the founder of Connect. We worked with SpengChain. We're going to continue to work with SpengChain for obvious reasons. I'm gonna zoom out and give it a little bit of context about everything that we're doing. And then that way you can see where we are now and where we want to be in the future. One thing that we sort of asked ourselves when we started working in this industry was if in a year or two years every single thing that we do in scaling becomes obsolete, which it will, what is the point of doing scaling research in the first place? Or at least building scaling systems right now? And the truth is that there are a set of problems that can be solved immediately that are associated with the things that you cannot do in the world right now. SpengChain is a great example of this, right? Doing instant peer-to-peer payments for the adult industry was not really possible. Doing payments for the adult industry was really, really difficult and now we can do them. So what can't legacy financial systems do? Legacy financial systems can't do very, very small things. Legacy financial systems can't serve high-risk users and they can't really do peer-to-peer. Anything that you guys can think of that falls under these things, please come talk to us because we're really interested in figuring out how to help. What is KNEX? A lot of people think that we're like a subset of SpengChain. It makes sense because we've been working together so closely for so long. Really what we are is just open source unopinionated infrastructure for scaling, specifically for scaling micro payments. We want to help the projects that have this problem today and collect data and hopefully money to be able to solve the scaling problems in the future. Jeff Coleman is definitely gonna disagree with me on this but I really do think there is a ton of value in doing experimentation and actually collecting real user data. This is sort of a view that Amina and I share and a big part of the reason why we're working together. So what did we learn from SpengChain? We partnered up really closely with them and there were some really phenomenal things that came out of it. One of the biggest things was that the adult industry is really, really cool. It's really an awesome space. They are very, very open-minded, very willing to learn new things and most importantly, there are a ton of problems that exist over there that can be solved by crypto and solved by blockchain in general. Highly recommend you guys check it out if you don't already. The second thing that we learned and again, I'm sorry, counterfactual guys and all of the other researchers but so there is a lot of theory in scaling research and it's really incredibly valuable to do these exercises and learn what sorts of things are possible within a logical framework. The thing that happens though is that when you put this stuff on mainnet, when you put it in front of real users, almost all of it breaks. We went through, I mean, didn't mention this but we actually also between implementation three and implementation four went through three rewrites of the framework that we wanted to work with and we as Connects sort of initially came to Spank Chain with like, hey, we've already built this whole thing, like why don't you guys just integrate it and none of it would have made sense, like literally none of it. And the reason that that happens is because your users are crazy. They don't really do any of the things that you expect them to do. They have entirely different needs and most of the time they don't fully understand your system and so until you spend a bunch of time working with them, until you spend a bunch of time collecting data from them, you don't really realize that, oh, you know, for instance, users really don't care about paying 10 extra cents of gas costs but they do care about coming back online to sign transactions. Turns out signing transactions leads to like a huge drop off. Paying gas, most of them really don't mind that much. The last thing that we learned was, actually, I think I covered it. Yeah, I'm fine. So what's next? We sort of did this thing with Spank Chain where we worked on figuring out what one node would look like. How do you solve micropayments for one ecosystem that has a bunch of users clustered around it? Now the goal is to go from one to n. So basically copy pasting this same framework in a bunch of different places and then connecting all of it into a network. You can see here we have wallets connected to channel managers which are contracts connected to hubs. This is how our existing system works. Normally at this point it's also connected to another wallet and then two wallets can pay each other but there's no real reason why you can't take pretty much exactly what we have right now and just keep going with it, adding more and more hubs to the mix until they're not really hubs anymore, they're nodes and this looks a lot more like lightning or radiance. We think that this is really valuable because the user experience that we wanna deliver is you wake up in the morning, you put 50 die or something like, or maybe booty actually, you put 50 booty onto your wallet into like a daily spending account, like a checking account or something like that and then you never pay gas again. You can earn money, you can spend money pretty much anywhere, you never actually have to pay gas until you withdraw your funds at the end of the day. So, we actually had two announcements. So I appreciate Ken sort of alluding to them but we did have two announcements that we're really excited to do. The second announcement is that we're officially partnering up. This is probably not really surprising to anybody who especially the people who thought that we were the same organization this whole time but we have partnered up. The way that this partnership works is we've actually done an ownership swap. We now own a certain percentage of Spank Chain and Spank Chain now owns a certain percentage of us. We both think that this is a really, really cool way to incentivize mutual collaboration in the future. More projects should do this in order to stay aligned. We really want to see Spank Chain succeed and Spank Chain really wants to see us succeed. How does it shake out? Spank Chain is going to go and focus on all of the node bits basically optimizing the user experience, optimizing how all of the amazing things that you can do as a single node in our network and we are gonna go build the rest of the network. So optimizing on how we can connect all of the nodes to each other. So you could kind of think of it as like, you know, sort of like one hub and then many hubs and then we're sort of the shit that is in between. Yeah. We're really incredibly excited to be working on this and incredibly happy to be up here sort of letting you guys know that this is our plan in the future. We're open source, we're free infrastructure, we don't have a token, we just want to figure out this problem and we wanna figure out this problem and use the data that we get from this problem to figure out many, many other problems in the future. So if you have an interest, please, please, please reach out to us. Please go check out Spank Chain. If you haven't already, they literally have the best user experience in crypto. They're also one of the only companies that is like has real users and is struggling with the real problems that come with having real users. And I think that that is all I've got. Yeah. Thank you very much. I'm very curious about, I think like there have been many talk about projects like merger or acquisition, takeover, et cetera. How do you guys decide that like organically cross ownership evaluation at that point? Yeah, that's a good question. We sort of just kind of like met up at a means house one day and we're like, we really wanna do this and sort of decided what would be a fair price for both. And like one of the great things about like doing this kind of a swap is like we both wanna see each other succeed. So neither of us is really incentivized to screw each other over. But that was basically what went into it. More deals should be done like that, by the way, just hanging out at someone's house in general. Yeah. My investment thesis was like invest in all the things that use state channels. And so we as a company, in working together we can work with the teams that we know are going to deliver. And we know that if they can deliver something for us then they'll be able to deliver something for everybody else. And regarding the numbers, I mean it's like any negotiation, you pick a number that makes you both happy and then move on with your lives.