Research
Timechain
Search Donate
Sponsors
Cake Wallet, private Bitcoin and Monero walletSideShift.ai, no-signup crypto exchangeOrangeRock, non-custodial bitcoin spot and perps tradingBraiins Hashpower, buy and sell Bitcoin hashrateeCash.com
Home / Podcast / S15 E17 / Transcript
Transcript · S15 E17 · 1:15:53 · 2 Feb 2024

S15 E17: Andrew Poelstra on Covenants (OP_CAT vs OP_CTV)

With Andrew Poelstra. Hosted by Vlad Costea.

← Episode page Plain text
Machine transcript, corrected by hand. It can still contain mistakes, so the recording is what counts. Tap any timestamp to play from that moment. Use Cite to copy a timestamped link and a short attribution. Dotted words were hard to make out in the audio.

Search this conversation

0:45Vlad CosteaHello there and welcome to the Bitcoin Takeover Podcast. This is Season 15, Episode 17, Episode 199. We're almost 200. I don't know why I miscalculated. I wanted this to be number 200. But I'm super psyched that today I'm interviewing Andrew Poelstra, who is a mathematician. I just found out that we're about the same age and now I feel like I haven't accomplished much with my life. But he's the chief of research at Blockstream and he's also a co-author of Taproot and has a lot of interesting cryptographic creations related to Bitcoin to his name.

1:27And I'm super excited that he joins the conversation in a time when there's a lot of debate about what the next Bitcoin soft fork is going to be. There seems to be somewhat of an agreement that Bitcoin needs covenants and we're going to talk about this. And there's also, I guess, a bit more which is happening outside of the Blockstream research. There is a lot of, I guess, emergence of zero-knowledge proofs and these are coming also into Bitcoin under different shapes and forms, and there's also BitVM, which was launched last year, so we have lots of topics. Welcome Andrew, I'm super happy to have you here.

2:07Andrew PoelstraCool. Happy to be here as well. Let's try to get all that into an hour.

2:11Vlad CosteaYeah, it's a challenge. So let's start with covenants. What are they and why is there such a big conversation about them right now?

2:17Andrew PoelstraSure. So covenants are the idea that you can kind of control where your coins are moving. So in Bitcoin today, we have a scripting system called Bitcoin Script. It's very limited in what you can do in a number of ways, so I'm sure we'll dig into.

2:40But in particular, the way that it's designed is that when you want to spend coins, you execute a script. A typical script just checks a single signature, to the point where we actually talk casually about Bitcoin addresses. Bitcoin addresses have key and stuff. What's actually happening there is that you have an address which is an encoding of a key. And the key is embedded in a tiny script with like three opcodes that just says, "Look for a signature on the transaction using this key." And if somebody provides a signature, which is a witness, sort of, you have a program that checks a signature and then a witness of some data that shows the program works.

3:16If you provide the signature, the coins can move. And everything you can do with Bitcoin Script kind of fits that mold of: if you provide witness data for the script, then the coins can move. And what you can't do in Bitcoin Script is control where the coins are going. You can't say, "Well, if this person signs, then the coins are allowed to go anywhere. But if this other person signs, they're only allowed to go to these whitelisted addresses." Or if the coins are moving too quickly, you're only allowed to move like 0.1 bitcoins in the first day and you have to wait.

3:48If you want to move more, you can do rate limiting and stuff like that. You can't do any of that with Bitcoin Script. It's just like a binary. You know, you have a script, it unlocks the coins. Once they're unlocked, they go wherever you want. So people would really like covenants, which are the idea, or the capability, of controlling where coins go, for a number of reasons. There's kind of a couple classic covenant applications. The most classic probably is the vault. This was developed by three guys, MES. I'm going to mess up the pronunciation of all of their names, so I just won't.

4:25So you can look up MES vaults. And what a vault is, is a script where you have coins, probably cold coins, just sitting around. And if you want to move them, you have a covenant script that requires you move them into a staging area first, and they have to sit in the staging area for a day or a week or however long you want to configure, and then they can go to their final destination. So if I want to send you some coins, what I would do is I'd take the coins that are sitting in the vault. I would declare, "I'm going to send the coins to Vlad in a day."

4:59The coins move to the staging area, they sit there for a day, and then they can go to you afterwards. And the idea there is that if somebody steals my private keys, they're not able to run away with the coins. What they can do is say, "Well, I declare that I'm going to take your coins in a day." Right. And so they move it to the staging area. It sits there. Presumably, I'll notice in the day, right, that my coins are gone. And then the vault has kind of an alternate path where I can reset the timer so they never actually get the coins, or I just send them back to the cold storage.

5:33And if the counterparty has actually stolen my keys, then I could be in trouble, but there's variants of this where you have multiple keys, where I have a secondary key, which hopefully they haven't stolen. And that secondary key lets me just like completely move the coins out of the way and then I can recover them. But even if I can't recover them, at least the attacker won't be able to get the coins. We'll just get into this loop where I keep resetting the timer, spending a little bit more on fees.

6:00The attacker will hopefully eventually give up. But if not, I can delay them indefinitely. And that, at the very least, will greatly reduce the incentive for someone to try to steal my keys and steal my coins, right? So this vault is kind of part of a broad area of Bitcoin research of custody, of how do you store your coins in a way that they're protected from theft. And to do that, because the vault script is saying the coins can't go anywhere, they have to go to the staging area, you need covenants, right?

6:30So that's kind of a classic covenant example. Another classic covenant example, which maybe, to give an example of why there might be some controversy around covenants, or some fears around them, is you could use a covenant to say that, for example, some counterparty, maybe some evil person, the SEC or somebody, needs to sign off on the coins in order for them to move. And you could write a covenant that says it is impossible to move the coins out of the SEC's purview. So you kind of like taint the coins.

7:06You have this permanent taint that a covenant is enforcing, always stays there, and it then attaches the coins to some sort of like regulatory infrastructure or something. And covenants would make this technically possible. And I think this idea originates in a Bitcoin Talk post by Greg Maxwell back in like 2013 or something, where he says basically, like, propose the most outlandish evil application for covenants that you can think of. And this post was like a joke, right? It was like kind of the fun kind of thing that you would post on Bitcoin Talk.

7:39But people came up with all sorts of things like this and then, somewhat unfortunately, they leaked into the wider memesphere and then people started getting nervous about this. And there's always been kind of this tension between this fear, like if we add covenants to Bitcoin, it opens the doors to all of these kind of scary, like, ability to do horrible things, versus without covenants you can't do vaults and your custody becomes a lot harder, right? Because you've just got keys, and if you steal enough keys, the coins are gone.

8:09You can't do certain kinds of fee constructions where... Another classic covenant application is for an exchange to do like a thousand withdrawals at once. And they send the withdrawals to a Bitcoin output. And then each individual user, all 1,000 different users, can spend the output, take their own coins out and put the rest back, and everybody kind of does that. And that way the users get to choose what fee rate they want and they get to choose when they want to process the withdrawal, like maybe delay until Sunday afternoon when fees are typically cheaper. You know, the users are in control, so the exchange is much cheaper and more efficient for the exchange, and the users get a whole bunch of control and ability to pay their fees.

8:51Stuff like that. So there's all these things we'd like to be able to do with Bitcoin that you can't without covenants. And it's kind of cool to hear you open this saying, like, there's a consensus that Bitcoin needs covenants. And I hope that's true. I don't think it's entirely true. But certainly the impression that I get is that the conversation has moved towards covenants are probably a good idea, and these bad things are probably not realistic for a number of reasons, right?

9:22They're typically expensive and inefficient and require a ton of engineering and wallet support implemented by wallet developers who would hate it. So why would they implement it? And also, honestly, you can do bad things in Bitcoin today just with multisignatures, right? So you can imagine Coinbase, not to pick on them, but they're kind of the big guy right now. You can imagine that they got leaned on by the American government, the New York Fed or the SEC or whoever is the boogeyman of the day.

