Apache Tuweni - Antoine Toulme - [Toronto Ethereum Developers Meetup]
ETH Toronto Talks · 27 May 2021 · 21:55
Antoine Toulme, an engineer at Splunk and Apache Tuweni, explains why and how the Apache Tuweni library exists. He covers the Apache Software Foundation, how its projects are governed, and why it is a good home for open source work that puts community over code. Tuweni provides building blocks for crypto applications such as wallets, faucets and Ethereum clients.
Speakers
Topics
From ETH Toronto Talks, hosted by ETH Toronto.
Transcript
all right hey hey thanks for coming to my talk um and uh thank you for having me i really appreciate this uh that you're taking the time to have uh people come over and present uh so it's very special for me it's the first time i actually talk about this project i've been working on this project for over two years and today i'm going to show you a little bit not so much what it is doing but why i'm doing it and the way we're going about it um so let's talk a little bit about apache and dismiss this and present it and please let me know if you can see something i'm seeing did you see my purposeful flight thank you
okay so apache 20 why and how so uh the first thing that um in the name is apache like the apache software foundation right and uh in this talk we're going to talk a bit about what that is asf and then we'll talk a little bit about apache 20 coming from a blockchain world but with a library first approach a bunch of applications and if you have clients in the works in a secure scalable client slash server so why and what is the apache software foundation so that's something that if if you know what the apache is of the foundation right now you're on the start you'll be like why is he even talking about this well
most people that are right now in crypto were not born by the time i go to my demo slide i'll show you a you know little arcade video game i was playing when was a kid i'm pretty sure you were not born when that game was made and that tells me everything i need to know right so back in the 90s when i was younger and i had more hair and less beard the apache software foundation was a huge proponent of the open source movement when open source itself was known as a dirty thing now you have to put yourself back when you know professionals who are like coming from microsoft and and others were making fun of netscape and others and saying hey it's just no way it's going to work like those
those bit nicks should not be allowed next to your code right they they're going to run stuff in the kitchen and you're crazy fast forward to today it's everywhere right but imagine back then how would you make this work given that there is a whole ton of headwinds against you people don't trust open source and open source also associated with linux minix has got his gpa license salinating a bunch of people and he's becoming kind of a religious argument so before frame happened there was first a movement that was very much religious around open source and the way they uh really made it work is they moved away from trying to own the the movement and trying to have
control over it and they build a member non-profit and a member own non-profit is very different you know it's based in the us this is delaware but the idea is that um there isn't someone at the apex foundation with a bunch of private keys or with ultimate power of our hearts done there's 800 members and they're elected so you actually get elected for as long as you want to serve right maybe for life and every year they ask you to show up on irc and call into a phone call get into a website and vote for a board and the board is a free and fair election they have to go and run they have to present themselves every year they have to go back and you
know kind of get the the community approval to keep going and the big motto of this thing has been community of a code meaning the code is whatever but without community we're not gonna go anywhere right so imagine that that's back 2003 uh those people are still on freenode if you can imagine that stuff right so it's still all g's of ogs running all sorts of crummy code and running you're still patching the apache http server when you when you want to touch that right so how is the project i'm in governed well the product i mean it's just like every other project apache you have three levels right so you can
come in you can contribute anybody can contribute to a project and send batches you can become a committer or you can become a project management committee member which is kind of a muscle so then we say pmc which looks more precious than it should be right um the really crucial aspect of this is that when you become a committer in an apache project it's attached to you and your person meaning you the person you did a good job you showed the project that it was going to work that it was going to be something that you want to make and move forward therefore your community ship is attached to you you leave your job you go to another job this becomes a staple this is becoming part of you
and you can continue voting on things you can keep contributing batches and you can even vote people into the project right so the the big difference between a just committer and being a pmc is that a pmt you can also uh vote for newcomers right and that's it that's all that whole project is run everything else is consensus so you have votes you have votes on releases you have votes for everything uh from you know decisions about how you're going to go about the architecture which tracker you should use everything has to be done through email now that's where like crypto people are like what no no no discord right and like well we do have a discord we do have a slack
we have rc we are also on a variety of different things but one thing that must happen is that it must happen on the mailing list and it's very reminiscent of in a way of blockchain because it has to be a temp approved on that mail server away from you or it didn't happen right so you get the same like granular aspects of like we want freedom we want no masters we want to have a great community and we want to run by consensus so you can imagine of course that it's uh pretty much drama every day there's always one project on fire and somehow 20 years later everything is still there and it's thriving right so we must be doing something
right and by we i mean i'm seeing everybody else because i don't know what i'm doing so um reports well there is a uh way where you know people actually report data and back to the rest of the community and ideally the members would want to be you know kind of interested what's going on um so how do we know if a project is going well well of course you want to see like hey are you pushing code is this stuff used a bit but that's not really interesting what's really important is are people showing up how many people are on your list is there more people now than a week ago um when was the last time you elected the commuter so it's actually a good health sign is that you keep having more people added to the project
and you're not trying for quality right you're not like oh i got five committers and my project is not shut off from anybody else from joining on the contrary you want more because the more you have the more diverse communities the more healthy your project's going to be committers can drop drop off at any time right you can have a carrot change you can decide if you want to i don't know um take care of goats somewhere in the mountain or move to uh palm beach like uh nick so in that case um no problem so let's make this resilient by having as many uh decentralization as possible right and the more issues files the more you see the project in the world that's better so every three months there's a big where you have to go to a website
web tool that they built um you bring all the stats about your project goes to the board and the board has a three hour phone call where they review the third of the project every month so they have so much work you have no idea it's uh it's really a lot of work for them um so a recap of why why why is that place the right place for a open source project around crypto well it's really open source so it's under apache it's very much like there's a bunch of legal requirements you can't just like ship any code you feel like doing meaning that if there is an actual corporation that wants to be built or using this code they won't get sued that's actually a pretty big deal but it's also really open source um community of a code really big deal
really important because otherwise we can just drop stuff on github right what's different and uh you want to attract commuters for themselves not for the job right so if you have a job and you're working on an apache project i've seen that a lot it's kind of sad it doesn't last very long eventually days down on the line i see a lot of people who stay after who want to continue helping because it becomes part of well this is a project i'm helping with right it's no longer my cooperation project so how all right java 2017 that's when we study all this right so you look around java and i'm pretty sure i'm the only java engineer on this uh on this meeting
tell me i'm wrong how do we do a good job at bringing blockchain solutions to the java ecosystem there are millions of java developers out there does anybody care oh guess what no they don't they're very well employed doing all sorts of crummy stuff in the back and connected to mysql for some you know e-commerce solution that you never heard of and you you know you will not want to see that uh and the ecosystem looks slow like this right it's all over the place right so you have enterprise there's a bunch of oracle very very crummy xml stuff like you know people get paid a lot of money to go do this but it's almost like mainframe management right so now you're doing kabul but you don't know it yet right
um there's all sorts of weird stuff like you know extremely edge technologies and never managed to escape the realm of java like sgi which uh allows you to do modular java where you can like live reload bunch of your code you can do a bunch of stuff nobody knows about this and then there's like bedrock projects that everybody's using but doesn't know about like lucy apache camo uh you also have all the script kitties they're still kind of you know they stay around after their first mrts but they had to run uh their first java servlet and they learn about spring and they're like hey you know it's not so bad they can do a bunch of stuff in springboard and then you have the bigger stem of red hat and jboss that is still there so uh the custom is quite diverse but
and not just that it's missing something you have all you need to succeed right uh you can have in java just like if yeah i'm guessing all of you are doing javascript stuff so npmjs of course we have maven central we had that before you guys showed up right uh and we have like all these these attacks that npm had group ids were already boiled in maven back in 2006. so you always have a way to verify where the artifacts coming from you can't actually do supplier taxes as easily as you can do with go or npm building testing oh my god we got like this stuff figured out like back in 2005 the only thing we've done is keeping more people alive and in a bunch
of companies like sucking on this money to just do more testing stuff right and it's kind of dry by now but it's specified in a nice little manner like it's kind of cute to look at um and one of the big big aspects of java it's really good compatibility between release right so it's never really done the the thing you've seen with python for example between two and three where they killed the community by shoveling a bunch of things around um so it's it's stable you know that if you've done java you can still have a job tomorrow but for blockchain ouch right all of a sudden all the things that you heard from uh from nick just now about the fact it was beating 64-bit well guess why because most
native types would not support those big 256 bit types right so how do we handle this stuff how do we handle bytes even right properly to do all the manipulations you would do with the hashing and all the book stops right uh big numbers how do you do this all the signage and unsigned operations that you have to deal with how do you deal with the fact that crypto and evm are extremely cpu centric and super hungry for your resources but only have one thread and yeah you get never therefore primitives but guess what it's all been redone by blockchain so that's where we come in we're gonna go and give you all bunch of bytes management and based on that now we can go down the stack so we're going to take the rights now we
can take care of unsigned ins now we can take care of all the ethereum types now we can take care of all the including decoding of stuff and so on so forth right and based on that now we can also create applications but instead of having to deal with uh how do i even get flags from command line or how do i deal with an http server i can go much much faster i can create all sorts of cool stuff so for example a wallet is no it's no big deal creating a faucet is just a springboot app right i'll show you that in a second rpx server uh we have bouncy castle we have all the crypto primitives we can do all sorts of security for your connections uh we can create boot node for discovery right so we have that in 20 now
we have a way to do network crawling so we can connect to everybody on your network dump all your data into a sql database and then sneak on you um we have a way to to run uh all sorts of crypto services i have a little hierarchy service that i run where i can do like hashing and coding uh private key generation don't don't use that for your actual private keys because i see all of them um now you can create a different client you can even create a modular frame right and uh why not use secure scott about if you don't know what security's good about is check it out it's kind of cool um i'm not telling you about it though you have to figure figure it out yourself all right so it's demo time it's also a challenge if you look at those pictures while i
share it when i stop it'll be fun for you to figure out what those games are uh hopefully you can see stuff so here is a very simple application and i'm cheating because i'm actually writing not this in java anymore writing is in kotlin right so this is a complete faucet that i've built in using springboot using a whole bunch of spring boot annotations allows me to create a wallet store it creates a vertex server so i can do http create an off service so i can connect to github and make sure that you're
properly authenticated before i give you money and i have all sorts of things there to to manage your state and make sure that everything goes well and all that is five five five five files so very simple stuff that we can do really quickly using all the resources of the jvm right so all my knowledge of my old age of having to troll through all the way java was done still usable as you can still make money from you guys i'm so happy another one really quickly uh here is a block header and here's how you would uh read it from erlp so let's see this one so we're reading from a rp reader and
this is just a bunch of bytes right now we're going to read all those bytes and and read that directly into the reader by having a way to integrate that directly into our flow right so it's pretty seamless uh they would look exactly the same in every other language at this point right just we're trying to build dsls that are close to this and for people who don't know rp uh it's just a way to encode your stuff in ethereum so that is going to be resistant to people you know messing with your bites or messing with your land for things like that so having a way to go over the stream of bytes and make sense of every value coming another one that's kind of cool so we integrated you know remember what i said about cpu and java being really not happy with
each other all right we have a library in c called sodium which is kind of the best ever library if you want to do crypto so we integrated that using jnr which is a java native uh wrapper and now we can do all sorts of interesting things where we can have for example of things around the symmetry keys and things like that and uh so you have now a nice little dsl you can interact with it that gives you nothing but really you're actually using the the product in memory of sodium you're doing all sorts of uh handling of resources in a nice way and all that uh one i did recently is a stratum server so if you wanted to do mining on ethereum or bitcoin or whatever you might want to be open
opening a bunch of connections how would you go about doing that if you don't have anything to like you know all the the networking primitives right so here we're creating the tcp server using vertex we're seeing the port and import interface and then we pass in a couple of different protocols i need to remember they are okay yeah here and then we're able to handle messages and to do here's for example you know mining authorized mining submits having all sorts of ways to pass that back to the back end and we're just using functions to do that so it's all pure function based it can you can integrate that into your actual app if you want to and last one that's actually a nick special because he was
ranting too much about evm so let me show you any vm in kotlin right so here i implemented all the upcodes for the evm using the functional approach that cutling can take it's just closures and uh we have the ability to pass in all sorts of things about the context of how you're executing right so your current gas your stack things like that so i can pop for example elements on my stack add them to each other push them into the stack and that's the result everything's good uh and then we have all sorts of different uh you know operations that we put together all right so that is mostly it and here's where you can learn more questions can you post
that information in the chat surfing awesome thank you for that talk um antoine appreciate it um i think we all definitely appreciate looking into um code i think um so any questions from anyone um eric uh at the beginning was like when to any coin please plucks sorry i was just trolling i know i actually do kind of have a question i mean like i so what what kind of like what's the reason for like donating a project to apache instead of just running the kind of same philosophies and all that
stuff by yourself um that's a great question that's a great question so um the main move is actually if you want to kill the market so if someone was to try to do another you know if young client in java or kotlin you can actually say there's another that's your project for it and the idea is that it becomes a reference in commoditizing the stack anyway because it's really difficult for someone else to come along and try to make money off that right so a lot of the stuff for example i worked at italia back in 2008 we donated the the heart of the pro of the the business the process engine to apache because people stopped giving us crap about hey where is your code at where who are you
right this is just some crappy svn somewhere and uh because we use this vm and uh we we got a whole lot of uh contributors and help from that right so it's also it's it's uh think of this as the you know good old algebra approach where you want to standardize on an approach on things it's a good way to do that so it's a way to engender trust with the community yep yeah and also to get five different companies that don't like each other to work together like apache cassandra for example donated by facebook maintained by rackspace then by apple then by data stacks and all those people you know you put them in the conference room it's probably a cage match but
for this particular project they played along because the goal was to create the best open source software for database management sweet um felipe also had a question um does to any allow to write contracts on the evm instead of using solidity oh dude i want to do that so that's next because now we have the up codes we can actually do that we could actually serialize all the obstacles in the cartoon dsl um fun fact about kotlin they're working on wasn't uh a bailor so maybe we should do something later but yeah not yet all hail wasn't and uh and aiden you you had your hand
up did you have a question um i was just gonna ask something that got answered just in regards to um antoine's experience with apache and what brought him to apache but i think he answered that last last answer but thanks antoine for walking through all of this beyond just the ethereum side of thing but um yeah just everything in in general i think you guys know everything about ethereum so telling you about my old old man dreams that's a good idea all right thank you antoine um appreciate that talk um