Episode 96: Mining Decentralization Update
Ep. 96

Episode 96: Mining Decentralization Update

•

Episode description

In Bitcoin, Explained 96, Aaron and Sjors discuss some recent innovations in mining, and in particular mining decentralization. Specifically, they discuss the Stratum V2 and DATUM mining protocols to decentralize transaction selection in mining pools, the open source hardware Bitaxe miner, and some recent proposals to make decentralized mining pools like P2Pool more viable.

Chapters

00:00:00 Introduction and mining decentralization
00:06:48 Why mining centralization threatens censorship resistance
00:11:10 Stratum V2: miners choose transactions
00:14:18 DATUM and the limits of pool decentralization
00:20:14 Why predictable payouts favor large pools
00:23:26 Bitaxe: open source hobby mining
00:30:46 P2Pool: mining without a central operator
00:35:14 Reviving P2Pool: latency and payout challenges
00:39:13 Lightning swaps and ecash for mining payouts

===

This episode’s sponsor: CoinKite, maker of the COLDCARD.

Aaron’s Nostr: ⁠npub1art8cs66ffvnqns5zs5qa9fwlctmusj5lj38j94lv0ulw0j54wjqhpm0w5⁠

Sjors’ Nostr: npub1v25jqj332n630klwtqeqxgyrjl4alw4phmluhu2x6lcxzwy9m03suqexw3

Transcript

Download transcript (.vtt)
0:16

Aaron van Wirdum Live from Utrecht, this is Bitcoin

0:18

Sjors Provoost Explained.

0:20

Aaron van Wirdum Hey, Sjors.

0:21

Sjors Provoost Happy New Year.

0:22

Aaron van Wirdum What an amazing day. A new Bitcoin Explained episode.

0:26

Sjors Provoost It is truly amazing. We are exponentially slowing down as we approach episode number 100, The Singularity.

0:34

Aaron van Wirdum Exactly.

0:35

Sjors Provoost This is episode 96.

0:38

Aaron van Wirdum Yes, and episode 96, like many other episodes, is sponsored by our friends from Coinkite, who produce the COLDCARD, and who are kind enough to pay for Sjors's mortgage of this beautiful penthouse where we're recording.

0:55

Sjors Provoost Or just a frappuccino, probably. Somewhere in between.

0:59

Aaron van Wirdum Sjors, we have a problem.

1:02

Sjors Provoost We do.

1:04

Aaron van Wirdum Bitcoin mining is becoming too centralized.

1:07

Sjors Provoost Becoming too centralized? I think it already is too centralized.

1:13

Aaron van Wirdum Yes. It's been trending in the wrong direction since mining was invented. Well, that's not strictly speaking true, of course, because Satoshi at first was the only miner.

1:24

Sjors Provoost Exactly.

1:24

Aaron van Wirdum So for a little while...

1:26

Sjors Provoost We had a centralization phase, then we had a decentralization phase, and now we are heading towards a centralization phase.

1:31

Aaron van Wirdum We're trending in the wrong direction again.

1:33

Sjors Provoost Yep. And I think we should nuance that because I think... pools are heavily decentralized—heavily centralized. I think the physical mining equipment is actually quite well distributed over the planet and in weird remote places. But it's these pools that seem like potential choking points.

1:53

Aaron van Wirdum Yeah, there are different layers of mining centralization, right? So there's indeed... where is the hardware located? But a lot of this is getting centralized in big data centers as well. So there's centralization pressure there. And then there is where are the mining pools operated from? Or rather, maybe how many mining pools are there? Both, I guess. Where are they operated from and how many are there? So mining pool, the pool level of centralization. And there's the chip production. centralization uh before we get so in this episode we're gonna tackle a couple of solutions that are in development of have recently launched or like some ideas to help counter this trend i'll also real quickly mention that the upcoming Bitcoin Magazine print edition that i'm the editor-in -chief of is gonna be focused on this topic as well We're going to have a whole special around mining centralization and different solutions.

2:58

Sjors Provoost Sounds good.

2:59

Aaron van Wirdum And a couple of them we're going to explore in this episode. Specifically, just to spoil that for everyone, spoil that for all our dear listeners, all 17 that are still left. There's the Stratum V2. We're not really going to discuss that, I guess, because we did a whole episode on that. But Stratum V2, DATUM. the Bitaxe and P2Pool.

3:26

Sjors Provoost P2Pool and its friends.

3:27

Aaron van Wirdum Right, yeah, P2Pool and its friends. So we'll cover all of these to some extent. So different ways that mining is hopefully becoming more decentralized again.

3:37

Sjors Provoost Yeah, and so some of these focus on making pools more decentralized and others on the physical equipment. Although none of them fix the making of the chips.

3:49

Aaron van Wirdum No, but there are some interesting developments there as well, as you can read in the upcoming Bitcoin Magazine print edition.

3:57

Sjors Provoost All right. This sounds like an ad.

3:59

Aaron van Wirdum Speaking of ads, did you know that the Genesis book is now also available in Dutch, Sjors?

4:06

Sjors Provoost I saw that.

4:07

Aaron van Wirdum You can finally read the Genesis book.

4:09

Sjors Provoost I think I read the English version.

4:11

Aaron van Wirdum Yeah, it's interesting because I had it translated to Dutch. It was translated to Dutch, but not by me.

4:18

Sjors Provoost But did you give any feedback on the translations to the original intent of the author?

4:23

Aaron van Wirdum No, because I did want to do that. But it was weird to read my own text in my own language, but not written by me.

4:41

Sjors Provoost This is how Alexey Pertsev feels in court because he wrote statements in Russian and then they got translated to Dutch and then the judge would read them out in Dutch and then the translator would turn it back into English and he would not have any idea what it's about even though it's his own words.

4:57

Aaron van Wirdum Yeah, it was weird. I'm not sure how to explain it. It's like my text, but not my text or something. It's like if I had written it in Dutch originally, I would have said, you know, I've written things differently, but I would have written many things differently, actually. There's just a difference, I guess, in how I think in English and Dutch. You know, it just comes out differently.

5:20

Sjors Provoost Yeah, that's what I would expect as well.

5:26

Aaron van Wirdum It was like, well, if I'm going to start giving feedback here on how I would write it, then I'm just going to rewrite the whole thing, pretty much.

5:34

Sjors Provoost Yeah, and if you do that, then the question is, would you improve things? So would you write entire new chapters into it?

5:40

Aaron van Wirdum So I decided in the end, I'm just going to treat this like any other translated version of a book that I can't read. The translator just does it and whoever wants to read it in that language can do it. So no, I did not actually do that. I just sort of trusted the translator with it. I haven't even read the whole thing even.

6:03

Sjors Provoost Are you going to do a Dutch audiobook?

6:07

Aaron van Wirdum Well, so then I would have to, well, would I do it myself? So I did consider that. And in that case, I would probably just take the Dutch translation. But now I have to read it out loud in my own voice, my own text, which is not my own. I don't know. It gets too weird. So I think not.

6:26

Sjors Provoost So you'd have an AI voice that sounds like you. Trained on this podcast when you're speaking English.

6:32

Aaron van Wirdum Right.

6:33

Sjors Provoost Anyway.

6:35

Aaron van Wirdum Anyways, what were we talking about again? What are we doing here?

6:39

Sjors Provoost Well, the problem is mining centralization.

6:41

Aaron van Wirdum We're making a podcast. Bitcoin Explained on mining centralization and potential solutions. That's right. So the first solution, do we, again, I think the 17 listeners that are left listening to this podcast probably all know why mining centralization is a problem. But should we explain that real quick?

7:01

Sjors Provoost We should. Yeah, it may be useful to spell out a few things. In principle, centralization doesn't have to be a problem because the way it works is you as a user create a Bitcoin transaction and some miner doesn't like you or they are asked by some man with a gun to not like you and they block your transaction. They don't put it in a block. But then as long as somebody puts it in a block, you'll eventually get in there. And, you know, we're not that worried about super fast confirmations anymore because we have the Lightning network. So really, you know, as long as a few percent of miners let your blocks in, you're fine. But it's still not great. That's one objection. So we'd like, you know, we wouldn't want a situation where 90 percent of miners suddenly decide to not like you. And then you kind of have to hope that 10 percent.

7:50

Aaron van Wirdum Yeah, I mean, I guess the short version of it is. We want Bitcoin to be censorship-resistant. That's kind of one of the design goals. I think that's fair to say. And for it to be censorship-resistant, it needs to be impossible to regulate mining, basically. Because what regulators tend to do is they tend to blacklist certain people or institutions or companies or countries. So if we want to stop that from happening, then basically regulators need to not be able to regulate Bitcoin and specifically in this case on the mining level. If mining centralizes too much, so if mining happens by too few people or all in the same location or something like that, then regulators have a place to go and they can start to impose the censorship on Bitcoin through these miners. If you keep it decentralized, this is much harder to do.

8:47

Sjors Provoost Yeah, and another thing to consider is defense in depth. So usually you don't want to have only one line of defense. Like you could say, well, even if 90% of the miners censor me, it doesn't matter because this 10% is still left. But it's better to be safer and make sure that that 90% is not even going to censor you. So you want to defend yourself in multiple places, not just have one last thing that you think will protect you and then some surprise happens. Turns out you're not protected.

9:17

Aaron van Wirdum Yeah.

9:18

Sjors Provoost One such surprise could be the government ordering the compliant miners to reorg out the evil miners. Because then that 10%, you won't get through it.

9:30

Aaron van Wirdum Right. So one of the ways, you know, I explained one of the levels of centralization is pool centralization, right? So a mining pool is, you know, some entity that allows other people to bundle their hash power through you. But at that point, you are also the entity that's doing the transaction selection, typically.

9:52

Sjors Provoost Yeah.

9:52

Aaron van Wirdum So you are then, you know, even if there's like, 10,000 people with ASIC machines mining all across the world, if there's only one person doing actual transaction selection, the operator of the mining pool, then again, the regulator just needs to find this one person in order to impose censorship. Today, we live in a world where two or three mining pools have more than 50% of the total hash power on Bitcoin. you know it now i'm sort of leaving out the part where hash power can move to different pools if this starts to happen but at least sort of superficially at face value that means right now you only have to contact you know a regulator only have to contact two or three mining pools and

10:35

Sjors Provoost Yeah, and I guess this goes into the fact that mining pools are doing multiple things. And so even if you can't make the pool smaller, at least you can maybe make mining pools do fewer of those things.

10:47

Aaron van Wirdum Right.

10:47

Sjors Provoost So mining pools combine funds. That's a way to reduce your risk as an individual miner. So you always get the same payout instead of maybe once a year or less. But another thing a mining pool does is it decides what goes in the block. And so there are several proposals that... remove that role from the mining pool even though the pool might still be big they don't get to decide what's in a block or to some extent

