Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should a: forward z? Better yet, we could accept a Bz where a W is currently required #108

Open
darosior opened this issue Mar 22, 2022 · 1 comment

Comments

@darosior
Copy link
Contributor

Could be something we want to do eventually.

12:09 < darosior> Why doesn't the 'a:' wrapper "forward" the 'z' property? Sure TOALTSTACK <X> FROMALTSTACK does technically consume the top stack element, but it puts it back and as long as X is 'z' it should appear to the following OPs as if it didn't consume anything.
12:11 < darosior> I was thinking about this in the context of https://github.com/sipa/miniscript/pull/105#issuecomment-1074459067, but unfortunately it would only enable '0' to be 'Wzdu' which is not very interesting. Still, i wonder if the 'a:' wrapper should for some reason never be 'z'?
12:11 <@sipa> There are other properties missing around W and z. Every Bz could be automatically treated as a W directly too.
12:11 <@sipa> But I think those aren't all that useful in practice.
12:16 < darosior> I'll open an issue regarding 'z' and 'W' <-> 'Bz', if you don't mind. Probably not worth addressing now but there could be use case we missed
12:17 <@sipa> Counting Bz as W or Wz would be even better than passing through z through a.
12:17 < darosior> Oh, right
12:17 <@sipa> It might need a "wrapper" that involves no opcode, like and_v, to convert Bz to Wz
12:18 <@sipa> Alternatively, we could just permit and_b or_b and thresh to accept Bz args
12:18 <@sipa> In addition to W args.

Link to the discussion logs

@darosior
Copy link
Contributor Author

darosior commented Apr 7, 2022

Also, re-constructing Pieter's list from #105 showed the need for Wo sometimes. I don't see anything wrong with forwarding it as well. (EDIT) Actually, does it change the current assumption if the consumed stack element isn't the top stack element?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant