All right. Hello everyone. Welcome to delivering back-ends like front-ends with WebAssembly My name is Brooks Townsend. I'm a lead software engineer at Cosmonic And I've been a CNCF wasm cloud maintainer since 2019 even before it was called wasm cloud So I've been doing web assembly stuff on the back end for quite a few years now Serial open-source contributor. I love working with web assembly Especially anything that has to do with rust and I'm a demo enthusiast Of course as you'll get to see today So taking a look at what we're going to talk about I want to go a little bit in the back end of like what is a CDN like why people use them at all Transfer that knowledge into network optimization for back-end applications Diagrams do some demos do some more demos looks more diagrams all like all that good good stuff Try not to bore you too much in the post lunch hour And then really get into like what is all of this really good for and where are we going to go next with some kind of technology like this? So to start I found this really awesome blog to define What is a content delivery network which I trust cloudflare with this kind of stuff at its core? A CDN is a network of servers linked together with the goal of delivering content as quickly cheaply Reliably and securely as possible in this blog It talks about how a CDN is a distributed network of edge nodes That's caching static front-end content as close to the user as possible But it does specifically call out that this isn't a replacement for web hosting in general You still have to have some server somewhere that your assets are coming from that you're running your back end Ultimately the data for your application has to live somewhere Now why do people use CDNs? First of all, they want their application to be quick and they don't want to spend a lot of money on egress costs These are two of the biggest things that people use CDNs for and if you haven't used them explicitly on your own You can compile your static assets and then package them in a CDN and essentially what it looks like Sorry for all the people who want to see the memes. There's more. There's more I promise this is kind of like a high-level architecture diagram of what happens when you're using a CDN You've got your back end somewhere. Well, we'll call it like u.s. West Where it's you know, you go your node.js your rust whatever your your back end and the hosting platform for your application is running in some central place when a user makes a request to your Website whatever application you have then say they're in Europe That's gonna take a decent bit even just for the static assets of your application to transfer all the way from your server In the u.s. Over to Europe, you know, it's not gonna be anything huge It'll probably be less than a second or two, but with the CDN They these platforms will offer these little edge nodes that you'll essentially pull through that place And then the static assets for anyone else say you're in Europe who makes a request to your website We'll then pull from the edge node itself Really minimizing the amount of data and the distance that it has to travel on a network and that makes things load faster And it makes things cheaper. You're not paying for egress costs from the cloud like where your server is and that's great Like from a front-end perspective like that's Perfect. My users are happier. They app developers spending less money and it kind of begs the question the the very Nuance question like why can't I just distribute my back end everywhere? Like what if I could just run the actual hosting part of my server on all of these different edge nodes and like What if I could cash that close to the user and I'll need to care about like the deployment target There's just a little static file like whatever. I don't need to know what platform. It's going on So can we do this with back-end compute? Nope Thanks, everyone. I'm happy to answer any questions. I got like 30 minutes left. So a little time. Oh, thank you Thank you. All right, seriously the the answer is of course that it's way more complicated than that Deploying back ends we have so many different if you look at all the talks here at kube-con We're talking about a platform to for deploying container-based services like there's whole conferences for this stuff. It's hard It's complicated and if it was easy, of course, everybody would be doing it And the reality is that you can deploy your application to a bunch of different geolocated servers and Design it specifically so that it's close to a couple of different users And so the request hits that edge node instead of a central cluster and all of that But this probably means that you're not using Kubernetes and you probably built your application to be like this from the beginning Which involves a ton of complexity and the specific call out here around Kubernetes is Running different clusters of Kubernetes in different regions different clouds across a disparate number of edge nodes That could be added or removed at any time is At least prohibitively expensive if not impossible to do let me know if you've done something like this with Kubernetes But I want to take a little bit of a step back and talk about why I'm even here talking to you today The the goal like what I work on on my day-to-day and why I've been working on cause monitor on Wasm cloud for so long is I want to be able to optimize these applications from a networking perspective To reduce the amount of data and the distance that it has to travel on a network So many different applications that we have and of course There's always exceptions are bounded by the amount of time that it takes for packets to go from point A to point B You know from the user to the server you can you know You can argue about it like whether or not a go or rust back in could serve a hundred thousand requests on a local Hostin point you know but at the end of the day the vast majority of the time that it takes for an application to Give you a response to your request It's just the time that it takes to get from that point And so what I want for back ends and what I want to continue this talk with is I want to be able to take my back end like any Platform agnostic front-end static asset and deploy it everywhere and get that type of network optimization So the two main domains that I want to focus on for this talk There's infinitely more but just to simplify it are the kind of hobby application something that I write in my free time It's providing a fun little web application Or something for my business. That's not necessarily Performance critical the key point is that it's not necessary. It doesn't need to be distributed for the use case of the application I just want to distribute it so that it can be close to the user and that it can be optimized that way the other domain is the They very vaguely calling it the industry application But this is something that has hard requirements for heterogeneous environments where it's really difficult to deploy an application like this with Kubernetes and so people end up needing to design it From the ground up running it on their own like really managing this manually And it doesn't fit in a cloud native ecosystem when I really think that it could and it should and to do this I'm going to use wasm cloud Wasm cloud is a CNCF sandbox, but hopefully soon to be incubating we put in that application Just a few weeks ago as application runtime in the CNCF Which is a web assembly orchestrator with declarative deployments It's just a single binary so you can run it on Linux Mac and Windows. We package it in a container We publish a helm chart And really the the core goal of the platform is for developers to be able to focus on writing their application Their business logic the thing that they actually want to write and not worry about all these platforms specific Essentially implementation details or things that just take down your productivity and drain What you really enjoy doing which is like just coding you writing your application So we try to abstract things as part of the platform as much as possible And that includes an application capability model So instead of working with direct SDKs for things like HTTP servers Key value stores message brokers databases distributed logging all that stuff Those are all abstract interfaces that you can fill in the implementation at runtime We also use the CNCF project gnats for all of our networking and RPC Under the hood. It's actually transparent to the user But what this means is that I can run my application all on my machine Or I could run it in a multicloud multi-region environment All of those application components can talk to each other the exact same as if they're running on the same local machine And that includes load balancing Automatic failover in terms of in case of an outage a really nice abstraction for people who are writing applications get down to your business logic and then everything else is taken care of as part of the platform And I say like I said wasm cloud. I've been working on it since about 2019 But it is a cloud native technology. We use OCI for distributing all of our artifacts You can just push web assembly to OCI repositories. I don't know if you knew that it's pretty cool We use the open application model for our declarative manifest, which is an open standard Cloud events for all of our events that we publish in the system and we support open telemetry tracing So this is this is all really just to say that this integrates really really well into a cloud native context We're not trying to reinvent the wheel with what we're doing Except with this one little thing called web assembly our unit of compute in wasm cloud is not a container We don't execute containers Wasm cloud actually would best fit running inside of a container as far as the platform But this web assembly thing how many of you show of hands have heard of web assembly before just keep them up for a second That's wild this number keeps getting okay, so I talked about web assembly at cube con in 2019 in San Diego I don't know how many of you went to that one. That was my first conference I was talking about this and I think the number of people at that conference who had heard of web assembly was like Three and two of them were me and my colleague who were there talking about it So it's pretty cool to see that how many people have actually Built and run something at least hello world style on web assembly on the back end Or fun and whatever it doesn't matter cool So web assembly if you haven't heard of it or haven't run it I'll kind of go through a high level of the technology. It's an open standard developed by the w3c They say it's the fourth language of the web Which it really is it's supported in all major browsers And it can also because it doesn't depend on a specific platform or architecture run very well on the back end It's essentially a portable compilation target So a language that has a web assembly Compilation support things like rust go see Dotnet JavaScript Python Ruby like it the the language list continues to grow and grow instead of compiling to a native binary You compile to web assembly and again execute on a web assembly runtime the web assembly runtime is essentially like a virtual machine it features a Essentially denied by default sandbox security model So everything is denied from the beginning you have to ask for All the capabilities like if you're gonna read a file you have to ask the host run time You're allowed to do it if you're gonna make a network request you have to ask if you're allowed to do it It's a great and actually as an application developer not a pain model to work with it runs a near native speed and Really the thing that you need to take away from this is that it's just a different unit of compute and we're using web assembly to Essentially make the developers life better It's really nice because it is just a static asset to compile to this compilation target You can distribute it and you don't have to worry about what platform you're gonna run it on Now let's start with the hobby application I cannot for the life of me find this gift So if you know about it, please tell me it was on reddit at some point like a three-minute gift of A Seinfeld clip that was you know like when they put the fake subtitles over it And that's like what they're saying is saying like I need my fruit jokes application to be deploying to all these different Kubernetes edge nodes it needs to serve a request in under three milliseconds It's like Kramer you're running a fruit jokes application. It's gonna be fine. So that's what I built It's a nice little hobby application and to look at the architecture of this in terms of a wasm cloud application I mentioned that we abstract away the capability driven application capability model And so it's a little it's a little blown up here But the actual fruit jokes component here is my web assembly component I wrote it in rust and it's just in pure business logic So the HTTP server and the key value store that I'm using to store and access my fruit jokes in the end Or something that I get to pick at runtime, which is really nice I'm just working with an abstraction and I don't need to worry about the actual implementation that's not compiled into my application and With this we're running all these application components in a wasm cloud runtime And if we wanted to distribute this application, you know, my goal thinking about this You know kind of like a CDN is there are people who are gonna want to access and laugh at and enjoy Fruit jokes all over the globe at all times and I want people to do that as fast as possible Because the wasm cloud runtime it can run on a variety of different targets And it doesn't have to run in a specific environment We can distribute that across a bunch of different edge nodes and that's all kind of interconnected with NAS We're gonna do that using a project that is part of the wasm cloud organization called wadam. I love this logo It's pretty cool. It's the wasm cloud application deployment manager. All you really need to know for this talk I won't I won't do a deep dive here, but there was a talk on Monday at the web assembly The web assembly co-located event all about our engineering effort on this but all you need to know really is that we're using YAML like everything else and you can pull the Aptual application component out of an OCI registry and then use this concept of a daemon scalar Which is like a Kubernetes daemon set to essentially distribute this piece this application component across every available Node in your wasm cloud network, which is all connected with NAS So let's take a look at it real quick I'm gonna start by showing you the available pieces of compute in my wasm cloud network And that just means that they're connected together with a NAS server I have one node. I have one VM that's running in Azure in south-central US. I have one that's running in Actually on my local MacBook here in the conference and then I have one that's running in AWS Which is in the US East to region. So I've added a couple of different, you know, essentially Region-based or location-based nodes to run this application on and if you take a look at each one You can see that it's running this fruit jokes actor or this web assembly component So let's take a look at what it looks like if I generate a fruit joke here Let's do a cool one. Why did the apple stop in the middle of the road? Because it ran out of juice. I heard one chuckle and like 14 groans. So I'm gonna do another one Some of these I've actually looked at and they're like, they're not that great What fruit is never alone? a pair Okay, slightly more chuckle to grown ratio. So I'm gonna call myself. I'm gonna stop on the head there, right? So this is this is like a you know, it's something done that you would whip up for fun It's a hobby application and the whole idea here is that web assembly being a platforming Gnostic target I get to distribute it this around as many different edge nodes as possible Us being here in the conference like this node That's running on my local machine is accessible publicly But being able to route to this means that people who are accessing this website from this conference are getting the fastest Load time is possible because I've got this edge node running right here and that's kind of the the the great application of like running a Running this back-end type app like a CDN Here at at this conference So you may be thinking to yourself like yeah, that was cool. That was a little demo app Right, and it kind of seems like something that could be surged served by any one of these cloud providers that offer like a CDN Probably has something like an edge functions or or a phas where you write this little stateless Serverless function that can serve you a fruit joke and then you call it a day like they deal with distributing it around They've got the whole edge node or whatever. So can you just do that? Yep You probably should too. This is really cool to kind of architect with web assembly and do with this From the developer perspective it really the the the point or being able to do this with this type of application You kind of can with like this serverless edge function type of thing But it doesn't really work for something that's highly distributed or actually has the requirements of running Across these different nodes and not just kind of replicated across as many nodes as possible And so I want to talk about I want to focus on the rest of the talk on this idea of an industry application Taking the jump with any technology from like a little demo, you know, your hello world to a real-world use case everything gets Exponentially more complicated as you do that. And so I made this inventory management application I came up with some hard requirements, right? These these things that you may need to do for a real inventory application that aren't really easy to do when you're architecting in like a Modern cloud native way depending on what you do Here's the requirements there needs to be a central server maybe in the cloud maybe running somewhere For administration, right? The the whole thing here and I did a nice little Photoshop here We're gonna be working on Managing the inventory for this paper company So there's a bunch of different branches that are running across the United States or maybe Europe or whatever But there's a central server for corporate for to be able to know the inventory of all of the different Branches so they want to know what's going on, but we're actually going to be doing deployments on premises in the office location So there's going to be a server in the office that you're going to be running this application on Really hard requirement the branches need to be able to operate even if the central network is offline If you're running a paper company and you're getting calls for orders And you're getting shipments and from the loading dock that needs to operate even if your Wi-Fi is having a bad day And you're not able to connect to the corporate network New branches need to be able to add it to the system be added to the system at any time And they need to be able to close at any time, you know limitless paper in a paperless world and things happen So looking at the looking at how we're going to do this This is where wasm cloud really starts to shine this distributed kind of complex Requirement use case the ability to distribute across these different nodes and have everything seamlessly talked to each other Is if it's on one machine really lets us create an architecture for this complicated set of Requirements So this is the full architecture for this application, and I'm going to go through it piece by piece so in terms of the The the central server for administration the corporate dashboard some company executive This is you know kind of the high-level application diagram Some company executives going to hit some internal HTTP server with a website, and they're going to want to say hey How is all my how are all my branches doing give me a rundown on your inventory? And then we can persist that in a highly replicated data store like Nats Jetstream, right? So we have our kind of I think it's actually pretty fair to deploy something like that in the cloud and then we have our individual Branches and that application deployment the the piece of application that we need to deploy everywhere is a central management for you know essentially a branch manager to Process incoming shipments incoming orders for different types of items and then store them in a database that's co-located at the actual branch itself and Because we're using Nats. This is actually an aspect that we kind of get for free with Nats All of the traffic here that's running on the branch will stay local as long as the Interested party is is local so everything can continue to operate locally here as the the branch manager can work So even if you lose connection to a central cluster you can still process those things Now another key requirement was that you know we may start with one branch But we're gonna add more and more over time, you know paper businesses booming We're opening new branches and so all we need to do is spin up another branch Wasm cloud runtime and then we can deploy everything onto that and again We're gonna do that with the concept of a daemon scaler like a daemon set So anytime a new branch pops up in our system. We're gonna deploy the entire Branched part of the application there and then we're gonna be ready to go So let's go ahead and take a look at what that looks like. I didn't actually deploy this one yet So let's go ahead and do that now so I've got my Munder-difflin application here if we wanted to actually look at the YAML Sorry, if this is gonna make your eyes bleed you can do JSON if you want to right everybody likes alternatives We've got all of our different components laid out here Using the daemon scaler and all of the relationships and configuration and things like that So if we deploy this application and we go to take a look at our infrastructure that we have running We can now see that our Branch that's it's it's running in azure You know I'm doing in the cloud because I don't have access to like a real paper thing is now running our branch manager as well as our fruit jokes and An HTTP server our redis database our Nats messaging for for Passing messaging back and forth messages back and forth things like that Now if we look at the actual branch Where's my keyboard? If we look at the actual application So we'll take it how this is all Let's take a look at how this is all kind of distributed Give me a second We can take a look at the corporate dashboard and see what we kind of have currently in our system So you can see by both of the applications that I created today That I'm very proud of my front-end ability to make something rotate and CSS everything's gonna rotate Don't worry about it. The way that this works is we can you know I'm the person at corporate I can request a rundown of the pieces of our inventory And then I can query that from the essentially central cluster So I've got one branch running in Austin and one running in McCormick that one is running on my local machine So the way that this works if I wanted to act as the branch manager That branch is running but located on my laptop So I can get some shipments of paper say 30 pieces of paper You know another 35 pieces of paper things like that I can request a rundown and I can query the inventory and you can see that from the corporate perspective I've now gotten my 65 pieces of paper. So this is working as expected Now let's take a look at one of the other hard requirements is that branches need to be added need to be able to be added at any time So I'm gonna steal this real quick and I'm gonna go Directly SSHed into a nice little GCP GCP instance here and we're gonna launch this as our next branch And so this is just a single command we use the wasm cloud CLI to launch a NATS server and a Wasm cloud runtime on this branch and if you take a look things are happening very quickly if we take a look at our Available infrastructure here. We now have this run time. That's running in GCP in US West And it is running on an x86 architecture like calling all this out But the cool thing is that you never needed to worry about the architecture or the deployment target anyways You can see that that's automatically loaded up all of our application components because of the declarative application They're saying hey spread it across all available branches and then now on this machine I can do things like receive shipments of paper or we can even This cloud things work Can I really not go back on this? Okay, I'm gonna handcraft this one to be fun We can get a nice little order where the item type is paper and the quantity is 10 Sweet so we got 70 paper into our inventory and then we remove 10 We take a look at the corporate dashboard We can request a rundown and query and we can see that the Seattle branch has now popped up with 60 pieces of paper whoa, so we've been able to You know essentially validate the requirement to be able to add branches at any time Now the really important thing here is that you saw me with my local machine be able to process Inventory queries a key requirement is that this needed to be able to work without a network connection to the central cluster So if I go ahead and turn off my Wi-Fi on my laptop I'm gonna bring this up for later Now I'm not connected to the central cluster at all anymore So this branch has effectively gone offline You can imagine they're having some kind of outage or they put the router on top of the microwave and they you know Whatever something happened at the branch the the Wi-Fi is no longer working But the people who are down in the warehouse are still getting shipments of paper and it still needs to work We need to add be able to add that to our inventory everything needs to be able to process offline Now I'm doing I'll do kind of a larger amount so that the amount is obvious Eventually they're gonna be able to resolve that issue We're gonna be able to turn the Wi-Fi back on the central the central corporate cluster is going to Understand that we've gone offline for a small period of time and then and come back up So you saw everything working locally when we get back to the actual inventory You can see that if we just try to query it the corporate dashboard the the corporate database hasn't caught up all the way But we can make a request to our Different or you can make a request back to this thing that's running on the local machine And we'll give it a second to fully like register interest again It hasn't actually fully reconnected yet. We'll give it a second with all the Wi-Fi I'm actually running off of my hotspot. So I wonder if that's messing with everything here Okay, there we go Let's see we're working at the McCormick branch unless that number was already was that already included on the thing Hmm. I guess the demo gods aren't with us today. That is unfortunate Well here. We'll give it a minute. I'll give you a little bit of the the post-amble and then we'll come back here And see what's going on So let's go ahead and move forward and talk about what is all of this good for like running with web assembly Running with wasm cloud what like what scenarios is great for it's really great for distributed data locations like running in these different edge nodes These different individual branches the heterogeneous environments that can be added to or moved at any time Any application that's network constrained like the vast majority of the time to process is the network request and Anything that you are interested in doing multi region or multi cloud deployments This is completely platform of Ender agnostic. So it's a really great application for spreading across multiple regions or clouds Things that don't necessarily work as well in wasm cloud You know things that have perfect support for but with web assembly on these little single component applications The web front-ends kind of like our fruit jokes. It works fine But can be better elsewhere and then for web assembly itself. It's an abstraction of a CPU You know, it's running with an instruction set. That's not OS or architecture specific So if you're doing Linux specific things like things that you're like you're inspecting syscalls to come out of a system You probably aren't gonna want to run it with an abstraction layer. It doesn't really make sense in terms of the the benefit of the technology And what does this all really mean? When you're running web assembly, you can run your applications anywhere platform and OS agnostic And when you run wasm cloud you can orchestrate those web assembly applications and that allows them to all talk to each other the same No matter how they're distributed across different clouds and edges even your local laptop Now what's next? I think I can improve this demo a little bit I think the we could use a management UI instead of curling in the terminal But it's always nice to you know, bring that back to reality We can move through jokes to the front end What I really love to see for this is deploying wasm on the device I would love to run this platforming nostic target in the browser like the technology can And I'd like to have kind of a more data first class caching solution So, you know, I'm clicking in the UI to kind of get updates on the system But I like to do that in a more and more first-class way You know what I'm kind of upset that this still let me check this out. There we go There it is. We got our got our nice little update. I knew that that knew that that would come through. Thank you so much Gotta be patient Gotta be patient So I love to you know, we got a couple minutes here But I really just want to leave these up on the on the screen I would love it if you were interested in the things today if you want to pop in our community slack If you have any questions, I'll answer some here and you can find me after the talk But that's where all the maintainers hang out. We like to have a good time We run weekly community meetings on Wednesday at 1 p.m. Eastern and then all of our code all the things that you saw here The capabilities are in our open source repo in github The whole wasm cloud organization including like the deployment manager and all that is there So it looks like I do have a couple more minutes. So any questions In your demo, I think you said in the branch you're running Redis. Like what is what is Redis running on? Like how does that work? Yeah, yeah, I'm running. So the the specific piece of the application Here so the the branch the the Redis that I'm running there There is an actual Redis server that's running just like on the virtual machine there like on gcp for example and this component here on the right side the Redis is the Implementation of the key value capability. So when I in my application, I have a couple gets and set ads and things But that's an abstract contract You'll notice actually on the the corporate dashboard. It uses the same abstraction to interact with NATS It's just at runtime. I get to pick what data store to use And so that Redis that's running on the branch is kind of like a connector to that to that database Other questions All right. Well, thank you. Thank you all so much I'm gonna be hanging out for a little bit after the talk and then eventually probably move into the hallway track But I really appreciate you coming out and listening to me do some some dumb fruit jokes and some cool demos today


