In this episode of the Van Wirdum Sjorsnado, Aaron and Sjors dive into Miniscript and how it makes using Bitcoin Script much easier. Helpful Links: Chapters 00:00:00 Miniscript and Bitcoin spending conditions 00:03:34 A stack-based Script example 00:08:41 Why combining arbitrary scripts is dangerous 00:12:35 Miniscript templates and safe composition 00:14:23 Analyzing complex wallet policies 00:18:09 Policy languages express spending intentions 00:22:15 Compilers optimize transaction costs 00:23:46 Miniscript limitations and optional adoption 00:25:57 Minsc and practical wallet integration Support the Show! Follow Bitcoin Magazine on Twitter @BitcoinMagazine Follow Aaron van Wirdum @AaronvanW Follow Sjors Provoost @provoost Music: Song Title: Segwit Sounds By: The NakamoTones Album: Citadel Music Produced by: Bitcoin Audio
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
Aaron van WirdumLive from Utrecht, this is the Van Wirdum Sjorsnado.
Sjors ProvoostHello.
Aaron van WirdumEpisode 4, we're back.
Sjors ProvoostYes, we made it.
Aaron van WirdumSjors, so far so good?
Sjors ProvoostI think I'm still alive.
Aaron van WirdumDo you think this is going to be a one-taker?
Sjors ProvoostI hope so.
Aaron van WirdumLet's hope so. This would be a miracle if we can get this one right at once.
Sjors ProvoostYeah, let's see.
Aaron van WirdumWhat are we going to be discussing today, Sjors?
Sjors ProvoostI think you wanted to talk about script.
Aaron van WirdumI want to talk about Miniscript to be more specific.
Sjors ProvoostIn fact,
Aaron van Wirdumyes. That's what I want to know everything about, Sjors. So you're going to help me.
Sjors ProvoostOkay.
Aaron van WirdumIs that the deal?
Sjors ProvoostSounds good.
Aaron van WirdumYes, Miniscript. It's a project, I guess that's how I would describe it. It's a project by a couple of Blockstream engineers, even though it's not an official Blockstream project. But it's Peter Wuille, Andrew Poelstra. And then there was a third name that wasn't as well known, Sanket Kanyalkar.
Sjors ProvoostYeah, I believe he was an intern at Blockstream at the time.
Aaron van WirdumHe may have been an intern, yes. So they developed this idea called Miniscript. Um, so let's just get into what it is. It's... Okay, so to sort of spoil what it is a little bit before we get into that, it's sort of a simplified, stripped down version of Bitcoin script which is the programming language used in Bitcoin. Yeah, so far so good.
Sjors ProvoostYeah, or it's a template. Basically, it's a template of Bitcoin scripts that you can use.
Aaron van WirdumA template of Bitcoin script is how you would describe it? Yeah. Okay, so let's get started. First things first: Scripts, Bitcoin scripts.
Sjors ProvoostYeah, I think two episodes ago, we explained that it was actually good to add constraints to money.
Aaron van WirdumRight, yes. This was in that Taproot episode. You explained how actually putting some restraints to money would be a good thing in the context of Bitcoin.
Sjors ProvoostRight. If you're sending me money, everybody can see that Bitcoin transaction, so you want to make sure, or in particular, I want to make sure that I'm the only one who can spend it. So I'm telling you, make this transaction such that it can only be spent by my public key. And the way that's done is using a script. Even though it's a very simple script and most people use the same script, it is actually a script.
Aaron van WirdumYeah, and script is actually a programming language.
Sjors ProvoostYes.
Aaron van WirdumIt's a new programming language. It was introduced in Bitcoin, like it didn't exist before, although it resembles something that did exist before, which is called Forth.
Sjors ProvoostYes. Basically, it's pretty horrible. I mean, it looks like it was just
Aaron van WirdumIt's a horrible programming language.
Sjors ProvoostI think so. It seems to be coupled together as an afterthought. But I think it was only later that people realized that you can only change Bitcoin through very carefully crafted soft forks. So you can't just say, oh, let's just start with a draft language and then clean it up later. So it's been a complete nightmare to make sure that language doesn't do anything surprising, anything bad. So a lot of the... operations that were part of the language have been removed almost immediately because there were all sorts of ways that you could just crash a node or do other things.
Aaron van WirdumRight, these were removed early on.
Sjors ProvoostYes. I mean, Ethereum had a similar experience in 2015, right, where complex programs could do all sorts of unexpected things. But Bitcoin had that in the beginning too.
Aaron van WirdumYeah. So just to remind our listeners, like what kind of restrictions can you put on a transaction? Like what kind of restrictions are we talking about here?
Sjors ProvoostYeah. So the main restriction would be that only the owner of a specific public key can spend this transaction. I think that's the typical pay-to-public key hash transaction. And maybe we want to demonstrate how that works.
Aaron van WirdumGo for it.
Sjors ProvoostYeah. So it's a stack-based language, and a stack is like a stack of plates. You can put plates on it, and you can take the top plate off, but generally you don't want to just take a plate out of the middle. And this is just easy to implement as a programming language in general. So when people make early computer processors, it was just easier to have a memory where you could only put things on top of it and take the top element off. You didn't have addresses. Like with memory, you have to say, which part of the memory do you want? With a stack, you
Sjors Provoostjust say, put something on it, take something away from it. So the standard Bitcoin script reads as follows. It's very beautiful. It's OP_DUP, as in double, duplicate. Then OP_HASH160, as in take the 160 SHA hash and RIPEMD hash. Then the public key. And then OP_EQUALVERIFY. So it's four elements, duplicate, hash, pub key, and then equal verify.
Sjors ProvoostAnd if you kind of walk through what that does, let me see where I have it. So what happens when the blockchain encounters this script, it's going to be in the output of a transaction. So the output of a transaction shows the script that it's locked with and the amount. Now, if you want to spend that, what you do is you first publish You publish what you want to put on the stack, and then you sign it, essentially. Well, actually, you just publish what
Sjors Provoostyou want to put in the stack, and that probably includes a signature.
Aaron van WirdumBy publish, you mean generate a new transaction?
Sjors ProvoostYeah, so the input of your transaction, what that actually looks like is basically... a couple of things that you're putting on the stack. And what the Bitcoin interpreter will do is it will see the stuff you put on the stack, and then it starts running the program from the output. So given your stack, it starts running the program from the output. So in this case, what you put on the stack is your signature and your public key. Because the original script did not have your public key, it had the hash of your public key. Okay, so we start with a stack that has two plates. Plate one at the
Sjors Provoostbottom is your signature, and on top of that is a plate with your public key. And then the script says OP_DUP. And what OP_DUP does is it takes the top element of the stack, takes the top plate, the public key, and duplicates it. So now you have two plates with a public key at the top of the stack, and your signature is still at the bottom. Then the next code, the next instruction, is OP_HASH 160. So what this does is it takes the top thing from the stack, which is one of those public keys. It hashes it and then puts the hash on the stack. So now the stack
Sjors Provoostis... I'm trying to interrogate you here.
Aaron van WirdumApparently. Now the stack is a hash and the public key... I didn't keep up.
Sjors ProvoostYeah, so at the bottom is still the signature. Then there's a public key and then there's the hash of the public key. That's what's on the stack. So the next operation is pubkey hash. So that is the hash of your public key again. So now the top of the stack is two times the hash of your public key. And then the next operation is op equal verify. So that basically takes the two things off the top of the stack, says, hey, are they the same? So indeed, did you put the hash of your public key? And then the last thing that's left on the stack is only,
Sjors Provoostagain, your signature and your public key. And it calls OP_CHECKSIG. So it checks the signature using your public key. And then the stack is empty and everything is happy. That's how the Bitcoin program is run, and you can do arbitrarily complicated things that way.
Aaron van WirdumSo, yeah, so basically this stuff is telling your computer what to do, what to check, see if stuff matches. If it matches, it's okay. If it doesn't match, it's not, depending on whether it should match or not, and that's defined by the code. That's what we're doing here, right?
Sjors ProvoostYeah, but notice that you don't have to check a signature.
Aaron van WirdumExactly.
Sjors ProvoostYou could just have a script that says, yeah, it's fine, just take it.
Aaron van WirdumYes. Or you could have a script that says you either need a valid signature or you need 34 invalid signatures.
Sjors ProvoostYeah, you can do weird things. Yes, very strange things.
Aaron van WirdumOkay, so that's kind of the point we're getting at here, I think, right?
Sjors ProvoostYes.
Aaron van WirdumThe script's language is diverse enough to allow for weird stuff.
Sjors ProvoostYeah. And now the question is, if you're just sending money to yourself, you only need this very simple standard script that everybody's seen a million times. But let's say you're collaborating. You want to do a multisig. Now, there's actually an instruction to do multisig, but let's say that didn't exist. So one way you could do multisig is, say, the script we just explained with my public key in it or my public key hash, and then the script we just explained with your public key hash. Just in sequence. So if that's executed, I will not repeat the process we
Sjors Provoostdid before, but you essentially start with those two public keys and two signatures on the stack, and you run both of these scripts in sequence, and then if both people signed, it's all good. So you have a poor man's... multisig.
Aaron van WirdumRight.
Sjors ProvoostBut if I'm evil or stupid, I could make this a rekt-man multisig. Sorry for the joke. And that is achieved by, in the middle, inserting an opcode called OP_RETURN.
Aaron van WirdumRight.
Sjors ProvoostAnd the OP_RETURN code basically says, all right, stop evaluating this program. You're done. Now, if I had an electronic lawyer that wanted to check that this multisig... is what it says it does, or in fact, if you have that lawyer, your lawyer might say, well, I see that my signature is being checked, and whatever the rest of the script does, I don't care, but my signature is being checked, so I'm happy with this. But of course, you shouldn't be happy with this, so your electronic lawyer should see that OP_RETURN statement and warn you. But the problem is there's a trillion ways in which scripts can go wrong, and that is why
Sjors Provoostyou need a standardized... way of dealing with these scripts and that's where Miniscript really comes in.
Aaron van WirdumI'll read a little fragment from Andrew Poelstra who I interviewed a long time ago when I wrote an article on this. So the example he gave was, and I'm not going to pretend like I understand everything he said in this quote, but that was sort of the point of the quote for me, that it was you know, exemplifying the complexity of potential ways to mess around with script. Anyways, so the quote was: "There are opcodes in Bitcoin script which do really absurd things like interpret the signature as a true false value, branch on that, convert that
Aaron van WirdumBoolean to a number, and then index into the stack and rearrange the stack based on that number. And the specific rules for how it does this are super nuts." You probably actually follow that perfectly.
Sjors ProvoostNo.
Aaron van WirdumOh, you don't either.
Sjors ProvoostI kind of do, but the analogy would be you have this stack of plates and you take a hammer and you smash one and then you confuse two and you paint one red and then it still works if you do it correctly. It's completely absurd.
Aaron van WirdumRight. Or another analogy I think you gave before this recording, correct me if this is not the right way of explaining this analogy, but it's like you have a contract. And it says, you know, you're buying this house and these are all the conditions. And then there's a small letter which says, unless there's like two commas in a row somewhere in this contract, in which case all your base are belong to us.
Sjors ProvoostExactly. Except that this will be like the law, right? So the contract doesn't say that at all. It's just that the law that's in this country has that stupid rule. Like if there are two commas in a contract, you're giving away your money. That's the script interpreter of all the consensus rules, which are quite complicated.
Aaron van WirdumYes. Okay, so I think we've now broken down the problem with Script. It's... It's a shitty programming language, or at least it's easy to make mistakes or hide bugs in there and make all sorts of complex arrangements that people might or might not notice, and then your money goes to places where you don't want it to go. Is that the best way? That's the summary, right?
Sjors ProvoostYeah, and we've seen in other projects how bad things can go if you have a very complicated language that does things you're not completely expecting.
Aaron van WirdumAre you referring to a project that rhymes on Metherium? I think we're on the same page. Okay, so solutions. We're getting to the solution part of the story.
Sjors ProvoostSo what you're basically doing, what Miniscript is doing, is it's taking certain example scripts, so a sequence of opcodes, and it lists, I think, about 20 of them. 20 templates.
Aaron van WirdumThis is Miniscript.
Sjors ProvoostYes. It lists a few dozen templates. It does not use all of the available Bitcoin script. It uses a subset of it.
Aaron van WirdumRight. So let's say Bitcoin script has 100 tools. I have no idea if it's close to 100. I'm just throwing out a number. The Miniscript. It says, okay, let's throw out 80 of these because these are just going to cause a mess. And let's keep 20. And that way it's going to be a little bit simpler for everyone. Right. Is that right?
Sjors ProvoostWell, so if Bitcoin script uses an alphabet, essentially, and Miniscript has a set of words. So it's not a subset of the alphabet, but it's a subset of words.
Aaron van WirdumI see. Okay. That's a better analogy.
Sjors ProvoostSo there's certain patterns of opcodes that you're allowed to use. And if you use those patterns in the way they describe.
Aaron van WirdumSo this double comma is removed now.
Sjors ProvoostYeah, there's no double comma. Or there is, but it is used in a very precise way. So basically Miniscript, yeah, it removes some of the foot guns, but it also allows you to do very cool stuff safely. In particular, it lets you do things like and. So you can say condition A must be true and condition B must be true. And you can do things like or. And whatever is inside the or or inside the and can be arbitrarily complex. So with Bitcoin script, you have if and else type
Sjors Provoostof statements. But if you're not careful, those if and else statements will not do what you think they're going to do. Because there's
Aaron van Wirdummore complexity hidden after the if.
Sjors ProvoostYes, exactly. And the mini script, basically, the templates make sure that you're only doing things that are actually doing what you think they're doing. So they really contain it. And that allows you to do nice things. So let's say you're... You're a company and you offer a semi-custodial wallet solution where you have one of the keys of the user. And the user has the other, has two keys, for example. So you don't have a majority of the keys. And maybe there's a five-year timeout where you do have control in case the user dies. Something like that, right?
Aaron van WirdumYeah, like a multisig kind of setup.
Sjors ProvoostAnd so normally when you set up a multisig, the way you kind of set it up is everybody gives their key, their master key, their XPUB, for example, and you create a very simple script that has three keys and three people sign. But the problem is because you're a big business that offers a service, you have some really complicated internal accounting department, and you maybe want to have five different signatures by specific people in God knows what complexity. But you don't want to...
Aaron van WirdumYeah, you have like five members on the board and you want three of them to sign. Yeah. Unless maybe the CEO gets some sort of special right from... two of the board members, and there's
Sjors Provoosta code hidden in an envelope inside the nuclear suitcase that has an override. Exactly.
Aaron van WirdumExactly. There's like all sorts of complex stuff you can do with it. And that should... all the complex stuff should count as one key. Like, you... right, that's where you're getting at. Like, you don't really care how the complex stuff is solved.
Sjors ProvoostYeah.
Aaron van WirdumThat's up to the company. You figure it out company.
Sjors ProvoostYeah.
Aaron van WirdumAs long as it's just... it's clear to us that it's only one key, however you do it.
Sjors ProvoostExactly. Now, the problem with that is if I gave you... You can do that with script or with taproot, but how do I, as a customer, know... Like I would have to hire my own electronic lawyer to check that script of yours that it doesn't have any of these double comma little gimmicks in it. And if only there was a way you could check that. And Miniscript is done such that you can check that as long as the script that you're getting is compatible with Miniscript. Because Miniscript to normal script is two ways. So you can take any Miniscript,
Sjors Provoostturn it into a normal script. You can take any normal script. and turn it into a mini script. Well, unless it doesn't match, right? If there's codes in it that don't apply, then it just doesn't compile or doesn't translate.
Aaron van WirdumSure.
Sjors ProvoostSo, and if you can turn something into a mini script, then you can analyze it using all sorts of tools. that can analyze any miniscript.
Aaron van WirdumRight.
Sjors ProvoostSo what you would have is every wallet out there could have a Miniscript interpreter and the interpreter could show you a little pie chart and saying, you are this one piece of the pie and there's this other piece of the pie that is really complicated, but you don't have to worry about it. It's not going to do anything sneaky.
Aaron van WirdumRight. That's good.
Sjors ProvoostThat's excellent.
Aaron van WirdumYeah. One of the things that I... So, I mean, we're making a podcast, so we can't actually show this, unfortunately. But Poelstra, for example, he's drawn this out. You can actually draw out what a contract would look like. Apparently, that's not really possible with a script. All of this was news to me.
Sjors ProvoostYou can. It's just horrible, manual, tedious... Yeah. I mean, imagine the people from Liquid, for example, that have a 13 of five multi-sig with all sorts of fallbacks.
Aaron van WirdumYeah. Okay. So that's probably drawn out at some point. Yeah. But with miniscript, it's actually fairly simple to draw it out. Yeah. And you can show this to a CEO who has no idea about scripts or miniscripts. You can just look at the picture and figure, hey, I, yep, that's sort of what I want the blue and red squares to be. And if these keys work out like this, then it seems like a good idea to me.
Sjors ProvoostExactly.
Aaron van WirdumSo that's actually possible now.
Sjors ProvoostYeah, with Miniscript. But wait, there's more.
Aaron van WirdumThere's more.
Sjors ProvoostAnd that's called the policy language.
Aaron van WirdumNo, I want to ask you something else first.
Sjors ProvoostOkay.
Aaron van WirdumWith Miniscript, I do think there are, strictly technically speaking, there are some limitations. Like there is stuff you can't do with Miniscript, right?
Sjors ProvoostYes.
Aaron van WirdumBut as far as I understand, these are stuff no one actually does anyways.
Sjors ProvoostWell, that's not necessarily true. So the thing is, but we have to go to policy language before I can explain that.
Aaron van WirdumOh, we do?
Sjors ProvoostYes.
Aaron van WirdumDid you have this in mind already?
Sjors ProvoostSo, yeah. So let me just quickly explain.
Aaron van WirdumYou've got this episode planned out way better than I do.
Sjors ProvoostWell, to understand why you might want to do really complicated stuff, I need to explain what the policy language is.
Aaron van WirdumYes. Okay, go for it.
Sjors ProvoostSo a policy language. poorly named, or maybe not poorly named, is a way to express your intentions. So for example, say I want two signatures. And this can be translated or compiled, I think is the better term, to Miniscript. And the nice thing is...
Aaron van WirdumOkay, so to be clear, the policy language is the stuff, like if someone like you, Sjors, you're building a wallet, I don't know, you're doing something on your computer, improving Bitcoin, then you're typing and the stuff that comes out of your fingers is policy language. And then you actually compile that to script later on.
Sjors ProvoostYeah. I mean, you could just write the script directly or you could write the mini script directly. But the nice thing about writing the policy language is that you can have a compiler that can be very smart. So a simple policy language might be just give me two of two signatures and the policy language will probably convert that to op multisig. Or we'll convert that to multisig in Miniscript. And multisig in Miniscript is just op multisig. So that's super trivial.
Aaron van WirdumYeah. Okay. So whoever wrote the policy language, and now Peter Wuille, for example, wrote the policy language for this. It was him. It was his brain, basically. He figured out all the best ways to compile this policy language into Miniscript, right? Like he must have somehow figured it out.
Sjors ProvoostYeah, he wrote a compiler.
Aaron van WirdumSee, I don't know anything about this stuff.
Sjors ProvoostThat's okay. So basically, you write a policy language. It's like a higher-level programming language. So if you have a higher-level programming language, like, I don't know, BASIC, you can say go to five. I don't know if you've ever worked with BASIC.
Aaron van WirdumSjors, I can't code Hello World. Isn't that clear to you right now?
Sjors ProvoostWell, I mean, Hello World.
Aaron van WirdumI've coded Hello World once, but that's pretty much how limited I am.
Sjors ProvoostOkay, but what language did you code Hello World in?
Aaron van WirdumI don't remember.
Sjors ProvoostThat's amazing. Anyway, so what happens is usually when you see a programmer looking at a screen, you see something that looks like English, like with words like for and next and yadda yadda. But eventually the machine is just reading bits and bytes.
Aaron van WirdumSure. No, I understand that part.
Sjors ProvoostSo the bits and bytes are very close to what Bitcoin opcodes look like. They're very low level. They're very instructions like put this on the stack, take that away from the stack. And the mini script is essentially the same. It's just only a subset of it. But it's slightly more readable, but it's still extremely low level. The policy language is slightly higher level. So what you do is you start at the higher level, which is easier for a programmer to write. And then a computer looks at that high level language and says, how can I write this into low level machine
Sjors Provoostreadable stuff as efficiently as possible?
Aaron van WirdumSure.
Sjors ProvoostIn the case of the multisig thing, I might say, I just want two out of two signatures. I don't care how you do that. Then the compiler knows that there are multiple ways to do that.
Aaron van WirdumOkay, but how does the compiler know this? I hope there's listeners out there that know as little about this as I do, so they might learn something. How does the compiler know this?
Sjors ProvoostSo disclaimer, I don't think I've ever written a compiler. I'm not that cool. But generally, compilers know because somebody wrote the compiler.
Aaron van WirdumBut that was my point. It must have come from Peter Wuille's brain in this case.
Sjors ProvoostOf course, yes. Everything comes out of Peter Wuille's brain.
Aaron van WirdumThere we go.
Sjors ProvoostBut basically, the compiler knows, okay, there's maybe two or three ways to do this, to execute this intention. And then the question is, which of the three am I going to pick? Well, then it depends on the transaction weight and the fees that you might be involved. But also you can tell it, okay, I think most of the time it's condition A, but only 10% of the time it's condition B. And then the compiler can try. condition A nine times and condition B one time, and then figure out what the expected fee is. So it can optimize for typical use cases,
Sjors Provoostworst case scenarios, all these things. And it can then spit out a Bitcoin script or a mini script that then becomes a Bitcoin script.
Aaron van WirdumYes, the compiler figures out the best way to do something.
Sjors ProvoostAnd in very practical terms, another thing it could do, I don't know if it can already do that, is you have SegWit scripts now, but we'll hopefully have Taproot, which can put things in a Merkle tree. So your compiler could figure out where to put stuff in the Merkle tree. You don't have to worry about how to build the Merkle tree.
Aaron van WirdumRight, yes.
Sjors ProvoostSo it can do all sorts of things. So you start at the policy language, and then you write Miniscript, and that goes into...
Aaron van WirdumOkay, so that's what a compiler is. The policy language you use, you put it into the compiler, and then Miniscript comes out of it, which is, in a way, script.
Sjors ProvoostYes, I think the technical term for going from Miniscript to script is transpiling, which basically is like a one-on-one thing. You can do it in two directions. So you can go from Miniscript to script, from script to miniscript, but you cannot go back to a policy language. Well, you can guess the policy language.
Aaron van WirdumOkay, you can. Yeah, I guess so, yes. I understand that. And then getting back to... Are we ready to get back to my question about the limitations?
Sjors ProvoostAbsolutely.
Aaron van WirdumOkay, so now there are some limitations. when you're using, I guess, this policy language or miniscripts in general?
Sjors ProvoostYes.
Aaron van WirdumBut these are limitations that no one actually suffers from, is how I understood it.
Sjors ProvoostNot necessarily. I mean, ideally, yes. But in practice, some scripts or some policies might be very complicated. And there would be infinite ways to execute these in Bitcoin script. And because of all these weird double comma foot guns that are in Bitcoin script, sometimes that's an advantage. Sometimes you can write something really efficiently in Bitcoin script. that is just really horrible if you objectively look at it, but it is really fast or really fee efficient. And in fact, I believe Lightning uses that, the way they sometimes deal with time locks or with hashes. Or nonces. There
Sjors Provoostare some tricks in Lightning, I believe, that you cannot do a miniscript, or at least you could not do a miniscript. Maybe you can now.
Aaron van WirdumOkay.
Sjors ProvoostSo there are some optimizations where, like what Poelstra said, like, oh, you do some weird switching of the stack and you interpret things not the way they were, you know, you put a public key on it, but you interpret it as a number. Those kind of weird tricks. Those might be very hard to reason about, but a human might be able to do it. But the Miniscript compiler would not do it, which means you end up with longer. potentially longer Lightning scripts if you do not have all the whistles and bells in it. So it's possible that Miniscript would be expanded if there is some
Sjors Provoostother optimal way to do it. But you have to be careful because you really want to make sure there's nothing in Miniscript that brings back those scary properties of the underlying language.
Aaron van WirdumWell, to be clear, in case this isn't clear to anyone, miniscripts is an addition to what there is already. Like, script is going nowhere. Bitcoin still uses script, and that's the way it's going to be. It's just this is an extra tool for people who want to use that.
Sjors ProvoostAnd in fact, it's not a consensus change at all.
Aaron van WirdumNo, it's nothing in that.
Sjors ProvoostIt's a tool that you can use or not use. Like, don't worry. It's not Blockstream dominating the script here.
Aaron van WirdumYes. Okay, so we mentioned Peter Wuille has this policy language. I know this is very fresh and you probably haven't looked at it very much, but Nadav Ivgi also wrote a policy language. You haven't studied that yet.
Sjors ProvoostI have not yet.
Aaron van WirdumSo I thought that would be a cliffhanger.
Sjors ProvoostThat would be a cliffhanger.
Aaron van WirdumYou like the cliffhanger. So that will be a cliffhanger for another episode.
Sjors ProvoostOr never.
Aaron van WirdumOr maybe we'll have one of those Lost...
Sjors ProvoostBut I can tell you from what I know about the policy language is that... And you're still some steps away from having a practical tool where you and I can set up a very complicated multisig wallet. There's all sorts of questions you want to answer, like how exactly do you do this setup? What are you emailing to each other? Are you emailing your keys or are you emailing something a little bit more abstract that you agree on first and then you exchange keys? Those very practical things are not solved inside a miniscript.
Aaron van WirdumLet me at least mention... It's called Minsc. So his policy language is called Minsc.
Sjors ProvoostOkay.
Aaron van WirdumOkay. I'm afraid we can't give you any more info about Minsc yet.
Sjors ProvoostWell, I know Minsk with a K is a city, but I think it's with a C.
Aaron van WirdumMinsc with a C. Yeah, that's some extra info. All right. Is this the end of our episode? Did we cover everything we needed to cover from Miniscript?
Sjors ProvoostI hope so.
Aaron van WirdumIt was maybe slightly messy, so let's sum it up. Miniscript is a subsection. No, you called it a template?
Sjors ProvoostYes, it's a template of script pieces.
Aaron van WirdumEven the summary is getting messy now.
Sjors ProvoostSo basically, Bitcoin script is like an alphabet, essentially, just different letters that have different meanings. And you could see Miniscript is a set of words. Not really words, because you can put things between the words. maybe words and brackets and commas. That's what Miniscript is. And then the policy language is the thing that can be converted to Miniscript. It's a bit more high level.
Aaron van WirdumAnd there are several of those apparently by now.
Sjors ProvoostYes, exactly. Because Miniscript, it has to be set in stone, I guess, sort of, because you want to do all the safety checks on it. But then just like you can have different programming language, you can have different policy languages.
Aaron van WirdumYes. So if you're into Bitcoin programming, This is what you want to study. This is what you want to look at.
Sjors ProvoostIf you're into Bitcoin programming, the rabbit hole is massive and pick something. There's a talk by Andrew Poelstra.
Aaron van WirdumThis one is probably pretty good though, right?
Sjors ProvoostYeah. So there's a talk by Andrew Poelstra from Advancing Bitcoin, not the conference, but the meetup before it, the BitDevs London, where he talks for two hours about all the problems with regular script and why he hates things. And that's just... He said he was going to do it in 20 minutes, and I think he still didn't cover everything. I don't think that's the best place to start.
Aaron van WirdumHe's still on stage.
Sjors ProvoostHe's still on stage out there, just going through it.
Aaron van WirdumAll right, this was our episode of Miniscript, I think.
Sjors ProvoostYep, so thank you. Should I say thank you?
Aaron van WirdumI forgot how we closed our episode.
Sjors ProvoostI think I say thank you for listening to the Van Wirdum Sjorsnado.
Aaron and Sjors discuss Bitcoin Core 32.1 and its updated security disclosure policy in this live conference recording, followed by audience questions. Links Bitcoin Core 32.1 release announcement and release notes...
Aaron and Sjors discuss the COLDCARD hack: the bug itself, how it could have happened, and some reflections on having had Coinkite as a sponsor. Note: If you’re using a COLDCARD and still haven’t moved your funds to a...
The COLDCARD hardware wallet has a critical vulnerability. If you are using the COLDCARD to store bitcoin, move them to a secure location as soon as you can. More information:...
Aaron and Sjors discuss what’s new in Bitcoin Core 31. Chapters 00:00:00 Episode 100 and Core 31 00:02:41 Cluster Mempool 00:10:45 Package Relay and Fee Selection 00:18:59 Private Broadcast over Tor 00:24:03 ASMAP and...