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

Newsletters: add 61 (2019-08-28) #217

Merged
merged 2 commits into from Aug 28, 2019

Conversation

@harding
Copy link
Contributor

@harding harding commented Aug 26, 2019

Sorry it's late.

Copy link
Contributor

@bitschmidty bitschmidty left a comment

Pushed a commit for Stack Exchange section this week.

Looks good @harding ! Get well.

support hasn't been added by then. -->

- **Miniscript request for comments:** the developers of this language
for creating Bitcoin script templates have requested community
Copy link
Contributor

@bitschmidty bitschmidty Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont have strong preference but this could be an Action item vs News.

Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no strong preference either. We could split this into two:

Action items

  • Review the [miniscript proposal](link to miniscript news item) and reply on the mailing list if you have feedback. This is important because the proposal authors plan to begin work on getting parts of it added to various wallets and other software, after which changing the language will become more difficult. See the news section for more details of the proposal.

News

  • Miniscript proposal: Miniscript is a policy language...

Copy link
Collaborator

@jonatack jonatack Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing the miniscript feedback request in the Action items might be more fruitful.

Copy link
Contributor

@jnewbery jnewbery left a comment

A few nits. I also think we need to clarify language around 'policy language'/'minscript' in the miniscript section.

support hasn't been added by then. -->

- **Miniscript request for comments:** the developers of this language
for creating Bitcoin script templates have requested community
Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no strong preference either. We could split this into two:

Action items

  • Review the [miniscript proposal](link to miniscript news item) and reply on the mailing list if you have feedback. This is important because the proposal authors plan to begin work on getting parts of it added to various wallets and other software, after which changing the language will become more difficult. See the news section for more details of the proposal.

News

  • Miniscript proposal: Miniscript is a policy language...

software, after which changing the language will become more
difficult.

Miniscript is a policy language that makes it much easier for
Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

software, after which changing the language will become more
difficult.

Miniscript is a policy language that makes it much easier for
Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miniscript is a policy language