9:52To say that they want a covenant-like ability. They want to sign off on every transaction. So then Coinbase says, "Well, we're not going to give you your withdrawals directly. Instead, we're going to let you withdraw to a two-of-two signature between you and the New York Fed." And the New York Fed says, "That's cool. We're going to sign off on all your transactions. Trust us. But all your transactions also have to have an extra signature from the New York Fed."

10:20So you can see that just by using multisignatures, the Fed could impose this covenant-like taint where they retain control of all coins coming out of Coinbase forever. And you can also see, when I say it like that, you can kind of see how impractical and impossible to design and enforce and make this work. And, I mean, just the technical barriers alone would be insurmountable, without even looking at the social barriers or the legal barriers and stuff. So to me, and I think to a lot of people, covenants feel a bit like that, where once they become more real and tangible, you start to think how in practice could you do horrible things?

11:00And it's hard to come up with an answer. One more thing I'll say about that is that in, I want to say, like, 2018 or 2019, around the MIT Bitcoin Expo, we were talking about covenants. And Ethan Heilman posted on Twitter kind of a challenge. He said that if anybody can come up with a practical covenant attack, like attaching some sort of, you know, coin tracing taint or whatever, something that's practical and efficient, then I'll buy you a beer. And there was a Telegram group that a bunch of us were on and we all like piled more beer onto this, till eventually, you know, you were going to get like 20 beers from 20 people if you come up with the thing.

11:45And nobody pulled it off. And I mean, that's not strong evidence that a Telegram group incentivized by beer couldn't do it. But it's some evidence that there's not a lot of bad things you can practically do with covenants. It's like, we were really thinking hard about this, a bunch of very technical people. And we found that a lot of these ideas that seemed scary back in the early days, where covenants were a vague and poorly defined concept and the technicals weren't very well specified, are probably not that much of an issue. And the benefits you get from covenants, increasingly as Bitcoin becomes more valuable and we start to care about custody and we care about fee management, the benefits seem much bigger. So that's what covenants are. That's how people want them. That's a bit of history about the controversy around them.

12:37Vlad CosteaYeah, I think you answered my question. You answered my next question and then you foreshadowed the next question I was going to ask you. But that's really cool. You provided a full explanation. And before I move on to ask you something else about covenants, and it concerns the debate about different proposals, I have to read a comment from the chat because this is live on YouTube and on Twitter slash X, whatever you want to call it. And Chris from Cedor said, "Appreciate how Andrew's beard appeared to have tripled in size from the thumbnail to the actual video. I guess no shave until 100K." Anyway.

13:15Andrew PoelstraIt's been over a year I've been growing this. If you knew how long I've been working on this, you'd be less impressed.

13:22Vlad CosteaI got to tell Chris from Cedor that this podcast is actually sponsored by Cryptosteel, which is the original metal plate backup from 2013. It has been around for longer than 10 years, is tested, is forked, is cloned. And you can get it from Cryptosteel.com and use promo code BTCTKVR to get 10% off.

13:48So I hope I dunked on you with this one, Chris. And he's also much taller than me, so I don't think I can dunk on him. Anyway, Andrew, you posted a blog post about what you can do with Liquid and OP_CAT. And this was back in 2021, if I'm not mistaken. It was way before OP_CAT became this meme, basically, that people are heavily promoting on Twitter and all over the place. And right now I see that there are two big camps, that actually there are more of them. There are so many proposals, it's hard to keep track.

14:24But the three main ones that I see that get traction and have advocates are OP_CTV, which was proposed by Jeremy Rubin. And that one has, I think, the most consistent advocates that they have been around for at least a couple of days and they keep on pushing it. But then someone else brought back OP_CAT, which is activated on Liquid and also has been created by Satoshi. And the fact that it was created and then disabled by Satoshi seems to be both the pro and the con argument for and against it. And then there's LNHANCE, which seems to be this new shiny thing which does a lot more than OP_CTV but seems to be built on top of it. You're the head of research at Blockstream. I guess you spent a lot more time than me looking into these. Why do you think these are the proposals and do you think there's anything better out there?

15:25Andrew PoelstraYeah. So OP_CAT, I can talk a little bit about. As you said, OP_CAT was disabled by Satoshi back in summer or fall of 2010, if I remember correctly. Satoshi also disabled a pile of other opcodes. These are all opcodes that had been in the original Bitcoin script, like in the 2009 launch. And they all turned out to have catastrophic issues that would have allowed somebody using these opcodes to basically crash all the nodes in the network.

15:58So the issue with OP_CAT in particular was that there were no limits on the size. So OP_CAT, just for context, is short for concatenate. It lets you take two things in the Bitcoin script interpreter and just paste them together. So what you could do is take an arbitrary object, like a single byte, right? And you could duplicate it and then use cat. There's a dupe opcode and then a cat opcode. You do dupe cat and now you have two bytes, right? And dupe cat and now you have four, and dupe cat and now you have eight.

16:25And like the parable of the chessboard and the grains of rice, right? You do that 64 times and now you have an object on the stack which is, you know, of size two to the 64, which is more bytes than have been manufactured, you know, on all of Earth, right? And you do it a few more times, you're at two to the 256, you're quickly beyond all the memory in the universe, even in principle. And so you just blow up people's memory and you crash their computer, right? So for OP_CAT, you need some sort of limit on the size of thing that you're able to produce. Because at the very least, if somebody tries to take up two to the 64 memory slots, you know, they should have to make a transaction that's that big, so they can't even get it onto their own computer, let alone to the rest of the network.

17:11You don't want this exponential thing, right, where you put 64 or 128 opcodes in a row, and then you get the exponential explosion. The other opcodes that were disabled had similar issues. I think OP_MUL also let you, multiplication let you produce arbitrarily large numbers. There were some bit shifts, some shifting opcodes that had undefined behavior, and on certain processors you could cause like trap representations and horrible things. I'm trying to think what else was disabled. It's kind of neat, if you want to do some archaeology in Bitcoin Core, it was just called Bitcoin back then and it was on SourceForge, not GitHub back then.

17:50You can find a few of these mega commits from Satoshi in the 2010s, when, like, probably nobody was really reviewing this stuff in some of these years, and he would just make wild changes to the script interpreter. And there are a couple around this period that disabled OP_CAT and the other opcodes, introduced the OP_NOP opcodes, and appeared to introduce the notion of a soft fork versus a hard fork, and the ability to upgrade the system without old nodes being kicked off. All of this kind of came together in summer of 2010.

18:21And of all the opcodes that got disabled, OP_CAT has always kind of stuck with us as the one that was really easy to fix, for one thing. The only issue was that there wasn't a limit on the size. You literally just put a limit on the size. You say if you're trying to concatenate two things and the result is bigger than like 500 bytes or whatever limit you want to put on it, then it's just not allowed. Okay, it's a single if statement. Return false. You know, if this, return false, and you're done.

18:49It's also extraordinarily powerful for how simple it is. It's been recognized for a long time that just using OP_CAT in conjunction with the other existing opcodes, even after the disabling, would unlock a whole ton of stuff. So as an example, we have arithmetic opcodes in Bitcoin: add, subtract. Well, those are the only two. And they're limited to working with 32-byte, sorry, 32-bit numbers. And if you want to do math on a larger number inside of Bitcoin script, you just cannot. Okay, if you have a 64-bit value, then you can't do it.

19:34But with cat, you can. Because with cat, if you have a 64-bit value, you just use cat to split it apart. So that's one slightly non-obvious thing. Cat puts stuff together. Every opcode in Bitcoin, you can kind of run backwards. And then this goes back to what I was saying earlier about witness data. If you have a 64-bit value you want to pull apart, what you do is you ask the user to put the pulled-apart data as witness data. You cat it together.