So, three years ago we planted this jubilee plum and she's doing all right. We made some videos showing you how we plant the trees and how to mulch. And I just want to do a little follow-up video, I'll give you a chance to see how she's doing, but also to talk a little bit about the kind of maintenance we do in the autumn and the spring to make sure our trees have the best chance of success. The two main things to talk about really is to do with the staking. So, when we planted the tree we put in a stake. This tree is on a smaller rootstock, it's a semi-dwarfing rootstock, although it's still going to be three or four meters high and wide. But that means that it'll never produce strong enough roots to stand up on its own, probably, and so it's likely to always need a stake. And every year we're going to be checking that the stake is still strong. It's doing all right. And so that it's the tie that attaches the tree to the stake is not too tight. Every year the tree ideally is growing. And as a result of that the girth of the tree is going to get bigger. There's a little bit of flexibility because these ties are a little bit rubbery and they'll accommodate that growth for a year or so. But then every year, so in the autumn, we came down here and I went round and checked all the trees and I undid the buckles and I did them back up again. But as you can see, perhaps this is where it was last autumn and I moved the ties so the ties aren't always on the same place, always rubbing the same bark. So we moved the ties a little bit up or down and checked the stake itself. And the other thing we put up did was to put on the tree guards, this one here that protects the tree against browsing by rabbits and other rodents and so on. And the reason that I was putting it on is because in the spring I'd taken it off. So why do we take the guards off in the summer? Well, because the main threat is in the winter months when it's cold and there's not so much to eat around and your rabbits might come looking for where they can nibble the bark and get the sugars from underneath. And but in the summer months, these guards can cause problems because ants like to make nests in them I've discovered and that can ensure that it can keep the bark damp and it can cause problems with the tree. And so I always take the guards off in the summer months. So about this time of year, the guard comes off. Well, I'll do it now. And then in the winter months, so November end of November onwards, depending on where you are seasonally might be earlier for you, but to put the guards back on again to protect the tree over the winter. There we go. OK. So the other thing we want to talk about is the mulching bit. So this obviously isn't the mulch we put on three years ago, which was primarily seaweed. So we mulch this again in the autumn with a lot of its prunings, tree prunings, so there's quite a lot of leaf in it, but it's bark, chippings and so on. And you'll notice that there's a few more plants in here than there was before. Originally, we planted this allium, which was all about getting some mycorrhizal activity going. There's no guarantee the tree will plug into the same mycorrhizal, but it changes the structure of the soil and it starts to develop it in a way that the tree is going to prefer. And we've got a few other plants in here, most obvious being daffodils. Now, the reason daffodils are in here, primarily we plant daffodils these days because they look nice. But as it happens, daffodils, the bulbs of daffodils, rodents don't like them. And one of the problems we had with these trees is because when we dug up the hull, if you've seen the original video of planting the tree, there was lots of bits of block and so on, builders waste from the original combustion of the barns in the 1980s and they just shoved it all in here, shoved some soil on it and turfed it. And so we dug a hull and we found lots of blocks, but there's a lot of space between those blocks, which is fantastic for rodents. They've got lots of little places to live down there. So we fairly soon discovered vole holes around the tree, perhaps because they're an easy place to find them and spot them because they are around in the grass as well. And so we planted some daffodils. But the primary, the first thing we did was we stuck some mint in the holes because we learnt that voles don't like the smell of mint. And so we just cut some mint from around the garden and I shoved it, leaves down, stem up in the holes. A couple of holes and didn't think too much about it, but then they rooted and they grew. So now we've got mint plants here as well, which are just coming up, just down here as well. So we've got mint and daffodils, which are in this guild of plants around the tree and that's all about protecting the tree as best as possible from vole damage. And I think looking at it, we've got some bee activity going on right now, but it's doing a pretty good job. So make sure you look after your trees, get out there, check the ties, check the stakes are okay, and take the guards off or put them on, depending on which time of year it is. Make sure you've got a good mulch. We're not mulching now because the ground is colder and you don't want to put mulch on cold ground, whereas in the autumn the soil is warmer and you're mulching onto warmer soil, so that makes sense. So that's why in nature mulch is in the autumn and it's a good time for us to do it as well. If you do need to add more mulch, just wait for the soil to warm up a bit first, but other than that, yeah, do a little bit of maintenance and your trees will reward you.


