Skip to content

New topics: OP_CHECKSIGFROMSTACK#404

Merged
jnewbery merged 1 commit into
bitcoinops:masterfrom
harding:2020-05-new-topics-2
Jun 1, 2020
Merged

New topics: OP_CHECKSIGFROMSTACK#404
jnewbery merged 1 commit into
bitcoinops:masterfrom
harding:2020-05-new-topics-2

Conversation

@harding
Copy link
Copy Markdown
Collaborator

@harding harding commented May 19, 2020

This brings us to 8/16 topics that I should've submitted by now.

The CSFS, CTV, and Vaults topics all derive somewhat from the existing Covenants topic, but I think it was time for them to each have separate topics. I've left the Covenants topic for now without any deletions to its existing links, but going forward I plan mainly to only use it for topics that are much more specific to covenants.

Comment thread _topics/en/vaults.md Outdated
@@ -0,0 +1,83 @@
---
title: Vaults
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

By the way there was a discussion today about this,
https://diyhpl.us/wiki/transcripts/london-bitcoin-devs/2020-05-19-socratic-seminar-vaults/

There's also Jeremy's vault implementation which is in his bip119 branch.

There's also Fidelity's version- https://github.com/fmr-llc/Vault-mbed

and this thing https://github.com/JSwambo/bitcoin-vault

Copy link
Copy Markdown
Collaborator

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Looks very good so far!

Comment thread _topics/en/op_checksigfromstack.md Outdated
Copy link
Copy Markdown
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

I've only reviewed the 'large channels' topic. Just a couple of comments on that one.

Comment thread _topics/en/large-channels.md Outdated
Comment thread _topics/en/large-channels.md
@harding harding force-pushed the 2020-05-new-topics-2 branch from 9dd7486 to 250d90f Compare May 29, 2020 12:13
Copy link
Copy Markdown
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

Just a quick scan of the OP_CHECKSIGFROMSTACK page. Most of the text is good, but I think it could be reformatted/rearranged to make the point a bit clearer.

Comment thread _topics/en/op_checksigfromstack.md Outdated
certain pubkey but that the private key used to generate both of those
objects was used to authorize the spend.

If the same pubkey and signature pair are valid both with `OP_CSFS`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found this description quite confusing on first read. It wasn't initially clear to me that this paragraph and the rest of the summary were about a scheme to use OP_CSFS to do transaction introspection.

Is it possible to use subheadings in the summary? If so, perhaps this would be clearer as follows:

<generic description of OP_CSFS and existing OP_CHECKSIG opcodes>

#### Using OP_CSFS for transaction introspection

One of the most interesting applications of OP_CSFS is to be able to _introspect_ arbitrary parts of the transaction.

<describe what introspection means, using CLTV as an example>

<describe how OP_CSFS can be used for transaction introspection>

<some examples of what tx introspection could allow>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

  1. Subheadings can be used in a summary, we already use one on the codesep topic: https://bitcoinops.org/en/topics/op_codeseparator/#later-changes-and-proposals

  2. I don't mind adding the subhead you suggest, but I think it suggests that there are multiple uses for CSFS---yet I'm unaware of any that can't be done more efficiently some other way (e.g. paying for signatures to arbitrary messages can be done using adapter signatures).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Er, for point n2, I meant to ask: are there any other uses you're aware of? If not, I think I'll just try rewriting to see if I can make the text more congruous.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm unaware of any that can't be done more efficiently some other way (e.g. paying for signatures to arbitrary messages can be done using adapter signatures).

Perhaps that's worth stating explicitly in the summary? I (not having looked into OP_CSFS) assumed that there would be other use cases for checking signatures over arbitrary messages in script.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I asked about other uses in #sidechains-dev and Russell O'Connor replied, "Prior to introspection, I always assumed that CHECKSIGFROMSTACK was for oracle, as in a trusted third party that signs the outcome of various events in order to facilitate prediction / futures markets."

Although I think DLCs would be more private and efficient for that, there's an admirable simplicity to a contract that's <hash('The agreement...')> <oracle_pubkey> OP_CSFS (and DLCs weren't proposed when CSFS was first made available on Elements).

Anyway, I'll rewrite the topic and try to make the article clearer.

Comment thread _topics/en/op_checksigfromstack.md Outdated
@harding harding force-pushed the 2020-05-new-topics-2 branch from 250d90f to 9807e4a Compare June 1, 2020 13:12
@harding harding changed the title New topics: large channels, OP_CHECKSIGFROMSTACK, OP_CHECKTEMPLATEVERIFY, vaults New topics: OP_CHECKSIGFROMSTACK Jun 1, 2020
@harding
Copy link
Copy Markdown
Collaborator Author

harding commented Jun 1, 2020

I've narrowed this PR to just the OP_CHECKSIGFROMSTACK topic and updated it to describe all usecases for that opcode that I've been able to find. It should be ready for review again. Thanks for the previous feedback!

@harding harding force-pushed the 2020-05-new-topics-2 branch from 9807e4a to 34ad183 Compare June 1, 2020 15:20
Copy link
Copy Markdown
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

This is great. I think it's much clearer than the first version and is probably the best summary of OP_CFSF I've seen anywhere. Great stuff, @harding !

A few small nits inline. Feel free to take or ignore.

Comment thread _topics/en/op_checksigfromstack.md Outdated
This allows them to verify that the signature matches a certain public
key and that the the private key used to generate both of those objects
was used to authorize the spend. That mechanism is powerful enough to
secure Bitcoin UTXOs, but it disallows using digital signatures to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps 'precludes' instead of disallows?

Comment thread _topics/en/op_checksigfromstack.md
it may not be possible to disable their use (even if they become
unpopular) without risking someone losing money.

### Relationship to OP_CAT
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this may look better as h4, for more obvious contrast with the h2 "Primary code and documentation" element below.

Copy link
Copy Markdown
Collaborator Author

@harding harding Jun 1, 2020

Choose a reason for hiding this comment

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

I made the h3 styling bolder to hopefully distinguish it from h4h2, that way we don't have to implement your craaaaaazy idea of skipping a level. Let me know if this is acceptable.

  • Old:
    2020-06-01-14_37_42_923289125

  • New:
    2020-06-01-14_37_19_090513960

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's revert this. My suggestion to use h4 was to make it more obvious that it was a subsection of the summary, and not a sibling of the "Primary code..." and "Optech newsletter..." headings. To my eye, the boldening might make it look like it's a parent of those elements.

(I have ~zero talent for design, so feel free to tell me I'm talking nonsense).

This also has the undesirable side-effect of making all h3s on the site bold, including the newsletter links on our home page and newsletter index.

@harding harding force-pushed the 2020-05-new-topics-2 branch from 34ad183 to a76b1b4 Compare June 1, 2020 18:43
@jnewbery
Copy link
Copy Markdown
Contributor

jnewbery commented Jun 1, 2020

I think this is ready for merge once the h3 style change is reverted.

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

Successfully merging this pull request may close these issues.

4 participants