11:10

Aaron van Wirdum yes so that's first the first project that realized this was Stratum v2 right that's what you're talking about yes so indeed you have a mining pool a mining pool operator that usually selects which transactions go in a block the idea was let's decentralize that so in the same way that the hash power is decentralized there's all these ASIC machines, these thousand people having ASIC machines all across the world, as I just mentioned. The idea was let's design a mining pool so that these thousand people, they are actually deciding themselves which transactions they're including in the blocks they're mining. And then they're still sharing the reward. So that's Stratum v2. We did an episode on Stratum v2, episode 80.

11:53

Sjors Provoost Yeah, it's not the only thing Stratum v2 does. It also adds encryption. It tries a lot of things. Indeed, we did an episode about it. I guess one thing we can say about it that's relevant for the next topic, I think, is that it's somewhat complicated. So Stratum v2 really tries to be the first actual spec because the first version of Stratum did not have a spec. It was just code. So there's an actual specification. There are different... components, different roles, as they're called, that communicate with each other and that also need to be implemented. And so one of the downsides is that it's, you know, it's not that easy to get started with Stratum V2. And so, you know, other people have tried other methods that are easier.

12:34

Aaron van Wirdum Right, okay. Yeah, and currently there are two Stratum V2 projects, basically, right?

12:40

Sjors Provoost Yeah, so there is a firmware implementation by Braiins on their Braiins OS, which is a custom piece of firmware that you put on your ASIC.

12:48

Aaron van Wirdum Yeah, Braiins is a mining pool.

12:49

Sjors Provoost Yeah, the only downside with that is that it's actually behind on the current spec. So they're working on it, but it could take a while. You don't need to have Stratum V2 support on the firmware itself. You can run a translator. converts the modern Stratum v2 to the old-fashioned Stratum but now you're dealing with a separate piece of software and this is where the complexity comes right back at you and there is the Stratum reference implementation SRI which is a Rust project that implements basically all of the components in Stratum v2 so you can run your own pool or you can run some software as a user

13:26

Aaron van Wirdum yeah And SRI is actually implemented by DEMAND pool right now. So that is in use.

13:33

Sjors Provoost They're using it, yes. You don't have to use it, right? You can implement Stratum V2 yourself. It's a reference, so you can use that code to see how you would want to do it. But in this case, they use the actual code, probably with some changes for themselves.

13:48

Aaron van Wirdum Yeah. Okay, so that's Stratum V2, I think, right? So we're not really going into detail. Beyond this, I'm sure it's been a while. It's been like two years, but I'm sure there was plentiful more detail in the actual episode. Episode 80.

14:05

Sjors Provoost Yeah, and also some history.

14:06

Aaron van Wirdum Okay. I don't remember that at all, but maybe I'll relisten to it myself someday. Could be a good idea. There is a new similar-ish project as well.

14:22

Sjors Provoost Yes.

14:23

Aaron van Wirdum DATUM. So DATUM is implemented by OCEAN. OCEAN Pool. Are they just called OCEAN or OCEAN Pool? I'm actually not sure. Anyways, I think it's just OCEAN.

14:33

Sjors Provoost So we have an episode explaining how OCEAN's TIDES system works. It's their way of share accounting. This would be completely separate from that in a way. They released basically a piece of software that you run and it communicates to their pool and it makes sure that you can make your own templates. How it does that? Magic.

14:57

Aaron van Wirdum Because the specification is not out there.

14:59

Sjors Provoost There's no specification yet, but my impression is it's somewhat similar to Stratum V2, but it does have some different trade-offs. But we can do an episode when there is a spec.

15:11

Aaron van Wirdum Do you know what the trade-offs are?

15:14

Sjors Provoost No, I think we can go back to Stratum V2 a little bit. So there are... Three ways in which you can do templates in Stratum v2. One is you can just use the template that the pool tells you to use. That's the old Stratum v1 model, essentially. The other is where you, and this is the model we talked about in the last episode, two years ago, where you announce to the pool, I want to make this template. So you've made your template. You have to tell the pool about it. And then the pool could reject it. And they can also see it. But there's a third way, which I think DATUM uses and Stratum v2 is sort of changing the spec to also do this. And I don't know which one came first or whatever. But the idea is that you don't actually tell the pool what you're going to mine. You just give it a bunch of Merkle hashes. I think we covered Merkle trees before. And then they know that the block, you know, they know how much fees they're being paid, but they have no idea what's in the block until you publish it to the blockchain. So you as the miner, if you find the winning block, you put it on the blockchain, and that's only when the pool learns what was actually in it. That makes censorship impossible, right? Or at least other than self-censorship.

16:32

Aaron van Wirdum Well, also, the other thing I wanted to bring up is I do think there is a legitimate sort of critique on this approach.

16:44

Sjors Provoost The third one you mean?

16:46

Aaron van Wirdum either of them really like i just did this this concept in itself uh like i like fundamentally if regulators would go out and take the step of censoring uh you know imposing censorship through pools uh they can't do it with these kinds of pools indeed because these pools aren't doing the transaction selection However, if a regulator wants to get serious about it, they can, of course, still say, well, you have to, so you just can't do this type of mining then if you can't do it with this type of mining.

17:26

