--- Log opened Mon Feb 19 00:00:07 2024 00:25 <@sipa> the first one is policy, the second one is miniscript 00:26 <@sipa> perhaps it was a mistake to make their syntax so similar 00:59 < jungly> It is a bit confusing alright, but people will learn. Also the nomenclature. I just learnt you can one policy, the other miniscript. 01:00 < jungly> The one thing that is surprising as an end user of rust miniscript was that I expected the policy wrapped inside a descriptor to compile into Script. Seems something that can be done - am saying that without digging into the code too much. 01:01 <@sipa> well you need to compile the policy to miniscript; miniscript is a way to put complex scripts into descriptions 01:01 <@sipa> policy isn't because it's ambiguous 01:01 <@sipa> there are potentially many miniscripts that represent the same policy 01:07 < jungly> Interesting. Can a given policy compile into different miniscripts even if we specify all the priorities/probabilities? 01:08 <@sipa> yes 01:08 <@sipa> there are just many ways to accomplish the same thing in script 01:08 <@sipa> and miniscript is a 1-to-1 mapping with (a subset of) script 01:10 < jungly> True. I was incorrectly assuming that the compiler from policy to miniscript would be deterministic. But I guess, someone else can write a different compiler that makes different choices. 01:10 <@sipa> yeah, or even better, someone could construct a better compiler 01:10 < jungly> :D True! :D 01:10 <@sipa> that finds shorter/cheaper scripts that do the same thing 01:10 <@sipa> the c++ and rust policy compilers don't always find the same result, i believe 01:12 < jungly> I would like a compiler that churns out "easier to understand" Script, so that humans can toy with building contracts. Later they can turn on a flag to say "generate optimal" Script. Like the -O flags. 01:13 <@sipa> that doesn't sound too hard 01:13 <@sipa> just disable some of the more complex strategies in the compiler 01:14 < jungly> Ah, you already have simple strategies built into the compiler? Nice! 01:14 <@sipa> well there are more straightforward ones, and less straightforward ones 01:14 <@sipa> the current compiler just tries several, and picks the cheapest result 01:14 <@sipa> which sometimes is the simpler one 01:14 < jungly> You speak for the C++ compiler or both C++ and Rust one? 01:15 < jungly> Interesting. Didn't realise you were generating multiple Scripts and then choosing. 01:15 <@sipa> the c++ one, but the rust one is based on a very similar design, i'm just not familiar with the code 01:15 <@sipa> it's a dynamic programming algorithm 01:15 < jungly> Gotcha 01:16 <@sipa> for every subexpression multiple compilations are constructed, and ones that are strictly worse than others are discarded, before continuing with building bigger subexpressions that contain them 01:17 < jungly> Got it. Since you are here. Is the BCNF grammar for Policy and/or Miniscript somewhere? 01:18 <@sipa> i don't think we ever wrote it out in BCNF 01:18 <@sipa> but the language is written down somewhere 01:19 <@sipa> the miniscript type system makes it hard to write a grammar for just *valid* miniscript though 01:20 <@sipa> the fuzz test in bitcoin core for miniscript arguably computes a grammar for miniscript, so it can construct just valid scripts 01:21 < jungly> Oh didn't know about miniscript in core's fuzz tests. Thanks for pointing that out. 01:29 <@sipa> it's constructed on the fly at runtime using the miniscript type system information, so don't expect something readable inside the source code 01:29 <@sipa> https://github.com/bitcoin/bitcoin/blob/master/src/test/fuzz/miniscript.cpp, see SmartInfo 01:51 < jungly> Thanks, looks pretty involved. I'll try to grok it over time. 01:54 <@sipa> but if you want an informal grammar, both for policy and miniscript, it's all on https://bitcoin.sipa.be/miniscript/ 04:13 < jungly> Thanks again for all the help 04:38 -!- salvatoshi [~salvatosh@213.215.6.86] has joined ##miniscript 04:45 -!- jonatack [~jonatack@user/jonatack] has joined ##miniscript 04:48 -!- jon_atack [~jonatack@user/jonatack] has quit [Ping timeout: 272 seconds] 05:45 -!- stickies-v [sid544753@id-544753.uxbridge.irccloud.com] has quit [Ping timeout: 246 seconds] 05:45 -!- salvatoshi [~salvatosh@213.215.6.86] has quit [Remote host closed the connection] 05:45 -!- salvatoshi [~salvatosh@genymobile-2-6-86.fib.nerim.net] has joined ##miniscript 05:47 -!- FelixWeis__ [sid154231@id-154231.hampstead.irccloud.com] has quit [Ping timeout: 260 seconds] 05:48 -!- stickies-v [sid544753@id-544753.uxbridge.irccloud.com] has joined ##miniscript 05:54 -!- stickies-v [sid544753@id-544753.uxbridge.irccloud.com] has quit [Ping timeout: 268 seconds] 05:54 -!- FelixWeis__ [sid154231@hampstead.irccloud.com] has joined ##miniscript 05:58 -!- stickies-v [sid544753@uxbridge.irccloud.com] has joined ##miniscript 06:02 -!- FelixWeis__ [sid154231@hampstead.irccloud.com] has quit [Ping timeout: 256 seconds] 06:02 -!- w0xlt [sid555702@id-555702.ilkley.irccloud.com] has quit [Ping timeout: 260 seconds] 06:04 -!- FelixWeis__ [sid154231@id-154231.hampstead.irccloud.com] has joined ##miniscript 06:15 -!- FelixWeis__ [sid154231@id-154231.hampstead.irccloud.com] has quit [Ping timeout: 256 seconds] 06:24 -!- w0xlt [sid555702@id-555702.ilkley.irccloud.com] has joined ##miniscript 06:28 -!- FelixWeis__ [sid154231@id-154231.hampstead.irccloud.com] has joined ##miniscript 07:50 -!- FelixWeis__ [sid154231@id-154231.hampstead.irccloud.com] has quit [Ping timeout: 256 seconds] 07:53 -!- FelixWeis__ [sid154231@id-154231.hampstead.irccloud.com] has joined ##miniscript 08:45 -!- darosior1 [~darosior@109.205.214.46] has joined ##miniscript 08:46 -!- darosior [~darosior@109.205.214.46] has quit [Read error: Connection reset by peer] 08:47 -!- darosior1 is now known as darosior 09:10 -!- jonatack [~jonatack@user/jonatack] has quit [Ping timeout: 255 seconds] 09:13 -!- salvatoshi [~salvatosh@genymobile-2-6-86.fib.nerim.net] has quit [Ping timeout: 264 seconds] 09:18 -!- jonatack [~jonatack@user/jonatack] has joined ##miniscript 09:22 -!- jonatack [~jonatack@user/jonatack] has quit [Ping timeout: 268 seconds] 09:53 -!- salvatoshi [~salvatosh@lfbn-idf3-1-1331-187.w92-170.abo.wanadoo.fr] has joined ##miniscript 10:21 -!- salvatoshi [~salvatosh@lfbn-idf3-1-1331-187.w92-170.abo.wanadoo.fr] has quit [Ping timeout: 256 seconds] 12:08 -!- jonatack [~jonatack@user/jonatack] has joined ##miniscript 12:54 -!- jonatack [~jonatack@user/jonatack] has quit [Ping timeout: 256 seconds] 14:46 -!- jonatack [~jonatack@user/jonatack] has joined ##miniscript 14:54 -!- salvatoshi [~salvatosh@lfbn-idf3-1-1331-187.w92-170.abo.wanadoo.fr] has joined ##miniscript 15:46 -!- salvatoshi [~salvatosh@lfbn-idf3-1-1331-187.w92-170.abo.wanadoo.fr] has quit [Ping timeout: 246 seconds] 22:04 -!- jon_atack [~jonatack@user/jonatack] has joined ##miniscript 22:05 -!- jonatack [~jonatack@user/jonatack] has quit [Ping timeout: 264 seconds] 22:39 -!- jonatack [~jonatack@user/jonatack] has joined ##miniscript 22:42 -!- jon_atack [~jonatack@user/jonatack] has quit [Ping timeout: 246 seconds] --- Log closed Tue Feb 20 00:00:05 2024