20:02And you compare the concatenated version to your target. And if it doesn't pass, then you fail the script. And so what that does is it forces the user producing witness data to do the separation for you. And you use OP_CAT to enforce that they're doing the separation properly. Very similar to how in script you verify a signature: the user has to produce a signature as witness data and the verification ensures that they do it correctly. There's always kind of this duality between a computation and verifying the computation, but cat lets you invert this.

20:32So cat lets you concatenate, it also lets you split. If you have a 64-byte value, 64-bit value, you split it. You do the math on the individual pieces. You do, you know, a bit more complicated stuff to deal with carries and whatnot, and then you put them back together in the end. So, voila, you got arbitrary precision arithmetic from the existing arithmetic in Bitcoin script. Similarly with cat and by reducing some opcode limits and stuff, you can get multiplication just by like repeating adding and stuff like that.

21:05You can do division. Division is dual to multiplication in the verify versus computation sense. You know, suddenly everything becomes a lot more possible. You can take your ECDSA signatures and you can split them apart into the constituent components of that and then do cryptography on the signatures in certain ways. And here we're kind of getting into my 2021 blog post, where I talk about how using cat you're able to break apart a Schnorr signature into two values. You're able to constrain one of the values. So a Schnorr signature real quick.

21:46I don't want to get too technical, but there's two parts to a signature. There's something called just the S value. S, I guess, is short for signature. And another part called the nonce. And the nonce is like an ephemeral key that you use just for the purpose of the signature. So the way a signature works is that you have your real public key, you have an ephemeral public key, which should be random. You mix them in a way that's kind of dependent on the message or the transaction that you're signing, and then your verification code, you know, makes sure that the mixing was done properly.

22:16So by constraining your nonce to be a particular value, you can constrain the S value to have a certain mathematical relationship to the transaction that you're signing, or to the hash of the transaction that you're signing. So by using OP_CAT, you can say the nonce has to be a specific value, and the S value we're going to analyze in some other way. Without cat, you can't do that. Without cat, you have the whole signature. So you either constrain the whole signature for equality, or you do nothing at all, and that's not super useful.

22:52So you use this cat trick on a transaction signature. And then you're able to basically reinterpret the transaction signature as a hash of all of the transaction data, all the transaction data that you're signing. And then, this is kind of cute, you ask the user to separately put all of the transaction pieces on the stack as witness data. You cat all of that transaction data together. And then you hash it and you compare the hash to the hash that you extracted from your signature. And the extracting from the signature, that also involves cat and some addition and some clever tricks like that.

23:33And then the result is, after all of these crazy machinations, you have all of the transaction data on your stack. The user has to provide all the transaction data as witness data. And now we have covenants. Because in your script now, so you do all of that as kind of a preamble, you just load it on there, now you have all of your transaction data. Now if you want to say, well, the coins are only allowed to move to a vault output, or something like that, or they have to be rate limited in a certain way, or they have to be returned to where they came from, or whatever you want to say, now you can do that directly in Bitcoin script by taking the relevant part of the transaction data and then doing ordinary script operations on that.

24:17And so that was kind of a pretty exciting idea, and that came from the mathematical simplicity of Schnorr signatures versus the old ECDSA signatures. So using ECDSA, we were already familiar of like an almost kind of covenant you could do. But it didn't quite work because the math underlying ECDSA, it wouldn't, there wasn't a way to extract a hash, a useful hash that you could reproduce in this way. Prior to Taproot and Schnorr signatures, we had another way to basically do the same thing. And this was in Elements and in Liquid and stuff like that.

24:57And this was a pair of opcodes: CAT and CHECKSIGFROMSTACK. So CHECKSIGFROMSTACK is an opcode that lets you check an arbitrary signature, a signature with an arbitrary public key on arbitrary data. So the existing Bitcoin script CHECKSIG opcode lets you check a signature on the transaction that you're spending. And you have something called sighash flags that let you kind of mask in and out various parts of the transaction that you maybe want to sign or don't. But you have to sign the transaction, right?

25:31You can't sign arbitrary data. With CHECKSIGFROMSTACK, you can sign arbitrary data. And this is maybe useful for things like oracle inputs. You could imagine you were trying to do like an insurance contract. And the way that you implement this in script is that you would like check a signature from the coroner's office declaring that a certain person had died on a certain date. And in that case, then a life insurance payout would go out or something like that. Or maybe more realistically, you would do this for like sports gambling, right?

26:02You'd have some sort of sports league and they would sign messages indicating that a certain team won on a certain day and so on. And then using this CHECKSIGFROMSTACK, you could pull those signatures into Bitcoin script and move funds around conditioned on the outcome of particular games. So the conjunction of CHECKSIGFROMSTACK and CAT is very powerful. And with the two of those opcodes, what you can do is you can check a signature on the transaction, check the same signature on an arbitrary message with the same key, and make sure that the signatures are the same and the keys are the same.

26:38And the effect of doing this is to make sure that your arbitrary message is equal to the transaction data. And now again, you're checking if something's equal to the transaction data. Well, you ask the user to put all that transaction data onto the stack, right? You cat it all together and then you check for equality, right? So again, using CAT and CHECKSIGFROMSTACK, you're able to force the user to put the transaction data onto the stack. You're then able to take that transaction data and do whatever constraints you might want on it.

27:11So we knew that, and we had that in Elements Alpha back in 2015. We had these two opcodes, and Elements Alpha later became Liquid. So that's been floating around as an idea for doing covenants for quite a while. And then the kind of exciting thing in my 2021 blog post was that we actually don't need CHECKSIGFROMSTACK necessarily. We can do almost the same thing just by using Schnorr signatures, just CAT by itself. And we'll probably talk in a moment about recursive versus non-recursive covenants and different layers of power.

27:49And this isn't the most powerful kind of covenant you can produce, but you can produce a kind of covenant using only OP_CAT. And this is kind of... This is super cool, right? Because CAT is not technically complicated. CAT is really isolated. It's like a five-line patch. I've got the BIP in front of me. Let me see, where's the reference code. Alright, it looks like it's about 10 lines, but you can squish them. It's a very small piece of self-contained code, right? You have two stack elements.

28:21Yeah, I can read the code right now, right? Check that you have two stack elements. If you don't, you fail. Then you combine the two of them. And then if the combination is too large, then you fail. And then if not, then you just put the combination onto the stack. So there we go. Very straightforward, self-contained code. You don't need to look at the transaction. You don't need to thread any complicated logic into the script interpreter. It's very much a simple algorithm that would be one of the simplest opcodes in Bitcoin Script.

28:54And just with that little bit of 10 lines of code that I'm able to review in real time here, you're able to get all this power. You get like arbitrary precision arithmetic, you get covenants, you get like all sorts of cool stuff. And this opcode, I would say, uniquely has that combination of, I guess, that ratio of power to complexity, right? It's just so much power for so little complexity. And so around the time that I wrote this blog post, maybe even a little bit before, myself and a few other people, including Ethan and Armin, who wrote the actual BIP, we got together and we were like, "We really want CAT in Bitcoin."

29:35So we had a Signal group and we were discussing how to do this. We're like, "Well, somebody needs to write a BIP." I don't want to write the BIP. Like, writing BIPs is a pain, right? It's really, like, you gotta have it formatted carefully. You gotta go through all this process. You gotta specify it. You gotta write test vectors. You gotta write reference code. You should have reference code in multiple languages. Like, you're gonna have to deal with a lot of bikeshedding. It's just not a...

29:59It's not a fun thing to do, right? Writing BIPs. And so we spent literally years playing hot potato, saying, "Well, maybe I'll write it in a few months, but you should write it, and then it will be done now." And finally, Ethan and Armin actually did it. And I cannot overstate how great it is that the two of them did this, like actually wrote the BIP and wrote a mailing list post and did all of the work, because I have been sitting on my hands about this for years and I would have continued for many more years.