Sjors Provoost Yeah, so in Stratum v2, in that sense, the design is more flexible, which you could see as a good thing or as a bad thing. One thing a pool could do if they wanted to is they can get the templates from a compliant company. So they wouldn't let the users make their own templates, but they would basically, as a pool, have another company that they get the template from. So it's not their responsibility to make the templates. Somebody else is doing it. I don't think that would help decentralization much, though.

17:53

Aaron van Wirdum Well, it wouldn't help censorship resistance much.

17:56

Sjors Provoost Yeah, exactly.

17:57

Aaron van Wirdum Yeah. I think a more practical... By the way, I don't want to discourage this type of development. I do think it's at least thinking in the right direction, and there's probably potential in that direction. I just do think it's not as if this is now a magic bullet and it's now actually completely solved.

18:18

Sjors Provoost No, and I guess a similar analogous discussion is happening more... in practice around Lightning right now. So in Europe, we have these new, you know, even stricter KYC rules that were tagged along with MiCAR and other laws. And... They basically require exchanges to do all these on-chain surveillance things. So this is basically spying on their users on the blockchain. And as soon as people use Lightning, that such spying becomes more difficult. So I would expect on a much shorter term for regulators to be annoyed by that in some way. We haven't seen any evidence of it yet.

18:56

Aaron van Wirdum Right, and there might be the potential that they will just say, well, you can't use Lightning then.

19:01

Sjors Provoost Yeah, but then the regulators have to say, no, your customers must use a privacy unfriendly way. They must jeopardize their own privacy in order for us to be able to spy on them. There could be a whole legal battle around that if people want to actually pick the battle. But it's a similar discussion as what you brought up. You can force a pool. You can tell pools you cannot allow decentralization because we cannot control it. That's definitely possible. And so then the idea would be, so the pool still has power. it still has a benefit of being big. I guess there's two things. So even though it's not doing the transaction selection, it is doing the payouts. And so as a user, you want to be able to get paid and that gives the pool some power. Even though they might not control what's in the block, they are the one who are organizing the payment and by being that person, they can, yeah, there's still a choke point in it. So I think one question that's interesting to answer is why are these pools so big? related to that. Because being big is also what makes them an attractive target in the first place. If there was just a million tiny pools... then although in theory you could enforce it on all the million of them, you can't really.

20:14

Aaron van Wirdum You want to explain why mining is centralized?

20:17

Sjors Provoost Yeah, so one of the problems is that a lot of miners want to be paid a constant amount of money.

20:23

Aaron van Wirdum Yeah, you already explained that, Sjors.

20:25

Sjors Provoost Well, not entirely. What I explained is the reason you use a pool in the first place is to get a relatively constant payout. But there's still some luck involved. A pool might find a block or a pool might not find a block. And some people want even more certainty than that. They just want to say, if I provide hash power, I want to get paid. And this game theory is tricky. But basically, it means that a pool has to take some financial risk to do this. They have to have capital. in order to pay you, even though they're not finding a block. And they might not find a block for a very long time, and they could go bankrupt over that.

20:58

Aaron van Wirdum Right, right, right. This is a good point to bring up, actually. So rather, actually, like the explanation I gave earlier is actually not strictly correct. It's not the case that, well, no, it sort of is. But the point here is that a lot of miners are basically just selling their hash power and then getting a fixed payment for their hash power.

21:19

Sjors Provoost The idea of pools started out with just the idea like, okay, if I just mine on my own, it will take me 5 million years to find a block. That's not good. But as soon as you can find a block every day or so, you should be fine. But that's not enough for some people. And so they want to be paid constantly. And now in order to do that, you need to take financial risk. And it turns out that this financial risk-taking works better at scale. So this is a massive incentive towards just there being one pool. And then they're financed by Goldman Sachs. And that's it. And the solution to that... We kind of might get back to it tangentially, but kind of really none of the four things we're mentioning really solves this problem. So the OCEAN pool, for example, does not solve this problem. They just pay you whenever they find a block. So that means that the people who can use them are people who are okay with that. Now, the benefit that they offer is transparency, which we explained in the TIDES episode. So although you might get paid unpredictably, you know exactly that the pay you got was fair, which is very difficult to do with these other schemes where it's very untransparent. So you think you're paying a 2% fee, but are you really paying a 2% fee? You have no idea.

22:37

Aaron van Wirdum Yes, exactly, yeah. Yes.

22:41

Sjors Provoost And in order to fix this, basically... This constant flow of money problem that would require really fancy derivatives, products, you know, Discreet Log Contracts. There's all sorts of fancy ideas around it, but it gets pretty abstract very quickly.

22:58

Aaron van Wirdum Okay, let's move to the next topic. This one is interesting and probably a little shorter.

23:03

Sjors Provoost I just wanted to say one more thing about DATUM. So because it's so simple, it's like just install one piece of software. There's already an Umbrel app for it. So it's just very easy, especially for hobby miners, to just try it out and play with it. I'd like for Stratum v2 to be able to do that as well. I think it's technically very possible. It's just a matter of having enough people doing these things. Anyway.

23:26

Aaron van Wirdum Okay, so the next topic is an interesting one. The Bitaxe.

23:30

Sjors Provoost The Bitaxe.

23:31

Aaron van Wirdum What is the Bitaxe, Sjors?

23:33

Sjors Provoost It's an axe.

23:35

Aaron van Wirdum Is it though?

23:36

Sjors Provoost No, it's not. It's basically what they did. Well, what it looks like is a very small device, about the size of, well, half the size of a teacup, or a quarter of the size of a teacup, if you have a big teacup. It basically...

