-
Notifications
You must be signed in to change notification settings - Fork 71
NUT-11: Optional P2PKWitness.digest for multi-party SIG_ALL #318
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
Open
robwoodgate
wants to merge
6
commits into
cashubtc:main
Choose a base branch
from
robwoodgate:sig_all_digest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cff17ef
Adds optional P2PKWitness.digest
robwoodgate e76e22b
Added witness.mts for flexibility
robwoodgate 6d6a5f2
Update 11.md
robwoodgate 91cbd4e
Adds note that mts and digest should be removed before sending to mint
robwoodgate 784607d
Punctuation fix
robwoodgate c7681b3
Typo fix
robwoodgate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,12 +61,20 @@ Signatures are stored in `P2PKWitness` objects and are provided in either each ` | |
|
|
||
| ```json | ||
| { | ||
| "signatures": <Array[<hex_str>]> | ||
| "signatures": <Array[<hex_str>]>, | ||
| "digest": <str> // Optional. | ||
| "mts": <str>, // Optional. | ||
| } | ||
| ``` | ||
|
|
||
| The `signatures` are an array of signatures in hex and correspond to the signatures by one or more signing public keys. | ||
|
|
||
| To facilitate the signing of multi-party `SIG_ALL` transactions, the SHA256 digest of the message to be signed can be stored in the optional `P2PKWitness.digest` of the `Proof` to be signed. Wallets SHOULD sign a `SIG_ALL` proof over this digest, if present, and ignore it entirely for `SIG_INPUTS` proofs. | ||
|
|
||
| In cases where `SIG_ALL` signers require detailed information about the inputs and outputs (eg: where there are multiple receivers), the plain text _message to sign_ can be stored in the `P2PKWitness.mts` of the `Proof` to be signed. Wallets **MUST** sign a `SIG_ALL` proof over the SHA256 of this message. if present, and ignore it entirely for `SIG_INPUTS` proofs. | ||
robwoodgate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| If both `digest` and `mts` are included, a wallet SHOULD use the `mts` and IGNORE the `digest`, or MUST validate the `digest` matches the `SHA256(mts)` before using it. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "message to sign". gotcha. |
||
|
|
||
| ## Tags | ||
|
|
||
| More complex spending conditions can be defined in the tags in `Secret.tags`. All tags are optional. Tags are arrays with two or more strings being `["key", "value1", "value2", ...]`. We denote a specific tag in a proof by its `key`. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.