30:29So the fact that they finally did it, you know, they sat down and just ground through, they spent several hours writing all this stuff up and then several days and weeks talking to the mailing list. And so when was this pull request opened? I can tell you how long it's been, and we don't even have the BIP merged. December 11th, right? So here we are, we're pushing three months, right? And it will be many more months before we even have the spec laid out. And then we got to talk about activation, and that's going to take many months to agree on activation parameters and then probably over a year to actually activate, assuming we come to an agreement on all of this stuff.

31:04Right. Because this is consensus, right? You need consensus to change consensus code. It's really spectacular that they finally did. And because they did so, that caused a lot of noise, right? So that's why CAT is kind of in the news, is that we have a BIP for it. It's a very small BIP. So that's maybe the other thing, is that CAT by itself, because it's so small, it's a proposed soft fork that has very little, almost no technical risk because it's so small and self-contained, right?

31:35That's kind of an exciting thing. There's kind of a feeling that maybe we can move forward on this because the last soft fork that we did in Bitcoin was Taproot. And amusingly, actually, with Taproot, we thought Taproot was going to be super simple, low technical risk, because the one before that had been SegWit. And SegWit was a scary soft fork, because SegWit introduced a new transaction format. It was a new format where you have the regular transaction data, and then you have this witness data, which didn't even exist as a field beforehand, kind of trailing on the end of it.

32:08And then both pieces need to show up in the block and be committed separately. So it's all committed, but now the commitment structure has changed. And you needed to make sure that pre-SegWit nodes were able to understand transactions sent by post-SegWit nodes. And you need that obviously for transactions to propagate, but also you need the pre-SegWit nodes not to ban the peer, not to say like, "You're sending me weird crap, so I don't like you, so I'm going to ban you."

32:36Because then you get like a fork in the network. Everyone would agree on the consensus rules because it is a soft fork in that sense. But there was a scary moment where, if on the peer-to-peer layer we caused a fork in the network, that's just as bad as a hard fork, right? Because then you can have all sorts of attacks because the network isn't talking to itself. So SegWit was huge and scary specifically for that reason. It's kind of funny to me because I wasn't dealing with so much of the heat.

33:04It's funny to me how much controversy there was around SegWit that was centered around things like the witness discount, which is that we weight witness bytes at a lower rate than non-witness bytes. And later we found out AsicBoost and stuff like that. When technically speaking, the controversy should have been around the peer-to-peer upgrade, the peer-to-peer network upgrade. But that was just so technical and obscure, and thanks to the hard work of the Core developers, it went off without a hitch. It was so technical and obscure that it never really leaked into the popular discussion. And of course we didn't want to, as technical people, right? You kind of want to minimize how many different things people are yelling at you about at once. But SegWit was scary. Taproot was not.

33:54Taproot was technically so much narrower. It was a new output type using a versioning scheme that SegWit had introduced, so that there were no changes to the peer-to-peer network. There were no changes to how blocks are validated. There were no changes to how anything got hashed. There were really no changes at all. It was just a new output type, a new output script type that we would match on and then apply the Taproot rules to them. And so old nodes would see this thing shaped like Taproot. They would say, "Ah, this looks like a new thing that has been added.

34:29I don't understand it, so I'll let it pass." That was a rule that SegWit added to make soft forks much easier, was that nodes would recognize things as future upgrades. They obviously don't know the Taproot rules because they predate Taproot, but they would know, like, "This is not an issue. I don't need to ban anyone. I don't need to reject the transaction. I don't need to reject blocks, you know. Just let it go." Taproot was super easy, and Taproot had this super bizarre drama where everybody was terrified that we'd have like a SegWit-like drama and split and like civil war and stuff.

35:01And there was all this fighting about how can we activate this without having a civil war, when there was nobody actually against Taproot. Everyone was just against causing people to be against, and there was like this weird virtual civil war. And then in the end we activated Taproot using this speedy trial scheme where we said, "Well, why don't we just try to activate it?

35:24And if anybody tries to stop it, then it won't happen, you know. And we'll just do this over three months." And we did it over three months. And of course, nobody tried to stop it. And here we are. CAT is even, actually so is CTV, so all of these script upgrades are even simpler than Taproot. We're not even adding a new way of interpreting scripts and a new output type. Here we're taking the existing script scheme and we're adding a new opcode in a slot that's already reserved for new opcodes, in a way that old nodes will still be able to verify everything except for specifically the new opcode, specifically when it's executed.

36:00And so that should be way simpler, right? There should be less controversy. And maybe we learned from Taproot that we don't need to be shouting at shadows and being afraid that someone's going to show up and try to stop us. CAT is even simpler than that. CAT is a new script opcode that doesn't even require any new transaction data. So for things like CTV, because CTV and OP_TXHASH and some of these variants, because these are checking transaction data directly, you need to change the script interpreter a little.

36:33So when you hit this opcode, you then need to look at the transaction context and take different pieces of the transaction and give those to the script interpreter. And we do this right now for the CHECKSIG opcode. That's the only place that we do this, because the CHECKSIG opcode checks a signature on the transaction. So to do so, it needs to hash the transaction before checking the signature. And if you look at the Bitcoin script interpreter, interpreter.cpp, you'll see that half, like literally half of the script interpreter is just about CHECKSIG.

37:03Every other opcode is this little kind of thing. So CAT is one of those little kind of things, right? It's an extra 10 lines of code. You don't need to feed anything into the script interpreter. You don't need to worry about, like, "Well, what if this data isn't present? Or what if somehow a null pointer leaks through here?" Or, you know, changing the code architecture is scary. Here with CAT, we're not changing the code architecture. It is just so unbelievably simple, right?

37:30And for people who are maybe tired or weary or wary of how technically complicated, and the QA cycles and the technical difficulty of doing soft forks, CAT, you look at CAT and you're like, "Wow, there's nothing to bikeshed on and there's nothing to be scared of."

37:50Like, we can maybe do this. So, yeah. That's the big benefit of CAT. And then one more thing I'll say about CAT before I hand back to you is that CAT is useful for more than just covenants, right? I mentioned, well, I've mentioned earlier, we can do things like, we can hash large amounts of data. We can do kind of arbitrary precision arithmetic or arbitrary width arithmetic. There's just a whole ton of things that we'd like to be able to do with OP_CAT that are not even necessarily related to covenants, versus something like OP_CTV, where CTV is deliberately narrowly tailored to allow you to do covenants, and specifically to allow you to do non-recursive covenants, and not much else.

38:43And there's a fear that maybe we activate CTV and it does 90% of what we want Bitcoin Script to be able to do. And then we won't be able to get that other 10%, because now the relative value of that last 10%, of getting recursive covenants versus non-recursive ones, that relative value just won't be there anymore. We've already got CTV. That's good enough. Nobody wants to go through the effort of doing an upgrade. Or maybe we do go through the effort of upgrading, and then we've got the CTV thing, which is like this vestigial object from 2024.

39:19And here we are in 2034 saying, like, why do we have to maintain that forever when we have this better solution that we just finally discovered? It just took us 10 years, right? People don't want to have that. And we've seen that historically with Bitcoin Script, where we've got kind of weird old features like pay-to-script-hash that are really no longer used at all, but any Bitcoin script interpreter or transaction validator needs to deal with P2SH, which is an innovation from 2010, I think, or maybe 2011.

39:56P2SH is a very old thing that we need to maintain forever and ever, right? So we're a little bit wary of adding things to Bitcoin because everything you add to Bitcoin has to be maintained forever, even if it stops being useful. So CAT is unique in that it's a small footprint. We know it will be useful forever, regardless of what other stuff we add. Nothing's going to ever replace CAT in terms of usefulness, unless we were to replace the whole script interpreter with like a Lispy thing or a Simplicity thing or something like that, right? But CAT, CAT is great. People like CAT. There's so many reasons to like CAT. So there you go.