23:51

Aaron van Wirdum Since when are we measuring mining hardware in teacups?

23:55

Sjors Provoost Well, we have Americans listening, and they use all these weird non-metric units, so we should indulge them a bit.

24:01

Aaron van Wirdum We'll adopt our own.

24:02

Sjors Provoost Quarter teacup. Sorry. Anyway, it's a very small device that's kind of a fun way to hobby mine. So it's not a way to make a lot of money, but it doesn't use a lot of power either. It might use 15 watts or something, so it's like a couple of LED lights. It's the kind of thing that you can have in your living room and brag about it. However, inside of it is a single ASIC chip. Where does that ASIC chip come from? It comes from a bigger miner. So what basically happens, if you take a... A big miner, those have hundreds.

24:37

Aaron van Wirdum How many teacups?

24:38

Sjors Provoost They are the size of two shoeboxes.

24:41

Aaron van Wirdum It's getting very complicated now.

24:43

Sjors Provoost Originally, the S9 was one shoebox, and then the newer miners are two shoeboxes.

24:47

Aaron van Wirdum How many teacups in a shoebox?

24:49

Sjors Provoost I don't know. Anyway, so what happens is somebody takes those big miners and... carefully takes out the individual chips. Or they can order the individual chips on Alibaba, those kind of sites, depending on the supply chain. And then you take one of those chips and you put them on a minicomputer. They're very simple ESP32 minicomputers. And then there's an open-source operating system that is able to control the individual mining chip. And so you end up with, perhaps, with the modern ones, I think it's about one terahash. compared to maybe 200 terahash in a proper miner machine. So 200 of Bitaxes is the equivalent of one double shoebox professional miner. And imagine there's hundreds of thousands of normal mining machines in a big data center, and you get a sense of the scale of this mining.

25:43

Aaron van Wirdum Right. I guess the advantage would be, well, I mean... having an actual ASIC miner hardware thing that's gonna be loud and produces heat and all that kind of stuff right like that's not really something

26:00

Sjors Provoost yeah this thing is very quiet it does need a fan but it's a very small one

26:05

Aaron van Wirdum Right, so like you said, is it just for people that actually want to make money or is it more like for fun?

26:13

Sjors Provoost No, because for one thing, you're probably going to run this thing at home and at home your electricity prices are going to be too high, even with a professional mining machine. But it is, I think, a way for people to become familiar with mining at all because mining is so far away now from the end user because it's such an industrial project. It's a very nice entry-level device. You can actually connect it to a pool and basically see all the moving parts. There's some open-source software involved that you can start playing with. So hopefully it's a way to get more people interested in mining. You could also see it as a lottery system. because your chances of winning are absolutely tiny. But generally, people will use this in a solo mode where if the device finds a block, which might happen once every million years. But that's every million.

27:04

Aaron van Wirdum It's like a lottery.

27:06

Sjors Provoost Yeah, it's like one in a million every year per person, right? So somebody will find it.

27:10

Aaron van Wirdum Exactly. It's like a lottery.

27:12

Sjors Provoost Yeah, it's like a lottery. And then you get the full whatever 3.25 BTC, which is nice.

27:19

Aaron van Wirdum Yeah.

27:22

Sjors Provoost And I'm kind of hoping to see a bottom-up development here, because mining, the making of these machines has been very proprietary, very far away, very closed source. And maybe somebody can figure out how to make these Bitaxes bigger. So you start with a small device, which is uneconomical, but there's already designs where you put six of these ASIC chips in a single one, and that's already a little bit better. in terms of overhead. And you could imagine eventually building a professional machine that's built on all these open source standards. And then maybe those would be used by industry eventually. The other reason why I personally find them interesting is because it's plausible that we can have Stratum v2 on one of those devices. and then start testing Stratum v2 with it because Stratum v2 has a bit of a chicken egg problem where it's complicated so it's hard to test but you want people to test it otherwise the big boys are not going to use it and so getting a group of hobbyists to use Stratum v2 would be a very nice way to bootstrap this stuff

28:28

Aaron van Wirdum okay So, yeah, the reason why you mentioned it here, I guess, you know, hopefully in a sort of ideal world, this is something that catches on. And actually, because there's like, you know, at some point there's like millions of people having one of these things in their home and then mining hardware, you know, mining becomes very decentralized in that way.

28:54

Sjors Provoost Well, that's another angle. So we have the DIY hobby interest thing that could pay off in the long run, more of an R&D strategy, I guess. Then there is, as you said, the lottery is solo mining. And then there's also, if there's enough, it might actually make a difference. Let's say all the big miners are being censored. Now there's millions of these tiny miners. And as long as they can find one block, you know, every couple of weeks, at least you can still get your transactions through. Sort of as a last bastion and very hard to shut down because these things would be literally everywhere. So, you know, you'd have to search people's houses for them and they would be tiny and in quarters and that sort of stuff.

29:34

Aaron van Wirdum Yeah, yeah.

29:35

Sjors Provoost They're probably too small for that, but it's...

29:37

Aaron van Wirdum That's assuming that these blocks then wouldn't be reorged and blah, blah, blah.

29:42

Sjors Provoost Exactly.

29:42

Aaron van Wirdum Going deep into the, you know, adversarial game theory here. But at least it's another, it's a nice extra line of defense.

29:49

Sjors Provoost Yeah, and because they're a hundred times smaller than a normal miner and they're typically only one in one place, you know, they can be spread out very well.

