-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Add reference documentation for descriptors language #14096
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
Conversation
In case there is another 0.17 RC, this should probably be included (the RPC help still says "documentation at TODO"). |
doc/descriptors.md
Outdated
- `sh(SCRIPT)` (toplevel only): P2SH embed the argument. | ||
- `wsh(SCRIPT)` (not inside another 'wsh'): P2WSH embed the argument. | ||
- `pk(PUBKEY)` (anywhere): P2PK output for the given public key. | ||
- `pkh(PUBKEY)` (anywhere): P2PKH output for the given public key (use `addr` if you only thos the pubkey hash). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "thos" :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
doc/descriptors.md
Outdated
Public keys: | ||
- Hex encoded public keys (66 characters starting with `02` or `03`, or 130 characters starting with `04`). | ||
- Inside `wpkh` and `wsh`, only compressed public keys are permitted. | ||
- WIF encoded private keys, whose denote their corresponding public keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "whose" be "which" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
FWIW, See #13954 for |
doc/descriptors.md
Outdated
`scantxoutset` RPC call. This is a simple language which can be used to | ||
describe collections of output scripts. | ||
|
||
This document describes the language. For the specfics on usage for scanning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "specfics"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
doc/descriptors.md
Outdated
## Quick reference | ||
|
||
Scripts: | ||
- `sh(SCRIPT)` (toplevel only): P2SH embed the argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "toplevel" should probably be "top level" (applies throughout), no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
doc/descriptors.md
Outdated
|
||
### Multisig | ||
|
||
Several pieces of software use multisignature scripts based on Bitcoin's OP_CHECKMULTISIG opcode. To support these, we introduce the `multi(k,key_1,key_2,...,key_n)` function. It represents a *k-of-n* multisig policy, where any *k* out of the *n* provided public keys must sign. Examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "multisignature" should be "multi signature" or "multisig"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Excellent documentation! Great work as always! ACK f1665448a3d6ae244e36a74a311b27db4e4144a5 modulo nits |
ACK db7ebf0f45a62f685375ce80a0a8ea57420b0ab0 |
utACK db7ebf0f45a62f685375ce80a0a8ea57420b0ab0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 843bc92035bfcfa4327b5400b3a722ad6df393ec
doc/descriptors.md
Outdated
|
||
Many single-key constructions are used in practice, generally including P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH. Many more combinations are imaginable, though they may not be optimal: P2SH-P2PK, P2SH-P2PKH, P2WSH-P2PK, P2WSH-P2PKH, P2SH-P2WSH-P2PK, P2SH-P2WSH-P2PKH. | ||
|
||
To describe these, we model these as functions. The functions `pk` (P2PK), `pkh` (P2PKH) and `wpkh` (P2WPKH) take as input a public key in hexadecimal notation, and return the corresponding *scriptPubKey*. The functions `sh` (P2SH) and `wsh` (P2WSH) take as input a script, and return the script describing P2SH and P2WSH outputs with the input as embedded script. The names of the functions do not contain "p2" for brevity. Examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"take as input a public key in hexadecimal notation"
Maybe clarify these don't only take hexadecimal notation (since they should accept any KEY expressions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explanation section builds things up step-by-step; I think it's more helpful to not give all information at once. I've instead added "which will be extended later", is that ok?
doc/descriptors.md
Outdated
|
||
### Including private keys | ||
|
||
Often it is useful to communicate a description of scripts along with the necessary private keys. For this reason, anywhere a public key or xpub is supported, a private key (in WIF format) or xprv may be provided instead. This may be useful for dumping wallet descriptors including private key material. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems inconsistent to parenthesize mention of WIF format but not xprv format. It might also be good to say in this section that xprv format is specified in BIP32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (I've added the link higher up).
Restructured the document, reformatted the markdown, and added a number of links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reACK 2b5d6f8, various changes since last review including some suggested changes and also adding links to more documentation
utACK 2b5d6f8 |
utACK 2b5d6f8 |
2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
Github-Pull: bitcoin#14096 Rebased-From: 9254ffc Tree-SHA512: 1fc466177dbe3b57b0025c102b1e75e4b05544440819885da7a85b70d20329fc3f6f4cbf89d7d6a48881e6ad176d81f7396f02925586140e19468a2f28f3414e
Github-Pull: bitcoin#14096 Rebased-From: 89709db Tree-SHA512: 0bf74e1179bee6e616d8fd2c125411ef30611d9aa3b32412025615a793abbc629a7b6d89a89ef05b11ac3541cc869c0caebba2d00942fdd6ab8d2e98d9b9caca
Github-Pull: bitcoin#14096 Rebased-From: 2b5d6f8 Tree-SHA512: 79af808c581ebb17d60aab8322b1debcc4182480b84eaedcbfac1e67c8b543c61df22789095742d67d732dba35e7e5fad77912385b695f89fb0f44f75db11560
Github-Pull: bitcoin#14096 Rebased-From: 9254ffc Tree-SHA512: 1fc466177dbe3b57b0025c102b1e75e4b05544440819885da7a85b70d20329fc3f6f4cbf89d7d6a48881e6ad176d81f7396f02925586140e19468a2f28f3414e
Github-Pull: bitcoin#14096 Rebased-From: 89709db Tree-SHA512: 0bf74e1179bee6e616d8fd2c125411ef30611d9aa3b32412025615a793abbc629a7b6d89a89ef05b11ac3541cc869c0caebba2d00942fdd6ab8d2e98d9b9caca
Github-Pull: bitcoin#14096 Rebased-From: 2b5d6f8 Tree-SHA512: 79af808c581ebb17d60aab8322b1debcc4182480b84eaedcbfac1e67c8b543c61df22789095742d67d732dba35e7e5fad77912385b695f89fb0f44f75db11560
…uage 2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
…uage 2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
…uage 2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
…uage 2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
…uage 2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
…uage 2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
Github-Pull: bitcoin#14096 Rebased-From: 9254ffc Tree-SHA512: 1fc466177dbe3b57b0025c102b1e75e4b05544440819885da7a85b70d20329fc3f6f4cbf89d7d6a48881e6ad176d81f7396f02925586140e19468a2f28f3414e
Github-Pull: bitcoin#14096 Rebased-From: 9254ffc Tree-SHA512: 1fc466177dbe3b57b0025c102b1e75e4b05544440819885da7a85b70d20329fc3f6f4cbf89d7d6a48881e6ad176d81f7396f02925586140e19468a2f28f3414e Add descriptor reference documentation (dashified)
Github-Pull: bitcoin#14096 Rebased-From: 9254ffc Tree-SHA512: 1fc466177dbe3b57b0025c102b1e75e4b05544440819885da7a85b70d20329fc3f6f4cbf89d7d6a48881e6ad176d81f7396f02925586140e19468a2f28f3414e Add descriptor reference documentation (dashified)
…uage 2b5d6f8 Replace duplcate reference with reference to reference doc (Pieter Wuille) 89709db Adjust TODO link (Pieter Wuille) 9254ffc Add descriptor reference documentation (Pieter Wuille) Pull request description: Tree-SHA512: 1ca0d537f9bcbb23266e9a4a02a60013ef8309958fb701f638283887585b5ddea6bc9dab859454ec3a373b1a12a4fd69836e7030417bb2ca43fef26b104c0d65
No description provided.