40:28Vlad CosteaI think I'm sold on CAT right now. You did such a concise presentation of the features and the reasons why CTV might not be enough of what we need and might lead to other soft forks just to complete its feature set. With CAT, apparently you argue that we might get everything that we want. But some people are afraid of that and they say it can be used in evil ways. But before we get into that, I got to present another advertisement.

41:00This time it's Wasabi Wallet, actually everyone's favorite desktop privacy wallet for Bitcoin. It's the most downloaded, it's the most used, has the most liquidity. It does these humongous CoinJoins with up to 350, I think. Or I think the largest they ever did was 400 input and output CoinJoin. It's actually a pretty smart way to consolidate your UTXOs because it doesn't only divide your coins into smaller UTXOs, it also does consolidations randomly, and it's pretty cool. You can get it for free at wasabiwallet.io. If you CoinJoin less than 0.01 BTC, you pay no coordination fee, only the transaction fee.

41:47And what else is there to say? The guys at Wasabi are pushing privacy research. So if you download Wasabi and you use it, you're also supporting privacy research into other stuff. Maybe we'll get better privacy mobile wallets and better Lightning privacy and better stuff thanks to your contribution. So also, did you ever use Wasabi, Andrew? I'm curious to know what you think about it.

42:09Andrew PoelstraI have not, and I also haven't used JoinMarket. I like them. I like those guys and I like them as a project, but I've just never... It's one of those things. Them and JoinMarket are the two things that I've always felt like I should be using or should at least learn how to use, and then I've never taken the time. So, no.

42:32Vlad CosteaOkay. They also integrate this "buy anything" button. So there was a lot of FUD about the fact that once you CoinJoin, you're not able to spend your Bitcoin. Now they did this integration with ShopinBit, which is an online store. And basically you can pay from Wasabi and speak through a terminal with an employee from ShopinBit.

42:54You tell them what you want. All the communications are on top of Tor, so they're fairly private. And then you tell them to ship the stuff to some storage unit or post office box or whatever. And you can get whatever, anything you want and is legal. It doesn't work with Silk Road stuff, but it works with laptops. It works with phones. It works even with cars. They can buy cars for you using Bitcoin. It's pretty cool.

43:17Andrew PoelstraIt is pretty cool. I'll check it out.

43:20Vlad CosteaAnyway, we were talking about covenants and the fact that you're arguing that OP_CAT can basically do anything and everything and is fairly elegant and simplistic. But why do you think there's so much opposition to this?

43:41And I think it goes back to Greg Maxwell's argument that we should not add soft forks that are not universally useful for everyone. But at the same time, I see that there is some genuinely useful stuff that exchanges and large Bitcoin holders can do with covenants, and also for Lightning, and also for extending the functionalities of BitVM. So it seems to be very useful for businesses and for developers who want to build stuff. But the average user who only wants to maybe buy Bitcoin and stack it and put it in cold storage probably will never get to use these features. So how do you pitch this sort of functionality to them?

44:27Andrew PoelstraYeah. There... Well, let me quickly say regarding CAT and the power that it has, I should say two things. So one is CAT by itself can't do recursive covenants. We'll probably circle back to that. But recursive covenants are things like vaults where, in principle, the coins can stay in the covenant forever and ever, assuming, you know, that you go that path. Whereas with non-recursive covenants, always you need to say up front that it's going to leave the covenant in a certain number of steps.

44:58CAT can't do that by itself. CAT plus CHECKSIGFROMSTACK could. The other thing that I'll say is, even then, building covenants with CAT is pretty ugly. Like, you got to do that big construction I described, where you kind of indirectly require the user to put all of the transaction data, and then you pull it out. And in Liquid, when we started writing real covenants using that technique, we quickly realized, in conjunction with the 201 opcode limit that existed prior to Taproot, it was very hard to do almost anything at all.

45:34We were using almost our whole opcode budget just on this OP_CAT machinery. And in the end, when we upgraded Liquid to use Taproot, we introduced a whole pile of new opcodes that would just directly introspect the transaction. And so you get the same power as CAT plus CHECKSIGFROMSTACK, but you would need one opcode rather than like 17 or something like that. But then to go back to your question, you know, regardless of the technology, what about people who don't want... who are just like, "Why would we upgrade Bitcoin?

46:04Why would we add all the extra stuff when ordinary users don't care?" And so it's basically just a liability without a benefit for ordinary users. And I would say that it is a benefit for ordinary users in two major... there are two major ways. Let's choose three.

46:20So I'm going to say a third one, which is Lightning Network, which is difficult for me to summarize. But some of these covenant proposals, and in particular this SIGHASH_ANYPREVOUT notion, which is related but not the same as covenants, would allow the Lightning Network to work much more efficiently and have better resilience against nodes going offline and stuff like that. But the two direct covenant things that I want to talk about that users would care about: one is vaults, which I talked about. And I think anybody who is just stacking sats and who has long-term storage.

46:54So if you're spending all of your Bitcoins all the time, and some people use Bitcoin this way, that's pretty cool. But most people at least have some of their Bitcoins that they're just putting in a pile and never really intend to pull out. In this case, you would want something like vaults because it makes your custody that much... It de-risks your custody, right? It means that you've got these coins sitting there, and now if somebody steals your keys or anything, then they don't have the ability to immediately get your coins.

47:27So hopefully they'll just try not stealing your keys to begin with, because it won't really benefit them. But even if they do, you know, you can at least possibly claw them back or, you know, give some time where you retain partial control of the coins and can figure out what to do about it. Then the other thing that ordinary users would care about, that they wouldn't see, is stuff like Jeremy's CTV application, where you have an exchange withdrawing coins to many users and the users are able to withdraw their coins kind of at their will.

47:59And so what a user would see there basically is that, assuming their wallet had support for this particular construction, they would see that they had withdrawn coins from Coinbase or from LedgerX or Bitstamp or whatever their exchange is, and the coins were available, but they would need to create a transaction in order to claim them. And they would see like, here's the current prevailing fee rates. Here's how much it would cost, like with any transaction, right? Here's how much it costs to get confirmed in 10 minutes.

48:30Here's how much it costs for an hour. Here's how much it costs for, you know, days, never. The user could choose that, and they could also just let the coin sit there and wait until a low fee period. Because I know there's been... It's kind of funny, I mentioned getting rid of the 201 opcode limit. Well, because I did that, and I don't regret it, and I would do it again. But because I did that, we've got this inscription thing blowing up our fee market, which hopefully should blow over soon.

49:00The fee market still goes down on Sunday afternoons. There's a very persistent... for years, for basically all of Bitcoin's life, in the time that we've had a fee market, there's been a persistent pattern where during banking hours in New York, the fee rate goes way up, and then it goes down in the evenings and at night. And then in particular on weekends, it goes down a fair bit. And there have been a couple of periods where people were paying like dozens or hundreds of sats per byte during banking hours, and then it would go down to like less than 10 sats per byte on Sunday afternoon, like really dramatic.

49:31So the user can just sit there and say, well, I withdrew the coins. I can see that they're there. They're waiting for me. They're in my control. The exchange no longer has control of them. So if I'm worried the exchange will fold, or KYC me, or have their funds frozen or whatever, we're past that. But I don't have to take the coins until it's convenient for me. If I don't need them, I'm going to wait for Sunday afternoon and then I'm going to claim them there. And that, immediately, from a user perspective, right?

50:02That's very convenient. And then also, it would hopefully have a smoothing effect on the fee market, right? Because it's kind of an inefficient thing. You have fees being very high at certain hours and very low at other hours. It'd be much better if users could spread the load, so that you wouldn't have to deal with the fee market at times when it wasn't very convenient for you. And then the result would be that you're not joining them all during banking hours, you're instead moving over to... You know, you're instead pushing fee rates down during banking hours and up during Sunday.

