Building Walletless Apps - Christopher Brown
ETHGlobal·Fri, Oct 9, 2020, 12:00 AM
Building Walletless Apps with Christopher Brown from Zabo
Transcript
so I'm Christopher I just wanted to you know when uh when I was asked about the discussion today I felt like the best way to talk about the topic that I wanted to bring up and not totally shills a bow is it's through just good system architecture design and software development are any of you guys computer science students okay yeah so this is kind of more of a high-level lecture on just good software development real quick just to introduce myself I co-founded Zhou Bo with will and Alex Alex and I are based in Dallas Fort Worth Texas wills actually in Toronto and then Davi is here also and he's he resides down in Brazil and then Fred is another core developer of ours and he's in New Hampshire so we're a little bit spread out but we come together at ed events like this when we can and kind of discuss things face to face so talking about wallet list apps really to kind of get to that point where you have this idea of not worrying about wallet architecture itself is you really have to pay attention to these fundamental system design principles of abstraction and encapsulation and then ultimately to get a product out there it's basically built draft build and iterate because the bottom line is if it doesn't operate it doesn't matter and really what this kind of the the mental framework that you have to develop is you got to get something out the door and sooner than later to start getting that feedback you cannot really anticipate all of the problems that you're going to have in an application for yourself and the development process and for the user until you've actually developed something that you plan on using and a user has actually used what you built it's just there's too many variables edge cases to really kind of frame this in the way that it needs and so of course the first thing I want to start with is abstraction and this is this is kind of textbook right here with software is when you think of a house right you don't really think of it in this context there's a lot of detail here and if you build a module in your software component where you're dealing with low-level structures and custom building the whole thing you're gonna get bogged down and that products are not gonna get out the door because there's too many details and variable there's a matter you need a whole team and if you're a start-up you don't have a whole team and so what we do with good kind of architecture and system design is we abstract a lot of the details so this is where we're using open source libraries and when we can and we don't have to know that the door is made of wood and then what green and what what kind of material is involved in that process we just know that there's a house and it's got a door and that door can have two two states it can be open or closed that's all we need to know right so we don't need to know all of these kind of details and so to parlay that in our crypto ecosystem this is the problem that we have with tokens right so there's tokens and they all have different properties some of them are er c20 some of them reside in like an account state on the chain like a third ether itself you've got Bitcoin Bitcoin cash these you TXO coins and then you've got different characteristics of coins like zero-knowledge coins and you know just different bleeding edge kind of technologies that we're developing abstraction helps us ignore all the details unless you're particularly developing like a privacy application that needs the properties of a specific token your application really needs to be able to abstract as much of this as a can and and the way that we think of this in zaba itself is this is just crypto and we categorized a crypto in different ways we've got four categories for instance you got you TXO you've got a count based and you got er c 20 and i forget the 4th the the idea is we go from this scenario where we have to pay attention and mentally comprehend all of these details to where we can abstract it enough in a module that we just need to know what what the states are of the of the higher class right and so it reduces complexity and abstraction helps us bring something that's generally unmanageable into a manageable place I guess have you guys experienced this yourselves in in a development process with an application of not really kind of abstracting enough yeah in it and it really holds back development right you it's it's tough until you can abstract what you need and then move on to the piece that uses it and then and then the one one last point on this is there's different levels of abstraction right so like on the door we hear we've abstracted the doorknob at a level and then the doorknob is part of the door and so we've got a door abstraction a doorknob abstraction and then that itself is part of the house right so it's it's making sure that we can we can put these layers in a comprehensible manner which brings me into encapsulation so encapsulation is the ability to wear abstraction tells us what level of detail we define at a certain layer encapsulation tells us the level of detail that we cannot define at a certain layer come on in yeah now what's your name what it Arthur yeah all right cool nice to meet you so encapsulation is that process where we draw boundaries around that abstraction so we say this is a house and this is a door and and the abstraction says this is the door and you don't need to pay attention anything else encapsulation says you're not allowed to pay attention to anything else so even if you wanted to know what it was made of we're not gonna let you know that if you want to know that you need to go into the module itself and find out and build within the module because outside outside of this module nothing else cares what that door is made of up here in the public interface all we care about is whether that door is open or closed and so once we properly abstract at a layer and we expose that that layer that we need to up top then we can use it without having to worry about introducing new bugs having a domino effect because this kind of all leads into the idea that if you don't abstract correctly at a layer and you don't encapsulate it then your software really becomes a house of cards very quickly because a single change over here if it's got four or five contact points over here and then those each have four or five contact points over here there's 25 potential contact points that your software will fall apart that you need to go now bug hunt and so again kind of bring that into the crypto space is the number of wallets that we have in the ecosystem so right now your choice as an application developer is you can just basically build your own wallet and then back your app with it and that gives you the one interface into the crypto ecosystem that you need but we know that there's a lot of external wallets that users are holding the crypto in and those are things like coinbase finance Biff and X and then you got ledger treasurer made a mask so if you want it if you want to encourage those users to come into your app in a friction-free way without asking them to adopt another brand new wallet then you're left with a challenge of having an interface with all these and as a sub-module that doesn't really help us encapsulate the crypto wallet ecosystem that we need to encapsulate because now we've got to build an interface for each one of these and then add that to our app and if our app is user facing and it's not a it's not a business development facing or a programmer facing system then this is very difficult to do because one if you're developing your own wallet wallet development is non-trivial made a mask it has been under development for since the beginning and they're still iterating on it and building it and there and there's a team dedicated to that one piece and so you either have to build a internally to handle that one piece or you have to build a team internally to handle all these pieces and so that really drives up the entropy inside of your application but with all that said here's here's the most important part as a developer especially developing an application from scratch with the startup team is this idea of just drafting an application building it and iterating and this is done in a very brute-force way there's one quote one fact one fact that I was gonna introduce hey how's it going so I was we were just talking about kind of like system software design kind of talked about abstracting a certain layers and then encapsulation in those layers and then just kind of the process of building an application itself you have to you have to cross the finish line no matter how ugly it is because if it doesn't operate then then the work doesn't matter that's one thing that's a hard lesson you that you learn at a hackathon if if you're staying up all night Friday and all night Saturday and it doesn't get submitted by the deadline on Sunday then your all-nighters didn't matter because judges aren't gonna see it you might get a look or two on DEF posts afterwards if you go ahead and post it anyway but overall you just gotta cross the finish line with a feature just something that operates from start to finish and so it's really important that the abstraction and encapsulation is important as you get down the line but upfront just getting something finished a fun fact is the first description of a binary search algorithm was published in 1946 but it took 16 years for someone to actually publish an algorithm that correctly searched lists of all sizes after that so even though there was this binary search you know sexy algorithm that was kind of like drafted in 46 for 16 years after that you still just had to make do with just a sequential search and most of the time of sequential searches is fine and then we can also see this in in development of like eath 1.0 versus East 2.0 we you know we hear about all the complaints of aetherium and it's not scalable you know and all these problems but the fact is is a theory in 1.0 is exactly this it's getting something done and putting something out there now if you decided you were going to invest you you know a non-trivial amount of money into the system expecting adapts to take off with the scaling that eath one has potential for then that was on you to make that decision right as developers I think we want to make sure we we have an end goal for a good product which is what eath 2 is but before that we just have to accept this system is not going to work the greatest but it gets out the door and it gives you something to hang your hat on and it's better than nothing and again the idea is you can't understand all of the problems until you've experienced a proposed solution so you can't go from 0 to 1 and and handle those problems on 0 you have to have something so that a user can can actually touch it and and help you figure out the problems and the same thing for developing so I'll give my my speech on Java so what we do is ah Bo is this whole abstraction encapsulation of like crypto and crypto wallets we make it so that you have a single interface to get into any wallet so we've got 3 functions that are basically of paramount importance we've got get transactions to get balances in a send transaction and each one of those functions you look like in the sin transaction you define the currency in the amount and behind the scenes in this in our system we translate it to wherever it needs to go so you don't have to have an opinion on what kind of wallet or currency your users trying to connect I thought I had another slide on that maybe not I'll leave I'll leave up here though for for viewing purposes but your user could hook up a ledger with Bitcoin in it and our functions will transfer that Bitcoin if you request just the same as if they connected a coin base account with Bitcoin cash it's the same function to operate on those currencies your user could also connect a meta mask with ether or an ER c20 token and we can do the same things your function calls don't change at all it's the same interface and everything is translated under the hood so if it's going into a Bitcoin node we find the UT EXO chain and we translate it and we send it to the Bitcoin node if it's going to coinbase we we have the coin base API and ungraded we translate it to to fit their API and send it to them we have an entire team dedicated around this piece of wallet and currency integration and that whole piece that I that I said and again you know it's up to you as far as like determining your stack but without something like that you really have to either a accept a very limited scope of crypto users such as made a mask for instance or you can develop for the wider crypto ecosystem 80% of crypto holders are holding Bitcoin right now right so we cross chains we cross wallets custodial non-custodial we operate decentralized and centralized so the same API that I just said if you call send transaction and somebody's connected a coin base API your user could show up with an aetherium node running and the API will connect to that node in a decentralized fashion and it will operate sending transactions to getting information from that node just as if you had connected directly via RPC we handle that under the under the hood and so yeah so these are the rewards that we have these are some of the use cases that we have determined that we think Szabo would be really good for and we're offering rewards not asking for any freebies here so this is our information we're in the eighth Waterloo discord we also have our own discord channel too there's my information and just to kind of summarize for the guys that came in basically with the discussion of was over all about was extraction encapsulation and then draft bill to iterate being able to build abstraction zat proper layers because this is unmanageable and too complex right we usually want to know if like if there's a door we want to know if it's open or closed we don't need to know the what the doors made of and you know what kind of doorknob it has encapsulation is putting boundaries around that abstraction so being able to encapsulate these so they don't affect every other part of the system and only exposing what needs to be exposed and this is the problem that we have now if you're going to develop an app that's going to properly bring in every single thing in the ecosystem you've got to build approximately 83 interfaces or you can build something that can expose a single interface that gets into those and that's what we do is although and then the idea behind this is just getting something out the door so it's this one of the key concepts with a hackathon is like brute force attacking an application development and finishing it from start to finish and then if you have time to clean it up clean it up and that's all I got you guys have any any questions or comments I'm sure you guys have experienced mistakes in all of those areas at some point even outside of crypto yeah let me so let me show you real quick how the user experience looks on this I think so we've got a fairly basic demo that's actually a little bit outdated just because of recent updates on our server but this should work so the idea is in your app you have you have an interactive element so in this case it's a button and so your user gets the get connects at and then they figure out which wallet they want to connect and then we can connect any one of these wallets and so like for instance Gemini's one where it's a once they hit that we give them the scopes this is this is decided inside of your dashboard as an app developer so as an app developer you can say well no a user connects I only want to do these I don't want to do that or I guess this is only read but we have like sending sending crypto and depositing crypto scopes and so the user approves those and then Jim and I we got user name password they submit and then once that works it gets sent back to get sent back to your application and then your application receives a JSON like this so in that account you know we give you like the wallet provider information what scopes you have in that and then the currencies and the balances of those currencies and then so that's that's nice you know cool we can connect Gemini but with no change in the code in the application you can go in and interface with any one of these other wallets so I can connect a main a mask and I'll go through I think I've already connected mine yeah and it'll send back with so I got status in there spank okay so this is not this is not my spank token this is uh this is rink B okay so we created so we've got about 75 gr C 20 tokens that we've created on rank B for Zhou Bo specifically for development and testing and that's all those currencies and as you saw so I just went I connected to Gemini and gave you the account information the same code just connected I made a mask and gate got that information and then I can connect any of those wallets and do the same thing so we normalize the data structure in and out yeah so yeah so we had to two primary objectives in that respect one we want to make sure that the developer could do that programmatically so that you don't have to like manually determine when it all is connected to what scopes you have so that's why we give you this scopes array in the application right so with the main MS connection I have all these scopes available to me if wallet gets connected and that wallet won't allow you to send crypto for instance that will be missing so you can programmatically detect that and then adjust your app accordingly when we know what the user has provided a wallet that doesn't have that scope but for manual review we do offer this list and then you can click like on coinbase and then we give you the information so you can manually review each wallet but again you know - like manually kind of micromanage every connection and all that is really difficult yeah yeah exactly yeah yes the coin base is one that we can't transfer out of we can transfer into but like finance if you're allowed to have a finance account can sync cryptocurrency for finance yeah we do have the API key method we're trying to expand our scope on the login method like we have with Gemini so coinbase is Oh auth Gemini is login and then the rest of them I think we might have one more that's login but the rest of them are API key but as a company gains leverage we're hoping to establish some partnerships so that we can just expand the login method as much as possible great anything else questions cool are you guys are y'all building a hack here and submitting it on undef post and everything or yeah are you on a team or are you on the team or anything or just solo yeah I did a solo in Heath Berlin it was I mean the the hack was successful but I fell asleep so I was working with so the truffle team and the Viper team were both working on eath p.m.
packet management and I worked with that so Nick truffle Nick was doing the js8 p.m. for truffle and the Viper Nick was doing the eath p.m. for Viper and then I was doing the golang implementation and I finished it at like 7 o'clock Sunday morning and then I decided I was going to go take a nap and then I slept there judging and everything yeah so but eath Berlin is my favorite venue I think they got a nice nice venue Denver's got to be the biggest one I guess this one is actually pretty nice so features kind of the login method is one thing that we want to expand and then yeah I mean with the getting the transactions ending was a big one and we got that implemented just recently so I would say over the next six months our major push is really kind of so a lot of our developments gone into the sandbox side of things and we've got we've got the live of available but it's like manual you know immanuel coordination with with the company and the product we don't we don't have them automated switch over into the live server so automating that process so that anybody can go from sandbox alive you know with a few clicks of a button and just hardening that whole system and then and then our ultimate objective is to get as much of the cryptocurrency ecosystem as possible integrated so just expanding the wallets and then expanding the currencies because we feel like our moat our hedge is really going to be around capturing that long tail because you know anybody can do like a coin based API integration and anybody can do a made a mask integration so we think it's like kind of those difficult chains for instance hash graph hash graph asks us to put hadera in in zabo and when they do that you know they get access to any developer that's working on Java at that point and the developers get the benefit of they immediately just extended their applications so if you had Zhou Bo before that you got like Bitcoin and ether and all that and then when we stacked hadera under underneath then you automatically extended your app to accept h bars and so being able to do that with those chains is is really the the feature set I think we're going after yeah so the ape when doing the API key stuff we've got a provisioned encrypted database in a private VPC it's got a single entry point from the the server service that has access to it I'm so that proxies the request from the main server through to that yeah so we're working with a few security partners to you know work with us over time to ensure the security because that is that's probably the most hot-button issue for anybody is like you know what's the security like for API keys so for self custody walls of course we don't extract any kind of actual wallet keys or anything for the for the account like Olaf goes coinbase directly so we don't touch that gym and I also goes with Gemini is Gemini login and we don't retain passwords or emails it's just the API key when somebody's got to put an API is that those go into a provision database that sits off to the side and that we you know really we just have to QA and keep security partners helping us you know in a pin test and all that kind of stuff cool yep yes the wallets yeah so we're we've got a wallet connect on our on our pipeline to get to the mobile wallets basically because while it connect does the those and so we're just going to lay over that protocol yeah yeah yeah cuz it's like a push server implementation that goes into the mobile wallet um the only mobile wallet of course had hasn't Helen wallet connect is is coinbase they've got wallet link and so yeah and these are kind of like protocols to get into the mobile wallets and so we just kind of use those protocols to get to them so they're not available here yet but you know maybe maybe we could do a hack this weekend and get it done at least in the sandbox or something yeah but yeah I definitely want to get the mobile wallets on there
Automatic transcript — names and jargon may be misspelled.