New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

DappHub

DevconSun, Oct 7, 2018, 12:00 AM

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more. https://archive.devcon.org/archive/watch/3/dapphub Since its formation, DappHub has focused its attention on making blockchain development an ergonomic and efficient experience. We built our reputation on this topic by first creating a popular Ethereum development tool called Dapple. In the last year, our research has begun to produce significant results. This talk will be about the different tools that DappHub has created to add usability to the Ethereum blockchain. Speaker(s): Andy Milenius Skill level: Intermediate Track: Developer Infrastructure Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon 3 was held in Cancún, Mexico on Nov 1 - 4, 2017 Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

Transcript

so I'm going to be talking about DAP hub what is Dabba Dabba is a self-organizing network of logicians research researchers designers and developers who have come together to think rigorously about gaps from first principles you could say that we are trying to solve the root problems that need to be solved before any interesting gaps can be created you're very inspired by the UNIX design philosophy to sum it up simply the UNIX design philosophy encourages developers to write programs that do one thing and do it well and to write programs that work together this is this philosophy underpins all of the UNIX operating system and it essentially is a philosophy of modularity creating small components laser focusing on them until they are right and then assembling them together and composing them to higher order systems these are not new ideas what I'm talking about right now is a proven approach to design and particularly it is something that we think it is a design philosophy that we think is underappreciated in the world of blockchains both on and off chain we are also inspired by the free software movement we think that the free software movement is the most important cultural predecessor to the modern day Renaissance in decentralized technology and because of this when we look out in the world and we see interesting dabs that unfortunately use have useless tokens that have been added we consider it a call to action we don't like useless tokens and we like free dabs and at a pub we are committed to freeing dabs from useless tokens yeah I knew that be popular today when people talk to the proprietors of these useless tokens they say aren't you worried somebody's gonna fork your project and remove the useless token it is my hope that in the future they will ask aren't you worried that a pub is going to fork your project and remove the useless token this is a moral issue it's something that we feel strongly about so you mark my words we are here on this earth to do this we are here to free the dabs we believe in free software in line with the goals of the free software movement we have created an ergonomic etherium tool chain to empower hackers everywhere we originally created it for our own purposes particularly during the development of maker Dow a stable coin project that I'm gonna be talking about tomorrow which you should tune into but we share these tools using the NYX package manager no unfortunately yeah give it up for the next package manager for those of you who don't know unfortunately I don't have any time to talk about it but I will tease it with this society is just beginning to feel the effects of immutable hash based data structures from get to block chains to ipfs it is clear this method of organizing data is having profound effects on the way that we think about computers and applications Nix OS and the NYX package manager is what happens when you combine Linux with immutable hash based data structures and I will leave it at that so on to the tools what do we distribute the first one is called Seth Seth is the ethereum Swiss Army knife if you it helps you use the etherium api if you've ever used the etherium api you know that it's a bit of a pain it's got curl it's got post you have to memorize all these RPC methods it's annoying using Seth makes it delightful if I wanted to send a function call to a smart contract using the etherium RPC right now it would be curl blah blah blah - ex blah blah blah encoding blah blah blah is horrible with Seth it's Seth send address function name parameters boom you're off to the races it's that simple it reads like prose is delightful if you want to read from the blockchain it's s T X hash boom and it's out there you can output it as plain text you can output it as JSON you can filter by field these tools they work together you can compose this into a more interesting tool on top the next tools I'm going to describe build on top of stuff I'd make her doubt we build many we build our entire feed infrastructure on top of Seth if you're doing anything interesting on the blockchain that's reading information from the blockchain and using it on the command line I guarantee Seth will make your life easier I encourage you to look into it if you want to get logs from a contract Seth logs address there they are if you wanted to stay alive in report logs as they come in - - follow up you can compose some commands here we have Seth sin address value sub shell and a nice little conversion function isn't annoying going from eath to way sometimes the next tool is called dap dap is our developer multi-tool it helps us use solidity and helps us develop taps tap build invokes the solidity compiler the C++ compiler which is very fast as possible you're not used to using it you'll be shocked by how fast it is is much faster than the JavaScript compiler and if you're in a hurry to make a DAP I you really want to invoke the C++ solidity compiler it has testing here's a native solidity unit test runner if you don't want to switch to some other programming language to write your tests you want to keep that context on solidity you can write your tests in solidity and it has stack traces isn't that nice never had stack traces before it's solidity so it makes debugging much much easier and it runs your tests really fast I'm talking 150 tests in under a second easy and the reason how to run them so fast is because it has its own e own oh I'm sorry all right talk about that as dap create deb create similar sort of trying to make using the etherium api a little bit more prosaic we've got debt if you want to deploy adapt to the blockchain it's damp create type name parameters boom you can see us using Seth in the background there like I said these tools they build on top of each other this is the UNIX design philosophy in action people is very very nice way to build on top of your previous achievements by making things modular like I was saying the reason that tap runs its test so fast is because it uses something called H EVM under the hood which is a Haskell EVM execution environment we created a chi VM for a few different reasons mainly around verification we're gonna link it up to other interesting haskell verification tools like quick check but what i'm showing you here is that it has an interactive solidity debugger you want to step through solidity functions on the command line you can do so with snap using H EVM under the hood up top you see all of the instructions as they get executed super cool super interesting and last is dab sus it's been the rest of my time talking about dab sis this is our provable standard library of smart contract building blocks a ton of useful stuff here and the reason I say it's provable is because it was built with an eye towards formal verification it is the truth but not all contracts are equally provable you have to build with the expectation that it will be verified in the future and that is what we've done with taps us a lot of it it's gonna sound familiar to what I've been saying so far you have to make them really really small easily isolate able so you can check their invariance and then it can slot into a larger system the UNIX design philosophy this is a proven approach to design I told you this appears here in deficits there's a ton of useful building blocks here I could honestly have a whole talk about each one of these I'm gonna talk about two today but first let's talk about deficits at a high level at a high level there are two main types of DAPs this packages boxes and mix-ins mix-ins will appear very familiar to you these are base classes you mix them in to your adapt logic to get access to interesting functions and modifiers here my DAP is mixing in D s and D s math D s auth is providing access to this off modifier and D s math is providing access to this w mul function I don't have any time to talk about D s math but what I can tell you is that this is a very interesting safe math library probably the most interesting safe math library in the business it does not just do overflow protection it does interesting types of token mathematics and that's what W mall is doing there he's second high-level idea our boxes this is a concept that we've invented to describe safe prefabricated components that you take directly off the shelf and put onto the blockchain without modifying them you think of them as boxes again I'm reusing metaphors here but what we're doing is we're taking components putting them on the blockchain taking more components and we're wiring them up it actually looks a lot like hardware design ma pre fabricated components and wiring them up into the apps that was that's what we've got here on the slide we've got a bunch of boxes that have been wired up into an interesting gap most of maker Dow is made up of boxes that have been wired together there's actually relatively little custom code when you look at the whole thing you don't need to write that much and you don't need to change the code you don't need to inherit from it and add in your own logic you just take it off the shelf put it right onto the blockchain so let's talk about a mixin and then let's talk about a box that enables this right here is the DES auth mixin if you don't take anything else away from this talk please consider using TS off so that means wake up in the back if you're not paying attention this is the only thing that is truly important in this entire talk D s off is a mixin that allows you to abstract your authorization logic away from your taps business logic what I mean by that is that your DAP can just focus on whatever it was created to do and it doesn't need to think about who is allowed to call it Y when or how and the way that it does this is by providing a DES thority object all des off types provided es Authority member deeza thority is an interface just like ER c20 is an interface it's a function that different boxes are expected to implement and that function is can call can call will respond true or false if the pram the source can call the death of function on the destination so here we've got Bob calling the finalized function on the auction and the auction as its des authority box if Bob can call the finalize function on the auction and the DSO authority will respond true or false based on any arbitrary business logic and this is what makes it interesting and this is what makes it important because that business logic could be as simple or complex as you want look at all this business logic the DSO thority could be a simple whitelist bob can call finalize it could be a time-locked whitelist bob can call finalize in two days it could be a role based permissioning system we have one of those indexes bob is a member of group one which can't call finalized or and this is where it gets interesting Bob can call finalized in two days unless the token holders veto him what I'm saying here is that des Authority moves the conversation forward on governance this is blockchain governance right here this is what you're looking at your dabs are your tabs and your governance is your governance and your governance is the DES Authority interface if the entire community converges on can call that's it just can call I promise you 2017 will have been a good year for blockchain governance this is a Germain idea this is a new idea and if we can think in this way abstracting authorization away from governance we will move significantly beyond the only owner modifier and we can start using the off modifier this is a big deal and I'm gonna show thank you this is a big deal this is blockchain governance right here dsr write that down and I'm gonna show you now a box that is enabled by DSR that is the DES token box D s token as you can imagine is a token it's an ER C 20 and it is of type D s off and the reason that is of type T s off is because it has four new functions stop which stops token transfers start which restarts token transfers mint which creates new tokens for the caller and burn which removes the callers tokens lowering total supply we have thought about tokens for a long time at a pub this is we're one of the most senior teams and all of its here Ian we've thought about tokens basically as long as a theorem has existed and we have decided based on our love of the UNIX design philosophy and our own needs in maker Dow that this covers the entirety of the token use case because what l'm staying here up here on stage to say is let tokens show us to be tokens just have them be tokens they're just a database of token balances they can only do a few things and here we can see this diagram but they can still be interesting parts of depths right we've got Bob here calling his claim reward function the distributor is authorized to mint tokens on mint tokens and distribute them to Bob right we've got fancy things we've got fancy business logic it's just not in the token contract and when you make a token contract only a token contract but you still make it flexible with DES often these extended functionality you can have interesting things you can think about tokens in better ways let me show you an old way that we used to think about tokens we used to think about tokens kind of in this front-end controller a datastore model this is a very common model to think about tokens it was called the upgradable token so what you had was you had your static front-end you had your static token datastore and then you had your controller which had some sort touken business logic whatever your token did in this case it's doing voting and then you would call the controller and sometimes you'd swap it out when you wanted to update the functionality the hope that you wouldn't swap out the data store but you can't merely make that promise when you're looking at something like this right you can't provably make that promise when you have everything quite so dynamic right we want to make credible promises to our stakeholders provable promises to our stakeholders and not only that this is too complicated this thing is huge waste gas and it's not being a token it's being a bunch of stuff it's difficult to reason about let's look at voting in a much easier way the box mentality here we have Bob calling vote on the voting box and it's just pulling tokens it's just pulling tokens into its box and holding them is literally like a ballot box I mean look at this thing it pulls the tokens it counts the votes when everybody's done voting it releases the tokens much much better way to vote the token is a token the voting box is the voting box and look the voting box can be an authority right this is what I'm talking about when I talk about token governance it can be a DES thority for an entire system of taps and not only that it can be a DSO thority for the token you can make a cycle here where the token holders are governing the authority that controls the mint burn start and stop functions on themselves it's like a cycle because they're governing their own token that's neat that's cool that pushes the conversation about token governance forward and that's what we do at a pub if you're interested in this type of stuff if you're interested in formal verification if you're interested in that old-school hacker mentality and aesthetic I recommend that you come and introduce yourself come to da pub comm all the links are there check out our tools check out our chat tap pub chat but a lot of interesting stuff we are here to create free software for tap tubs thank you you [Music]

Automatic transcript — names and jargon may be misspelled.