50:38Right. And things will eventually smooth out and be lower overall. So I get the sentiment that an ordinary user and their wallet, they're not going to change, right? An ordinary wallet that's just like spending and receiving coins is not going to be using covenants in any creative way. But an ordinary user wallet that would be dealing with long-term storage would be using vaults, I would hope. And certainly you'll see the initial, like, Wasabi people, I'm sure, will have vaults on day one or something. All the kind of bleeding-edge technical innovator wallets will, and then mainstream wallets will eventually as well. Users will see that.

51:17And then even if they don't care about that, they would see overall that the network had more features and that they were able to withdraw coins from exchanges in a more efficient way, and in a way where they had more control over what was going on. So I think ordinary users would absolutely benefit from this in quite tangible ways, quite visible ways.

51:41Vlad CosteaYeah, Andrew, I see that you're wearing an Opendime T-shirt, and one of the sponsors of the show is Satochip, which produces the Satodime, which is basically a smart card that uses NFC and connects to an app on your phone and also has a card reader. And the point of this is to store assets, even on Liquid or whatever, or Bitcoins, and be able to transact them physically. And you can check them out at satochip.io, if I'm not mistaken. I can ask them to send you a demo unit if you want to check it out.

52:17It's open source and from this point of view, it's better than the Opendime, which for some reason is not open source. And I also need to mention the other sponsor before this ends, because we only have one hour. I usually do this every 20 minutes, but we don't have much time. The other sponsor is IVPN and they are a VPN provider that has pretty good privacy. They're up there in the top three with Mullvad and ProtonVPN. The way in which they operate is that they generate an account number. You don't have to register with email, you don't have to register with your credit card.

52:56You can get your free trial by sending an email to trial@ivpn.net. And after the 30 days trial, you can recharge, you can get more time by paying with Lightning. And I think Mullvad only allows on-chain transactions. IVPN also allows you Lightning transactions. I've been using IVPN for almost two years and that's why I've also reached out to them and said, "Hey, would you like to sponsor this show? Because you know, we have so much in common." And I can say that their servers are pretty fast and reliable and I haven't had many issues with them.

53:33And check them out, get the free trial. So going back to the topic, Andrew, do you believe that the next soft fork for Bitcoin and the biggest proposal that's going to be taken into consideration is OP_CAT?

53:48Andrew PoelstraI guess half of that. So I do think the next soft fork, I would bet, winds up being CAT. I don't think it's the biggest. I think CAT would be the next one because it's so small, basically. Right? Because there's a lot of, for one thing, it's very powerful. I've talked about why people like it and stuff, but there's also kind of a sentiment that people are maybe scared of Bitcoin ossifying too early or would like to see that a soft fork can happen.

54:19And some people want Bitcoin to ossify and say like, the protocol is rock solid, it's lasted forever, let's stop changing it. I think that's great, and I'm sympathetic to that, but I really think we need covenants before that happens. So I think we need at least one more soft fork. So the way I would imagine/hope that things would go is that we'll see CAT, possibly some other small opcodes like that, going in almost just to like flex our soft fork muscles. So like, remember, how do we do these forks?

54:51How do we do deployment? You know, can we do this without a whole bunch of drama? Etc., etc. But then I would expect that after CAT, there would be a kind of a real covenant proposal. And whether that's something like CTV or LNHANCE or whatever it winds up being, or TXHASH, which is kind of like CTV split into two opcodes, which then makes it much more powerful. Then I do think we would need another real fork. And I think that one probably would be a big deal.

55:24There would be a reasonable amount of drama around it. There would be some technical difficulty. It would be something much larger. It wouldn't be as complicated as Taproot and like nowhere near like what SegWit was, because none of these things touch the peer-to-peer network. None of these things touch the way block headers are validated, which is really probably we're never going to touch the... Well, I shouldn't say we're never going to touch the peer-to-peer network, but we're never going to do a consensus change that affects the peer-to-peer network.

55:52We will actually, in the next version of Bitcoin Core, whose feature freeze is in a couple of weeks, we will have something called BIP 324, which allows encryption on the peer-to-peer layer. But that's something that's purely, nodes can opt in. It doesn't affect blocks or transactions or anything like that. So it's not a forking change, it's purely peer-to-peer. The stuff is still happening there. But we're not going to see forks that were like, there's a fear of forking, I would expect, after how difficult SegWit was.

56:21And I also similarly would, it would surprise me if we do anything that touches block headers. It would really surprise me after the drama again with SegWit, where it turned out that there was this AsicBoost thing going on in the background and us changing the headers caused miners to have difficulty. And then they were threatening to use kind of a veto power to interfere with that. But just looking at transaction outputs and opcodes, these are, as I've been saying, these are very narrow, very safe soft forks.

56:57Right. And so I could see those kind of things happening for several more years at least. I would kind of hope for a little while that we get into a cadence of doing this and kind of patching up missing functionality like OP_CAT and so forth. And actually another BIP that I think is a BIP, or maybe it's only a BIN, by Chris Stewart, I think, is one that adds 64-bit arithmetic. Because one of the reasons that OP_CAT is kind of a crappy way to do covenants is that if you want to look at transaction values, well, the arithmetic opcodes in Bitcoin, as I said, are all these 32-bit things.

57:44But the amounts in Bitcoin outputs are 64 bits. So if you're just using CAT to pull apart your transaction and then analyze it, you're forced to break apart these 64-bit values and then do arithmetic and like manually handle the carries and stuff like that. So I would hope we get CAT. I would hope we get 64-bit arithmetic. I would hope we get the ability to hash arbitrary amounts of data without having to build a single giant stack element and then hashing it all at once.

58:09And then I would hope we get covenants, like real covenants, like first-class covenant support, right? And then, okay, then I would hope that we got like a real script interpreter, something like Simplicity or, AJ Towns wants something like Lisp-based, like similar to Chialisp or something like that. But there we're getting into a place where that's in the far future. That's at least a decade away, right? And that's so big that it wouldn't surprise me if we just can't. Bitcoin has ossified too much to do something like that.

58:43But it hasn't ossified enough to prevent things like CAT. And I don't think that it should have. And I'm not going to stand there saying, let's stop this because we don't want the system to change. I think there's a lot of kind of low-hanging fruit in that there are upgrades that we could do that are just simple opcode improvements like this. And I would hope that we would see those. But yeah, to answer your question, I think/hope that CAT will be the next one.

59:09But it's really because CAT is small. And I think the next big one would be something like CTV or TXHASH or LNHANCE or APO or, you know, all of these kind of big, big changes.

59:20Vlad CosteaI think we have only 10 minutes according to the one hour time slot that you gave me for this interview. And I think there are two issues that I really want to cover before we end this. Of course, there is a lot more that I want to ask you about, like zero knowledge proofs and advancements in cryptography and what you're currently researching.

59:46I think that's super interesting, but maybe we can save it for another interview. Right now, the two topics that I want to cover in these 10 minutes are, first of all, BIP 300 and 301 drivechains. Because if you ask Paul Sztorc, he's going to talk to the miners and he's going to convince the majority to activate that one. And it doesn't matter what the users want, because apparently that one is going to get activated through miners. And that's another conversation to be had. And one that people have been pushing me to ask you about is, or concerns, Mimblewimble extension blocks, because that one has been activated on Litecoin.

1:00:28Back in 2016, you did a couple of presentations where you're super excited about this. And it seems like, at least in the Bitcoin space, this hasn't been pushed anymore, even though there is an actual implementation that has been around for almost two years in Litecoin. There seems to be this belief that whatever gets tested on Litecoin becomes a serious contender for getting activated on Bitcoin. So you get to choose which one you want to answer first. Is it BIP 300 and 301, or Mimblewimble extension blocks?

1:01:06Andrew PoelstraYeah, so well, I'll talk briefly about drivechains first, which is, kind of the history of sidechains in Bitcoin is that back when we being like me and other Blockstream founder kind of people, were really excited about sidechains, we were thinking about these, what are called merge-mined sidechains, where you have a separate blockchain where the Bitcoin miners, as a side effect of mining Bitcoin, are also mining sidechain blocks. And in order to move coins back and forth between the two chains, you would basically produce kind of a transcript of a bunch of blocks that had happened on the sidechain.