29:57

Aaron van Wirdum Yeah. Cool. Do you have one?

29:59

Sjors Provoost I do, yes. I'll show it to you if you remind me.

30:03

Aaron van Wirdum I think everyone, all our 17 listeners knew you had one because I think you mentioned it in the previous episode.

30:08

Sjors Provoost I know in the Netherlands there's quite a few because Satoshi Radio, the podcast, sold 200 of them and then had to assemble them. Because that's the part we didn't mention yet.

30:19

Aaron van Wirdum They also have their mining pool now, basically, right?

30:21

Sjors Provoost Yeah, they run one of the lowest latency mining pools in Europe, or solo pools.

30:27

Aaron van Wirdum Right, yeah.

30:30

Sjors Provoost Yeah, you can buy them. There's different shops that sell them. You can also completely make it from scratch from components.

30:38

Aaron van Wirdum Viva la revolution!

30:41

Sjors Provoost Whatever.

30:42

Aaron van Wirdum Bottom-up mining. Let's go.

30:45

Sjors Provoost Okay.

30:46

Aaron van Wirdum Then finally, there have been some developments in the P2Pool domain.

30:57

Sjors Provoost And friends.

30:58

Aaron van Wirdum Yeah, this is something I have not... You know, the Obi-Wan Kenobi meme. That's a name I've not heard for a long time.

31:09

Sjors Provoost Yes.

31:09

Aaron van Wirdum This was like a thing, I think even when I got into Bitcoin, which was early 2013, I think even then that was sort of already becoming kind of outdated.

31:19

Sjors Provoost Yeah, so P2Pool has existed for a long time.

31:22

Aaron van Wirdum Yeah.

31:23

Sjors Provoost And it might be coming back. But more generally, if you Google Braidpool or Radpool, you will find similar concepts that have all been, in the last two years or so, been resurfacing. So people are revisiting this concept. So we should explain what it is.

31:39

Aaron van Wirdum What is the concept?

31:40

Sjors Provoost Roughly, the concept is that there is no pool in a very Matrix-style way. Instead, you collaborate with people to basically remove the pool from existence. So basically not need a pool at all. So we have to kind of explain how that works.

31:59

Aaron van Wirdum Decentralize the pool.

32:00

Sjors Provoost Yes.

32:02

Aaron van Wirdum There's no pool operator, let's put it that way. That's the right way to put it, right? There's no central operator, so it's a decentralized pool.

32:09

Sjors Provoost Yeah, and the way you do that is by creating a mini-blockchain, in a way. The terms that are used are shares or weak blocks.

32:18

Aaron van Wirdum Yeah, that's how P2Pool always worked. That was the original design, right?

32:24

Sjors Provoost Yeah, there's variations on that design. P2Pool indeed already worked that way. So everybody, I think, because I never actually studied the P2Pool original that well, my understanding is that you would have between real blocks, you would have a chain of basically weak blocks. And a weak block is just a block with a lower proof of work.

32:48

Aaron van Wirdum I mean, that's how mining pool always works, basically.

32:51

Sjors Provoost Well, that's how shares work, yeah, exactly. In a mining pool, you submit a share to the pool to prove that you're working.

32:56

Aaron van Wirdum Yes.

32:57

Sjors Provoost But these shares are independent. So one share does not point to another share.

33:02

Aaron van Wirdum Yeah. So to put it simply sort of normally, you know, when you're mining Bitcoin, it has to be, you have to hit a certain difficulty target, right? Which means that the hash of the block has to be, or the hash of the block header has to start with some number of zeros and then higher difficulty means more zeros. And then these weak blocks. require fewer zeros. So it's easier to find them and then they're not a valid block for the Bitcoin blockchain, but they were still kind of hard to find. So it still proves to the mining pool that you are at least trying.

33:40

Sjors Provoost Yeah, exactly. So you're using proof of work. That's already how pools work, right? That's what shares are. You make one of these weaker blocks and that proves to the pool that you've done an amount of work and they will take that into account. Now in P2Pool, it's not the pool that takes it into account. It's the other miners in your pool that take it into account.

33:57

Aaron van Wirdum Well, and specifically, correct me if I'm wrong, so the idea is basically that you are, these pools, no, sorry, these miners, They are trying to find a Bitcoin block, a valid Bitcoin block, but they're also doing that by hashing on top of the previous weak block from another miner in the pool.

34:18

Sjors Provoost So that's the difference. Whereas in a normal pool, shares are independent things. You just submit it and it's validated based on itself. What you do in this P2Pool type design is you have a chain of weak blocks. So every weak block points to a previous weak block. and you would have a much higher block frequency. So the weak block frequency might be once every 10 seconds. So you'd have about 60 weak blocks in the time that you have a normal block. Now, the way you do this is by actually adding a blockchain on top of a blockchain.

34:51

Aaron van Wirdum Yeah, the mining pool itself has an internal blockchain in between each actual Bitcoin block.

34:57

Sjors Provoost So the internal blockchain is basically a weak block plus a reference to the previous thing in that chain. And then you as a miner are supposed to always build on top of the last weak block. You're not supposed to ignore the last weak block.

35:14

Aaron van Wirdum So I think the problem with this, at the time at least, as I remember it, and which also just sounds right, is that you now get extra costs by mining on a P2Pool. namely you have reorg risks so sometimes you will mine a block that won't make it into the internal blockchain plus there's extra latency Well, no, that's still real.