So I know I know many of you have probably heard about Bitcoin mining and it sounds really confusing You've got these computer equipment that prints bitcoins and it's kind of weird how it all works It uses a lot of electricity and so we're going to dive into the very very very very basic elements. Oh Nice. Thank you so good and So we're going to dive into the basic elements and cover why Bitcoin using energy is actually a good thing That doesn't sound very intuitive at first, but we're going to go into that So let's start with the basics around energy Per the first law of thermodynamics the law of conservation of energy Energy cannot be created or destroyed so when you create electricity that electricity is created from something else another energy source Everything in the universe is energy and it's merely transferred. Nothing's destroyed. Nothing's created and And Gaspard Gustav de Coriolis came up with the idea that energy is the work being done So Bitcoin's proof of work is proving that energy was spent and that's why it's called the proof of work Everything in this life requires energy Purifying water requires energy Transportation transporting items requires energy cooking requires energy There is no way to get around having to use energy to create something or to use something And in a free market the cost of any good Largely reflects the energy and time spent in producing the good whether that be an automobile a train a plane or a cup or a bowl And because free markets encourage The lowest price goods or people are trying to be efficient with their spend Energy usage in producing goods is typically the lowest cost energy When we first started out a long time ago work was done in the economy entirely by human beings and that work was powered by food Then we were able to domesticate animals Those animals could labor on our behalf, but they required more energy as well and Finally, we built machines and those machines are fueled by gasoline atomic or other energy sources and they require massive amounts of energy our economy isn't just an economy of money It's an economy of energy This chart shows GDP to Energy consumption it's extremely correlated with the our GDP is extremely correlated with our energy consumption as We become more and more efficient with the energy that we use we use more of it. It's called Jevons paradox Energy is also a closely correlated with standard of living as The more prosperous nations consume more energy this consumption and what I'm trying to highlight here is that consumption of energy is not a bad thing We've done more and more of it as we progressed from humans to animal laborers to to mechanized labor And it's closely correlated with how well people live their lives Money which is the representation of the work required to generate goods and services can also be viewed as stored energy a Dollar iron today required my labor and my time or my work and my energy and That is stored energy that I can unlock at a future date to pay for an individual or a company To then use that dollar to go produce something for me. So I can pay someone to go dig a ditch So you're probably wondering okay. Well, this is cool to talk about energy and whatnot But how about how does this really correlate with what Bitcoin is doing with proof of work? So Bitcoin mining is actually to it has a two-fold purpose Bitcoin mining prints or mints the new bit coins and that's called the block subsidy and It protects the network and that protects the network Essentially through the block reward so the block reward consists of the block subsidy and the transaction fees and that's what the miners are given in compensation to protect the Bitcoin network So how Bitcoin works is that it takes electricity? It pumps that into an ASIC or called a Bitcoin miner That's the hardware that you guys have seen those pictures online of all those computer all at a computer equipment lined up Those are called ASICs and what those ASICs do is they validate that the proof of work or that the energy has been used And so that's their sole purpose and when they do that they're then given Bitcoin And so that's the very primitive version of how Bitcoin works. It takes electricity It goes through the Bitcoin miner ASICs and then out comes Bitcoin on the other side and these machines are only useful for Mining Bitcoin and that's a good thing and we can we'll dive into that a little bit later So a common common criticism of Bitcoin is that Bitcoin mining doesn't do anything useful You've got all this computing power and all it does is protect the network Well, it sounds like a good idea to do something else with Bitcoin's mining power, right? Like maybe we find prime numbers or a full protein or do some other computation However, that messes with Bitcoin's incentive model If Bitcoin's incentive model has dual purpose both to generate Bitcoin or the miners are rewarded with Bitcoin and and prime numbers That skews the incentives to where if at a future date finding prime numbers is more profitable than mining Bitcoin Then it might have a dual incentive and then those ASICs could be used for something else As I mentioned before we're going to dive into a little bit of why it's important that Bitcoin's ASICs could only do Bitcoin work And why this covers why you would want to have a dual-fold purpose You know the kind of an easy way to think about Bitcoin in terms of a commodity money is that Bitcoin is a super commodity minted from energy the fundamental commodity of the entire universe and so Bitcoin is predicated more about on physics rather than code All of these incentives have been aligned properly and it uses physics to align those incentives properly Bitcoin via proof of work. There is no other way to Show that you've done the work other than to expend energy and that's a that's a beautiful thing So essentially what miners are given is that they're given a financial reward to expend energy And so the miners have to acquire very expensive ASICs So they acquire capex which is the physical mining equipment and then they buy electricity and they're rewarded with Bitcoin and Their one sole purpose is to validate Bitcoin transactions Essentially pretty you know essentially validating those Bitcoin blocks That's important because in a future attack on Bitcoin say if you wanted to attack the Bitcoin network The miners have only one purpose with the machines that they have So if the miners acted in a bad way like a 51% attack, they would be willing to burn their machines Or forego all their future cash flows Because they've already incurred the cost to acquire the equipment and that's Bitcoin security model is essentially miners are given They given a choice between taking the money So they've they've spent money to acquire the ASICs and electricity They have the choice of either receiving Bitcoin rewards or burning that all in messing with the network And that's how Bitcoin is secured and a lot of people go. Well, you know Could we secure bitcoins network for cheaper or I think spending five billion dollars a year? Which is the current estimated cost to secure the Bitcoin network. I believe that is expensive in The real world No one would ever criticize building walls or vaults or defensive mechanisms around things that we care about valuable things So why would anyone criticize building a digital wall around a digital ledger? Using electricity and that's what Bitcoin does and that's why it's costly Is it that cost is the measure of how thick that wall is how much protection the Bitcoin network has And so we're gonna dive a little bit into Bitcoin's energy consumption Because this is I think kind of the hottest topic of like where does how much energy does Bitcoin use and where does it come from? So this map highlights the area the geographic areas where primarily Bitcoin is mined which is in China Like the Nordics and North America and a little bit in Australia and in South America What's really interesting about Bitcoin is that miners buy the machines and then they try to acquire electricity To make to run through the machines to print Bitcoin They're incentivized to find the cheapest electricity anywhere in the world Essentially Bitcoin miners are on a hunt to find cheap electricity anywhere that electricity could that electricity could be in the middle of Antarctica or on the moon Anywhere there's cheap electricity they will try to find it So Bitcoin doesn't compete with anyone other like it did Bitcoin doesn't compete with Munich's energy consumption for Restaurants or bars or anything like that Bitcoin wants to find the cheapest electricity that no one cares about but that's valued the least And that electricity is not very valued because it is either trapped so for example in the Nordics it might be a Hydroelectric dam in the middle of nowhere and they have excess electrical capacity And so Bitcoin harnesses all that excess electricity in the world that's being generated and essentially provides a floor To buy all electricity across the world at the most minimum price Otherwise that electricity would go wasted. It doesn't necessarily that electricity necessary. It doesn't necessarily Be used for anything else if Bitcoin didn't use it And this is actually a common thing Bitcoin wasn't the first commodity to be essentially Printed or minted with electricity Aluminum smelting Requires a very high amount of electricity in order to finish the aluminum smelting process in Iceland Iceland has a lot of trapped electricity and the Prime Minister of Iceland said hey We've got all this trapped electricity What we really do is we import bauxite the raw aluminum ore and we export that electricity electricity via aluminum and So that's what Bitcoin does is Bitcoin takes excess electricity across the world and exports that via Bitcoin So it takes the electricity puts it through a Bitcoin miner and it turns it into digital gold recent research report by By coin shares went and they tried to identify how much of Bitcoin's energy production is from renewables versus fossil fuels And they found that Bitcoin has a very high concentration in renewables and the reason why is that Bitcoin through renewables? that renewables have essentially trapped electricity sources, so most renewables are you know hydroelectric dams that Bitcoin taps into or Areas where they've over they've essentially have an oversupply And so Bitcoin taps into that and so it's estimated that 78% of Bitcoin's electricity usage is from renewables You know finally if Bitcoin mining gets big enough right now Bitcoin mining is only about five billion dollars a year If Bitcoin mining gets big enough, let's say a fifty billion dollar or a hundred billion dollar industry It might actually incentivize the production of even lower-cost electricity sources, which could be fusion So some criticisms that you've probably heard about Bitcoin is the electricity I want to touch on a few here, and I call this the Bitcoin double standard. It's a little play on the Bitcoin standard written by Saifadeen Electricity per transaction is not the right metric for many reasons one the energy is spent per block Which includes the newly minted coins and Transactions also, there's a varying number of transactions per block Finally with lightning lightning is a layer two technology. There can be hundreds of thousands or tens of thousands of transactions per a certain number of transactions on layer one so a block at Bitcoin block for layer one might only have 1,000 transactions, but the aggregate number of all the layer two transactions compressed until layer one could be hundreds of thousands or tens of thousands and then finally Mining not only creates new coin and not only money not only validates current transactions It prints new coins and secures the entire ledger So you're not spending this electricity just for the transaction You're spending this electric you're spending this electricity to secure the entire protocol in all previous transactions So that's why that's not an appropriate metric and then the common technique of most critics is to move the goalposts Like in football It's essentially moving the objective. So at first Bitcoin doesn't do anything useful Well, definitely does because a lot of people believe in the Bitcoin network and people are willing to spend transaction fees in order to validate their transaction and Bitcoins mining or bitcoins energy usage does something very valuable, which is protecting the network And then they go well, maybe it's not, you know, maybe it's useful, but it's not using renewables Well, we found that Bitcoin does have a lot of renewable consumption And then finally they'll say, okay, it's not using okay. It's using renewables, but it's displacing other uses It's essentially trying to move the goalpost to where you can never win the argument and which other which other You know, there's a kind of a funny You know, let's see. Let's skip to Which other type of industry do we criticize so much such as Bitcoin? So US Christmas lights use more energy than entire countries Where are the electricity police? We should call them We should stop all the way. We should stop Christmas lights. We should stop, you know, any wasteful use of electricity And that's where Claiming one use of electricity or one use of energy is more or less wasteful than another is completely subjective We have a mechanism to already select. What is a useful use of electricity? Via the market. We all pay for the electricity and we use it in whatever fashion we'd like To brew beer to eat a sausage to do this or that No one is the moral police to dictate what you should do with your energy. You already paid for it It's completely ridiculous that we would criticize Bitcoin's energy usage, which was paid for just like everyone else And finally part of my analysis, we looked at the yearly cost of different types of monetary systems and the energy consumed So if we're going to evaluate Bitcoin's energy, we should at least look at other types of monetary systems and look at how much energy they use well Gold mining is very very expensive. It uses a lot of electricity They've got to go dig out that gold ore deep deep in the earth and refine it and smelt it With the banking system, we have huge costs You have physical bank branches where people have to live if people live human beings have homes They drive from their homes to the bank branches They sit in the bank branches the bank branches have been built with construction tech with different construction equipment that requires a lot of energy You have bank server costs You have all sorts of other costs as well Which I include governments in here because the financial system ultimately is enforced by government control At least outside of bitcoins. And so you've got the legal system You've got the military You've got the political system in those require massive amounts of energy and cost So Bitcoin relative to all of those is very tiny and very very efficient And for my favorite part The old system efficiency so you got an aircraft carrier. This is more efficient than Bitcoin because Bitcoin is so wasteful Efficient Efficient Efficient people physical people handing cash out people physical people sitting and manning an office when everything in the world We have now is digital The the federal open market committee efficient Nice nice There's a lot of energy being used right there are lots of energy and Finally the Supreme Court the US Supreme Court lots of energy to build that building lots of energy to maintain it and There's not only this court building But tens of thousands of court buildings just in the US alone to enforce contract law and So Bitcoin when weighed against all other types of monetary systems is extremely efficient in its energy usage And I think it's one of the greatest innovations in human kinds history So I feel like this was a you know, I feel compelled to defend its energy usage and I think it does it very very well So that's it for me