1:01:41So you'd be able to demonstrate to Bitcoin that, assuming the sidechain rules have been followed honestly, you had control over these coins and therefore you should get them back on Bitcoin. I'm greatly oversimplifying, but the rough idea there is that you're using the proof of work mechanism to kind of attest to Bitcoin that valid behavior has happened on the sidechain. So that way on the sidechain, you can go do confidential transactions, and you can do Mimblewimble and you can do covenants and you can do whatever you want.

1:02:13That maybe Bitcoin doesn't want or doesn't want yet. And you can still do it with real bitcoins, right? You take your real bitcoin, you move it to the sidechain, use all these new features, you move it back, and Bitcoin kind of looks at the transaction out. Well, it doesn't look at the transaction out, says whatever, you're freezing coins, that's fine. It looks at the transaction back in and says, well, are there a bunch of valid blocks that led to you controlling the coins you're moving back in?

1:02:41And if so, then that's cool. We'll take it. And the issue with this is it has all sorts of crazy incentives where miners have the ability to rewrite the sidechain. And if they're not getting a lot of fee revenue necessarily from the sidechain, they may not really care about moving the chain forward. So they can do things like rewriting the sidechain and basically double spending. So you can move the same coin back multiple times by moving it back and then you rewrite the history that allowed you to move that coin back.

1:03:11And then you do it again, right, with a new rewritten history. And this isn't a risk to Bitcoin because you can only move back coins that have been moved out, right? Like Bitcoin will always enforce solvency. But it's a risk to people on the sidechain, because then eventually honest sidechain users, they're going to move the coins back. They're going to go to unfreeze the coins and they'll see, well, there are no coins left to unfreeze because miners stole them all, right? And these kind of incentive issues are very difficult to resolve. And for us at Blockstream, we kind of eventually threw up our hands. So we can't really resolve the incentive issues. So that's...

1:03:51I don't know, we need like zero knowledge proofs, like somehow Bitcoin needs to really validate the sidechain rules. And even then there's this rewriting issue that maybe we need to do some exponential backoff or, I don't know. Like it's quite difficult. What Paul Sztorc does, in kind of a classic troll economist tradition of people like Robin Hanson, is another good example, he's not a Bitcoin person, he just leans into the incentives and says, okay, fine, that's the incentive structure. And I am going to try to shape this to build an incredible machine, a Rube Goldberg machine of incentives.

1:04:26And it's all going to just fall into place. So everybody's incentivized to do this. And where there are risks, people are going to insure against them. And there will be, like, somehow the system will work to construct financial derivatives that will allow you to hedge against certain failures. And this will discourage miners from behaving badly and so on. And I don't buy it, basically, is kind of my conclusion to that. My feeling is that if you're going to do stuff with incentives, don't, if you can get away with it.

1:04:58Sometimes you can't, right? So Bitcoin itself, right, the way that the Bitcoin chain advances is entirely incentive based. So miners all want to extend the majority chain because that's the chain in which they get their block mining rewards. But in theory, if they were strong enough, then they could go rewrite the chain and then get different rewards and move transactions, but they'd lose fees and so on. The only reason miners extend the chain is because they're incentivized to, right, by the rules of the network. There's no cryptographic means of enforcing that everybody stay on one chain. So that kind of sucks.

1:05:34But, you know, it's kind of just a narrow thing. And we have guardrails around it. And in the end, we kind of live with it. And that's probably historically been the most controversial thing about Bitcoin as a technical solution to the double spending problem, to the eCash problem, was this incentive-based component at the core of it. So building something that's much more complicated with, like... I just don't like using incentives.

1:06:00I feel like incentives are quite difficult to reason about. And you've got to think carefully about trolling and griefing and stuff like that. So I'm not a fan of Drivechains as a concept for that reason. And I even worry a little bit that if Drivechains got a lot of traction, that it could distort the incentive on Bitcoin for miners to produce valid blocks, where it may be that they would want to rewrite Bitcoin blocks in order to cause grief on the Drivechain or something like that.

1:06:30But Paul is kind of correct that, technically speaking, if the way this all works is the miners producing proofs and the miners committing to stuff, there's no need for the rest of the network to even care what miners are committing to. And there have even been kind of similar schemes where people just like slip commitments of stuff into normal Bitcoin transactions. And then the Bitcoin miners wind up timestamping or ordering stuff that they're not even aware of existing, right? Let alone the rest of the network.

1:06:58So that's what I think in five minutes. So let me switch over to extension blocks and Mimblewimble. As you say, in 2015 or 16, I think it was 16, when the Mimblewimble kind of white paper text file dropped, there was a lot of excitement around it.

1:07:15It was like a super compressed blockchain scheme where you have all this cut-through and then, depending how you structure the peer-to-peer network, you have really good transaction privacy, where, assuming you can onion route things and work out those conflicts and whatnot, you can take like a whole series of transactions, right, where I send coins to you, goes to, you know, party C, D, E, F, and those all get compressed. So it looks like I'm just sending transactions to F. And then that's what shows up on the chain, so super fast to validate and so on. This was a super cool, exciting idea. And this let us get like Zcash slash zero knowledge proof style transaction compression, or like what we would now call rollups. It basically gave you rollups.

1:08:03Not quite. There was this little piece called the kernel, but it gave you rollups without general purpose zero knowledge proofs. Just like without any new moon math, without any new crypto at all, using just 2016 era cryptography, right? We could get rollups. Like, that was super exciting, but it came with a cost, which is that you don't have any scripting capability. And so I kind of personally spent a bunch of time thinking, how can we get some sort of scripts in Mimblewimble? And I came up with a scheme called... at the time, I called scriptless scripts.

1:08:35And now we just kind of call it adaptor signatures, which is like the specific technology as part of this, where you can kind of abuse multisignatures to work like hash challenges. Where if I want to send you coins conditioned on you revealing a hash preimage, so I'm like buying the hash preimage, what I can do... well, what I do with Bitcoin Script today is I write a script that says you can take the coins provided you provide a signature, obviously, because it's your coins, and also that you reveal the hash preimage.

1:09:10So it's a big script, everybody can see the hash, everybody can see the preimage, which, you know, is not great privacy, not great efficiency. Instead, what I can do with adaptor signatures is I can move the coins into a 2-of-2 output that we jointly control, just using like a Schnorr multisignature, and then we do this interactive adaptor signature protocol where I sign, I contribute my half of a multisignature to give you the coins outright, and then you have to contribute your half to the signature in order to complete the transaction and take it.

1:09:43And as part of this protocol, I'm able to take your half of the transaction, kind of decrypt it. So we're like doubling the signature and the encryption. Decrypt it and then extract the hash preimage. So now what hits the chain is one key, one signature. But what actually happened was this kind of hash preimage exchange thing. So that was super cool. So all of a sudden that gave you like Lightning on Mimblewimble, right? It was my first thought when we figured this out, because Lightning depends on this ability to have hash preimages and have them be revealed.

1:10:13That's really the one thing you need, that and also timelocks. And timelocks, we can kind of hack in using VDFs, verifiable delay functions, where you just have a signature of sorts that takes the counterparty multiple days or weeks to produce. And then you have to put a bunch of leeway to compensate for maybe they have ASICs and so on. But you can kind of do delays using crypto. Then, so we get Lightning on Mimblewimble. All right. But then we realized, kind of around the same time, we were developing Taproot.

1:10:46And then I thought, wait a minute, I can just use this on Bitcoin with Taproot. And now Taproot on Bitcoin, I've got this public key, one key, one signature, where this one key, one signature can represent, you know, arbitrary numbers of parties, multisignatures, threshold signatures; with adaptor signatures they can represent like HTLCs, PTLCs is what they're now called, the point time-locked contract. And then also with Taproot, you have like a real scripting system kind of hidden in there that you can use if you need to. If like you run out of crypto tricks and you have to use the script system, it's right there.