Not quite. Policy is a description of the spending conditions of the UTXO. Miniscript is a "language for writing (a subset of) Bitcoin Scripts in a structured way". Policy is compiled into minscript, which can then be translated into Script. (eg see the "Policy to Miniscript compiler" section here: http://bitcoin.sipa.be/miniscript/.)

Copy link

@sipa sipa Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's confusing, but indeed. Miniscript is a 1-to-1 translation of a subset of script, and has 3 ways of writing an and, 4 ways of writing an or, 2 ways of writing a pubkey check, has various wrappers to make arguments match the calling convention of the parents, ... The policy language is much simpler and only encodes semantics and probability. Policy can be compiled to miniscript, but this is a 1-way operation.

miniscript. For example, imagine Alice has a 2-of-3 policy that
involves a hot wallet, a hardware wallet, and a fallback cold wallet:

thresh(2, pk(A_hot), pk(A_hard), pk(A_cold))
Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe all your examples here are policy rather than miniscript.


The miniscript compiler converts the miniscript into an efficient
P2WSH script and checks that it doesn't violate any of Bitcoin's
consensus rules or Bitcoin Core's standard transaction rules. If
Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to "Bitcoin's consensus rules or Bitcoin Core's transaction relay policy" (I don't think 'standard transaction rules' is widely understood)

integrated into wallets, it'll become easier for users to secure their
bitcoins using sophisticated and multi-wallet security policies.
Review and feedback is requested to catch any potential problems now
while they're probably still easy to correct.
Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove 'probably'

By our efforts and by the efforts of many other Bitcoiners, we think
we're on the brink of success: 82% <!-- 19/23 --> of the 23 popular
wallets and services we've [evaluated][bech32 compat] are ready to pay
bech32 addresses (up 8% from last week) and 17% <!-- 4/23 --> already
Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove 'up 8% from last week'. The percentage numbers are somewhat unscientific because they weight all tested applications equally (instead of by usage), and we only selected a subset of applications to test. I understand wanting to use numbers, and am ok with the headline 82% / 17% numbers, but I'd like to drop the '8% change'.

Copy link
Contributor Author

@harding harding Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included the percentage here because we included the percentage from last week in last week's section, so readers of the single-page version https://bitcoinops.org/en/bech32-sending-support/ are going to see inconsistent statistics. The change percentage is an attempt to mitigate that discontinuity.

Copy link
Contributor

@jnewbery jnewbery Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer wording like '(up since last week as we've become aware of two more wallets' support for sending to bech32 addresses)' or similar

Copy link
Contributor Author

@harding harding Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't read well to me, so I'm just going to drop the percentages and say "k of n wallets". That way only someone who calculates their own percentages would notice the incongruity between last week's section and this week's section.

_posts/en/newsletters/2019-08-28-newsletter.md Outdated Show resolved Hide resolved
developers to design and analyze scripts enforcing a particular
security scheme. More than that, though, policies from several
miniscripts can easily be composed together into a more complex
miniscript. For example, imagine Alice has a 2-of-3 policy that
Copy link

@sipa sipa Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miniscript is composable, but not in the way that it's presented here (you can't arbitrarily substitute any script subexpression with another; the types need to match up). I think you mean the policies are composable.


and(thresh(2, pk(A_hot), pk(A_hard), pk(A_cold)), older(26000))

The miniscript compiler converts the miniscript into an efficient
Copy link

@sipa sipa Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, it's the policy compiler that converts the policy into miniscript (which maps to a specific script).

Copy link
Contributor Author

@harding harding Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Making edits for that now based on @jnewbery's earlier comment.

Copy link
Collaborator

@jonatack jonatack left a comment

One typo, one nit, and one suggestion for your perusal. Hope you feel better soon.

infer how they should sign and finalize a larger variety of scripts.

Miniscript as it exists today is already a powerful tool for helping
developers craft advanced security policies, and it now has a its own
Copy link
Collaborator

@jonatack jonatack Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/has a its/has its/

*[Bitcoin StackExchange][bitcoin.se] is one of the first places Optech
contributors look for answers to their questions---or when we have a
few spare moments of time to help curious or confused users. In
this monthly feature, we highlight some of the top voted questions and
Copy link
Collaborator

@jonatack jonatack Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/top voted/top-voted/

miners to cooperate with other miners by building on their blocks. PoW is also
used to regulate block times (and thus protect against denial of service)
since the difficulty adjustment makes it expensive to reliably produce blocks
more often than, on average, every 10 minutes.
Copy link
Collaborator

@jonatack jonatack Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: s/than, on average, every 10 minutes/than every 10 minutes, on average/.

support hasn't been added by then. -->

- **Miniscript request for comments:** the developers of this language
for creating Bitcoin script templates have requested community
Copy link
Collaborator

@jonatack jonatack Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing the miniscript feedback request in the Action items might be more fruitful.


## News

<!-- FIXME: JS miniscript compiler currently doesn't accept whitespace,
Copy link

@sipa sipa Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: spaces will be ignored in the compiler and analyzer input on the site.

Copy link
Contributor Author

@harding harding Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

P2WSH script and checks that it doesn't violate any of Bitcoin's
consensus rules or Bitcoin Core's standard transaction rules. If
script changes are added to the Bitcoin protocol, such as
[taproot][bip-taproot], the miniscript compiler can be changed in a
Copy link

@sipa sipa Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miniscript is currently specific to P2WSH (and P2SH-P2WSH). Once Taproot lands we can define a new (but similar) language Miniscript-Taproot or so that maps to Taproot scripts.

The policy language will likely remain unchanged entirely, and you'd have the option to compile to a P2WSH miniscript, or to a (tree of) Taproot miniscripts.

Transactions (PSBTs), allowing signers and combiners to automatically
infer how they should sign and finalize a larger variety of scripts.

Miniscript as it exists today is already a powerful tool for helping
Copy link

@sipa sipa Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This article seems to focus on the policy-to-miniscript compiler, which is an important part of what we've designed, but I don't think it's the most interesting part. Similar things have existed for a while (e.g. Ivy).

What Miniscript primarily adds is a way to reason programmatically about Script. The idea is that Script can be trivially converted to Miniscript (if it is compatible), and in that form it can be analyzed for:

  • Correctness
  • Whether non-malleable witnesses for it always exist
  • Under what conditions it can be spent
  • Whether it might exceed any limits (ops, stack size, ...)

In addition, in Miniscript form you can have a generic signer which produces a valid witness given enough signatures. That's actually how Miniscript came to be: a way to avoid needing ad-hoc template matching in rust-bitcoin's PSBT signer.

I personally think that's much more of a breakthrough, as it means designing a new script doesn't need to be accompanied with development of specific application logic (and sometimes protocols) to produce witnesses for it. In theory, applications could construct scripts on the fly based on necessities. E.g. one application needs a 2-of-3 somethings; one of the participants is another application that provides a timelocked 2FA based signing service, and they can just at runtime construct a script for the composition of the policies, and all Miniscript-compatible software without modification would be able to participate in signing spends of the resulting outputs.

@harding
Copy link
Contributor Author

@harding harding commented Aug 27, 2019

Pushed a commit ("news61: rewrite miniscript section") that significantly rewrites the miniscript section based on @sipa's comment here (plus all the other feedback). This really needs to be reviewed by one of the miniscript developers before we publish, as I made some extrapolations from Pieter's description that I haven't tried to verify yet.

Thank you everyone for the feedback and sorry I made such a mess of the earlier version. I'll be addressing the other feedback on this PR in a separate commit.

@bitschmidty
Copy link
Contributor

@bitschmidty bitschmidty commented Aug 28, 2019

tACK 66535ae

@bitschmidty
Copy link
Contributor

@bitschmidty bitschmidty commented Aug 28, 2019

Waiting a bit on potential review from miniscript devs per @harding 's comment before publishing

@sanket1729
Copy link

@sanket1729 sanket1729 commented Aug 28, 2019

Hi all, 66535ae is correct and addresses @sipa's comment.

Can I also request to advertise rust-miniscript here?
https://github.com/apoelstra/rust-miniscript/

EDIT:
I see that this is meant to be feedback for Miniscript proposal in general, so it might be okay not mentioning rust-miniscript library.

@jonatack
Copy link
Collaborator

@jonatack jonatack commented Aug 28, 2019

ACK 66535ae, read changes, verified new links. Edit/note: It's great what one can learn from participating in Optech review and this newletter was no exception.

@jnewbery
Copy link
Contributor

@jnewbery jnewbery commented Aug 28, 2019

ACK 66535ae

Special thanks to @sipa and @sanket1729 for reviewing the miniscript section this week.

Seems reasonable to add a link to rust-miniscript, but I'll leave the final decision to Dave.

@harding
Copy link
Contributor Author

@harding harding commented Aug 28, 2019

Thank you for the early morning reviews! I've pushed several additional miniscript links, including to the Rust implementation.

@jonatack
Copy link
Collaborator

@jonatack jonatack commented Aug 28, 2019

New links work for me, including the last relative url for the miniscript summary if appended to https://bitcoinops.org.

@harding harding force-pushed the 2019-08-28-newsletter branch from f248c22 to accf632 Aug 28, 2019
@jnewbery
Copy link
Contributor

@jnewbery jnewbery commented Aug 28, 2019

ACK accf632

@bitschmidty
Copy link
Contributor

@bitschmidty bitschmidty commented Aug 28, 2019

tACK accf632

@sipa
Copy link

@sipa sipa commented Aug 28, 2019

ACK miniscript section, thanks!

@bitschmidty bitschmidty merged commit 87d715f into bitcoinops:master Aug 28, 2019
2 checks passed
@bitschmidty
Copy link
Contributor

@bitschmidty bitschmidty commented Aug 28, 2019

newsletter draft needed correction
@sipa givin' ACK on the miniscript section

bitcoin wallets better support send
since the bech32 segments come to an end

@harding thanks for the heroics getting this one out!
@sipa and @sanket1729 thank you for the miniscript feedback
@jonatack and @jnewbery thanks for your reviews!

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

Successfully merging this pull request may close these issues.

None yet

6 participants