35:41

Sjors Provoost You have [unclear] stale risk… so, yeah, or orphan risk.

35:44

Aaron van Wirdum Stale risk, orphan risk. Yeah, that's what I mean, actually. So I guess that was sort of the main problem.

35:50

Sjors Provoost I think there were at least several problems. One is what you just described. Because this frequency of blocks is higher, you're more likely to produce a block that just doesn't make it to your peers on time.

36:01

Aaron van Wirdum Well, and in a normal mining pool, it's... It doesn't have to make it to your peers on time.

36:06

Sjors Provoost No, because it only goes to the centralized pool operator.

36:08

Aaron van Wirdum So there are no orphans in that sense.

36:11

Sjors Provoost Exactly.

36:11

Aaron van Wirdum So that's an extra problem introduced by P2Pool, which makes it maybe economically inefficient.

36:18

Sjors Provoost Another thing has to do with the Coinbase payout. I think we'll cover that later.

36:23

Aaron van Wirdum Go for it now. We're here now. Recording now might as well explain it now.

36:29

Sjors Provoost Yeah, so normally a pool would simply, you would have an account with the pool, and they would occasionally pay you out. on-chain, but not every time. And the problem with this design is that everybody, because it's decentralized, everybody wants to make sure they're getting paid, and so your Coinbase transaction might have a lot of outputs, which uses space that cannot be used to mine actually profitable transactions. So especially in a world with high fees, there's an opportunity cost there. Now, it's not necessarily too bad, especially with Taproot, because Taproot outputs are pretty small. So you can fit a couple of hundreds in there without too much sacrifice. But there was a bit of a snatch that the AntMiner firmware at the time that ran on the ASICs could not handle more than 19 outputs. And OCEAN pool has run into the same problem. I think we've mentioned that in the earlier podcast. But that can be solved by running sane firmware on the device like Braiins OS or some other custom firmware. So that problem has kind of been solved. But by the time the problem was solved, P2Pool was already dead. The problem about stale blocks, in the meantime, we have seen networks like Ethereum introduce uncle blocks and ways of accounting for these stale blocks. So you would basically... If you're nice enough to point to one of these blocks that was abandoned, you get 20% of it and the original guy gets 80% of it. So it's a way to incentivize you in pointing to other blocks. And there's been a lot of academic research around it that suggests that at least for the purpose of running a mining pool, it might be quite useful, right? You won't want to do it on Bitcoin itself, but for a pool, it might be fine. Another thing that has improved…

38:11

Aaron van Wirdum Interesting. Something good coming out of Ethereum that Bitcoin could use.

38:16

Sjors Provoost Yeah, and another place what's interesting to look at is Monero still has P2Pool. Basically, they copied the idea, and they're still running it, and it's being actively used. I believe they also have 10-second block times. As far as I know, Monero always runs behind Tor, and they barely have any of these orphans, uncles, what you want to call it, which suggests that the latency problem is very solvable. maybe just by a slightly better technology that we have now. In Bitcoin, we also have compact blocks now, which are a way, I think we've covered that in an earlier episode, like a way to very efficiently broadcast a block without sending the whole four megabytes, using the fact that everybody has the same mempool. Perhaps that can be used as well. So in other words, I think it's worth looking at these concepts again, using some of the more modern tooling that we have and see if we can revive them. Because it does take the, you know, it removes the centralized pool. So that's a very good feature. Another problem, let's see. Well, about this number of outputs that go into Coinbase, because every participant wants its own output. There are ideas floating around that to fix that through Lightning or through atomic swaps. But basically, we've already got this blockchain on top of a blockchain. And in P2Pool, this blockchain was just pointing to the previous one, wasn't anything else. But you could make this blockchain a bit more fancy by having actual transactions in it, a very small number. And those transactions would be one miner saying to the other miner, okay, here's an atomic swap, would you like to take my reward? So as a small miner, you would get paid on Lightning by a big miner, and in exchange for that, inside this fake blockchain, you give up your coin, and the bigger miner can increase their coin.

40:08

Aaron van Wirdum Here you've really lost me. Wait. You're making transactions on the internal...

40:12

Sjors Provoost On the fake blockchain.

40:14

Aaron van Wirdum On the fake... How does anyone get... If it's a fake blockchain, how does anyone get that? I just lost you.

40:23

Sjors Provoost Yeah, so ultimately the actual money happens in the Coinbase transaction, right? And you're making weak blocks with this Coinbase transaction that has hundreds of outputs. And every time a weak block is found, nothing happens in the real blockchain.

40:35

Aaron van Wirdum Yes.

40:35

Sjors Provoost But you can shuffle around how that weak block is organized.

40:39

Aaron van Wirdum Yes.

40:40

Sjors Provoost And so you can, while weak blocks are being found, you can do a Lightning atomic swap with somebody to say, okay, I will remove my output from the next weak block. And in exchange for that, you get to have your output in the next weak block. So in other words, the big miner has one Bitcoin. in the output and now they have 1.1 bitcoin and you give up your 0.1 bitcoin and they pay you on Lightning with real bitcoin now there has to be some discount because they're taking a risk but you can imagine figuring out the correct price for these kind of things so you're basically trading being on chain right now versus having Lightning liquidity right now or being on chain maybe one day in the future versus having Lightning money right now

41:23

Aaron van Wirdum okay

41:24

Sjors Provoost Those kind of techniques could be used.

41:26

Aaron van Wirdum I'm not going to ask you to explain that again. I am going to listen back to this episode again later and see if I understand it. Because this sounds... I don't know. I just don't get it yet. But that's fine.

41:37

Sjors Provoost But you can already... We know how to swap between altcoins and Bitcoin.

41:41

Aaron van Wirdum Yes.

41:41

Sjors Provoost And this is essentially... This chain inside the pool is an altcoin. It's just the altcoin will eventually materialize into Bitcoin as real blocks are found.

41:51

Aaron van Wirdum Okay.

41:52

Sjors Provoost Right?

41:53

Aaron van Wirdum Oh, yeah, okay. I think I get it now. Oh, yeah. I sort of...

41:57

Sjors Provoost But the question then is, how complicated do you want to make this fake blockchain?

42:00

Aaron van Wirdum Yes, yes, yes. Okay, I think... Well, they say you only really understand it, and I tend to believe that once you can explain it yourself, and I don't think I can do that right now, but I think I at least sort of intuitively now get this idea. You're editing the Coinbase.

42:20

Sjors Provoost You're editing the future Coinbase. And sort of in that same vein, there is a proposal to use ecash, so the Cashu-style ecash, to... When you're submitting mining shares or these weak blocks, I think this one is not related to P2Pool. It's actually for a normal pool again. But there, instead of just shares that are just a thing that the pool registers for you, you actually make ecash tokens that are tradable. And then you can do all sorts of fancy things that you can because you can now monetize your fee revenue or your mining revenue before a real block is found and you are no longer depending on the pool to do that for you. So these are all ways to kind of take like as we covered in the episode, you can take the transaction selection from the pool, but you can also take some of the payout distribution work from the pool. And so you give, these pools might be big, but they would have less and less actual functions to the point where there's not an interesting target anymore. A lot of this is moon math and fancy future stuff.

43:20

Aaron van Wirdum Yeah, this is still very theoretical for the most part, right?

43:24

Sjors Provoost Yeah, these are proposals floating around mailing lists. Some prototypes have been written, but I think it's a promising direction that needs more attention than strategic Bitcoin reserves.

43:36

Aaron van Wirdum Amen to that, yeah. This would be really important if something like P2Pool can... be realized again or revived or yeah, that would be one of the best improvements to Bitcoin that I can think of. For sure. But so right now, this is still in the theoretical phase for the most part. I mean, I guess P2Pool might still be out there, sort of, kind of.

44:00

Sjors Provoost No, I think the last release was in 2017, right after SegWit. And since then, there's been no code development.

44:05

Aaron van Wirdum Okay. And what about these "and friends"? Like none of them are like live and mining blocks.

44:10

Sjors Provoost Well, the things we've just been describing are sort of a mix between these three proposals that I'm confusing and that also are copying from each other. The P2Pool revival might actually have things from Braidpool in it, etc. So it's a bit of a... We'll see what the eventual name of this thing will be. But I'm seeing things brewing there. The combination of the hardware, the new pools that are trying different models, and then these decentralized pool ideas. I think there's a chance that we'll make it. We just don't know how much time there is, right? We don't know if we can keep experimenting with this stuff for another 20 years or whether in two months the whole thing comes to an end. And if it's in two months, then we were too late. Yeah,

45:01

Aaron van Wirdum well, I mean, arguably, even if censorship would start to happen... It doesn't mean that immediately Bitcoin is killed, right? Like you can technically still keep working on these solutions.

45:15

Sjors Provoost Yeah, I mean, one thing about censorship is that it is an active attack. So the censorship needs to keep happening. As soon as it stops happening, it's like a floodgate that opens. So in that sense, it's sort of reversible damage.

45:30

Aaron van Wirdum Yeah. But it still... It would be really bad.

45:33

Sjors Provoost It would put us in a very different world.

45:34

Aaron van Wirdum I would say it's, you know... Well, like you said, we don't know. We don't know if this is going to happen in two months or 20 years.

45:40

Sjors Provoost No. On an optimistic note, there are lots of other cryptocurrencies out there that are much easier to censor. Like, I'm not even going to name names. Much easier to censor, and yet they are not being censored. So there's, you know, there's the possibility of being censored and there is a willingness to do the censoring. And I think the latter... isn't there at the moment because exchanges are just a much easier place to say hey why don't you freeze those coins

46:03

Aaron van Wirdum yeah but also there's kind of no point in censoring some smaller coin if people can just keep using the bigger coin right like you either do the censorship right or

46:13

Sjors Provoost yeah but by some smaller coin you mean Tether? Oh, i wasn't gonna name names but that's one of those things

46:20

Aaron van Wirdum yeah it's it's a Tether has been uh surprisingly uh alive and well over the years.

46:27

Sjors Provoost I mean, it does freeze coins, so in a sense there is some censorship happening, but not at the kind of scale that would happen on an exchange, for example, where you really have to KYC every transaction before you can even make it.

46:39

Aaron van Wirdum Yeah. Okay. Was that it?

46:43

Sjors Provoost I think we've covered most of the things that were on the list, and we've covered a lot.

46:47

Aaron van Wirdum Great. So the future of mining is still kind of hopeful, potentially, I think. Sure, that's what we're going with.

46:56

Sjors Provoost We're not dead yet.

46:58

Aaron van Wirdum We're not dead yet.

46:59

Sjors Provoost And thank you for listening to Bitcoin.

47:01

Aaron van Wirdum Explained.