1:11:22And so for me personally, all of my excitement moved to Bitcoin and Taproot. Like, I solved the Mimblewimble problem and then it was just as useful, possibly more so, on Bitcoin. And then all of a sudden, my excitement about Mimblewimble kind of... Personally, this is not like, I mean, I guess it happened to a lot of people, right, which is why there's maybe less excitement. But personally, that's what happened and why I shifted away from it. And then separately, also with Mimblewimble, there's a lot of complexities of the peer-to-peer network that the Litecoin people are familiar with.

1:11:53So those are my thoughts about Mimblewimble. And then as far as extension blocks, extension blocks are a bit scary. They're almost like they're a way to kind of replace the entire transactions, replace all the transactions in the block with a new scheme without doing it as a hard fork. And I feel like I don't know if that would fly on Bitcoin. I think I would probably campaign against it and say, if you wanted to change the transaction structure so dramatically, you should just do it in a hard fork.

1:12:30Now, with something like Mimblewimble, where there's trade-offs in both directions, right? You move to Mimblewimble, and then now you have kind of cryptographically assured solvency, rather than like you-can-count-all-the-coins form of solvency. And you have CT, which is slower, and the range proofs, which are evolving, and so on. And so people might plausibly want to use both sides. So it's an extension block in kind of the true form. You've got two different pieces of the block, right, that have different transaction structures, and you can move back.

1:13:00But traditionally, what I think of extension blocks are like, you're kind of like trying to replace the old block style and then squeeze out the old transactions. And now you just like completely changed Bitcoin out from under old validators, where old validators who don't know or check it can no longer see any transactions. All they perceive is Bitcoin has gone to empty blocks. And maybe this is just like a form of squeamishness or something, but it just feels very weird to me. And it's super cool that Litecoin is doing this and experimenting with this and it's like built into playlists and stuff.

1:13:38But my feeling when I think about doing that kind of thing in Bitcoin is like some sort of squeamishness, I guess. So I'll stop there.

1:13:51Vlad CosteaAnyway, just before we wrap this up, because we went a bit over time and I'm super grateful for this. I'm happy that we got to have this conversation. There is Moonsettler on Twitter, who is one of the biggest advocates for OP_CTV. And he wrote a comment and said, "I'm going to regret listening to this." And then said, "No, I think he's a big CAT fan and doesn't appreciate the design principles that led to CTV." And there's also, what's her name? Just a second. She wrote a funny comment, Noren. I hope I'm not mispronouncing her name. She says, "Talking all serious about cryptography with a nail clipper in his hand. I think this is wholesome."

1:14:36Andrew PoelstraI like it. I like it. So I've got to wrap up like in the next 60 seconds, because I've got to run, but I'll let you kind of finish up.

1:14:44Vlad CosteaThank you very much, Andrew. Just mention where people can keep up with your work, follow you and learn more about what you're doing.

1:14:52Andrew PoelstraCool. Thanks. I'm glad to be on. And I'm not really on any social media, is the thing, but you can check Blockstream Research's Twitter feed, at BLK research, X feed, sorry.

1:15:11I'm on GitHub. My username on GitHub is apoelstra, and you can kind of see what it is that I'm doing. But as far as social media, I'm still on IRC. I'm Andytoshi on IRC, so if you want to join Libera or OFTC, I'm on like the #bitcoin-wizards channel and stuff like that. So all those 2010 era things or 1990s era kind of things are still going. And that's really the only social media that I'm on, is me and a bunch of graybeards on a flat screen with text. So there you go.

1:15:40Vlad CosteaOkay, Andytoshi, thank you very much for this. And I hope I'll get you in another interview to talk about more interesting stuff.

1:15:47Andrew PoelstraYeah.

1:15:47================================================================================ Production notes: Remote video interview livestreamed in English on YouTube and Twitter/X, opening with Vlad checking that the stream is live, with no music intro evident in the text and sponsor segments read live by Vlad. Correction: anthropic/claude-opus-5.5 via NanoGPT in 6 windows with a whole-episode speaker/glossary plan, the show notes, the Qwen3-ASR full pass (102 chunks) and 21 Scribe v3 re-checks of doubtful spans; second opinion: /workspace/zcash-documentary/transcripts/S15E17.timed.txt (read-only); [unclear] resolve pass: 2 of 2 flagged paragraphs re-checked. Automatic checks: word count vs raw, timestamps, seam duplication. Fixes: Removed hallucinations ("The End.", "Episode #1: The Coin", "Andtre Poelstra: OP_CAT."); restored dropped speech (staging-area/sending coins to Vlad, "kind of fits that mold of", "Sure", "Chris from Cedor said, Appreciate how Andrew's beard") from second ASR/Scribe; fixed soft fork, Blockstream, MES vaults, "what a vault is", Ethan Heilman/"He said", memesphere, multisignatures, boogeyman, Cryptosteel, metal plate backup; split speaker turns Vlad/Andrew (welcome, covenants answer, chat comment, beard reply, sponsor read); Speaker repair: Vlad question through 00:14:40, Andrew from 00:15:25. Fixed OP_CAT/OP_CTV/LNHANCE/Blockstream/Schnorr/ECDSA/nonce/CHECKSIGFROMSTACK/CHECKSIG/sighash/OP_MUL/OP_NOP/SourceForge/traction/hash. Restored dropped speech (catastrophic issues, size/OP_CAT context, "few more times... 2 to the 64", "really easy to fix") from second opinion/ASRs. Removed hallucinations "Episode," and "Episode 5.0."; All turns assigned to Andrew Poelstra; fixed CHECKSIGFROMSTACK, Schnorr, OP_CAT/CAT (CAP/Cali/OpCal), BIP/BIPs (bit/bitmerge), bikeshedding, SegWit (Segwa/segment), pre-SegWit nodes, Taproot (Tablet/Tappert/Taupert), CTV (C2B), OP_TXHASH, CHECKSIG, AsicBoost, "SegWit added", "had" vs "have", "Signal group", "how to do this", "hard fork"; removed fillers; split long paragraphs with interpolated timestamps; Speaker repairs (Andrew/Vlad turns at 00:40:28, 00:42:09, 00:42:32, 00:43:17, 00:43:20, 00:44:27); removed "Bye-bye." hallucination; restored dropped speech ("unless", "So, no", "there are two major ways. Let's choose three", "And then you tell them to ship the stuff to some", "days, never", "opcode limit. Well"); fixed OP_CAT, CHECKSIGFROMSTACK, SIGHASH_ANYPREVOUT, JoinMarket, ShopinBit, CoinJoins, UTXOs, Coinbase/LedgerX/Bitstamp, sats, banking hours, nodes, claw back, Opendime, Satodime, satochip.io, "sold on CAT"; Restored dropped IVPN text ("operate is that they generate an account number... register with email"); fixed Opendime, Mullvad, trial@ivpn.net, OP_CAT/CAT, soft fork, LNHANCE, TXHASH, Taproot, SegWit, AsicBoost, BIP 324, feature freeze, peer-to-peer network, BIP/BIN, Chialisp, BIP 300/301 drivechains, Paul Sztorc, Mimblewimble, merge-mined, "you're freezing coins", "honest sidechain users", "manually handle"; removed "Thank you." hallucinations and false "David Gardner"/"CK LIN" labels; split Andrew answer at 00:53:48 and Vlad question at 00:59:20; Speakers assigned (Andrew monologue, Vlad chat read/outro, Andrew closing); fixed Mimblewimble, Taproot, adaptor signatures, hash preimage, threshold signatures, Drivechains, onion route, incentivized to, OP_CTV, apoelstra, Andytoshi, Libera/OFTC, #bitcoin-wizards, graybeards; restored dropped IRC speech; removed inserted "Thank you." and "Bye."

← Back to the episode · All transcripts · Ask the Archive

0:000:00