Skip to content

ecdsa sign message contract#70

Open
KyrylR wants to merge 2 commits into
mainfrom
feature/jade-ecdsa-sign-message-contract
Open

ecdsa sign message contract#70
KyrylR wants to merge 2 commits into
mainfrom
feature/jade-ecdsa-sign-message-contract

Conversation

@KyrylR
Copy link
Copy Markdown
Collaborator

@KyrylR KyrylR commented May 21, 2026

The new bitcoin_message_ecdsa_verify contract verifies an ECDSA signature over the Bitcoin signed-message digest derived from the Simplicity sig_all_hash. This makes it possible to satisfy and spend a Simplicity contract using a signature produced by Jade’s sign_message anti-exfil flow.

@KyrylR KyrylR force-pushed the feature/jade-ecdsa-sign-message-contract branch from 89f2ab1 to a4479a3 Compare May 21, 2026 15:35
@KyrylR KyrylR requested review from Arvolear and apoelstra May 21, 2026 15:36
@KyrylR KyrylR assigned KyrylR and unassigned apoelstra and Arvolear May 21, 2026
@apoelstra
Copy link
Copy Markdown

apoelstra commented May 21, 2026

Why provide both the nonce point and R from the signature? The nonce point by itself is sufficient and will save you a check and an error path. You also don't need to (and should not) actually has the Bitcoin signed message:<len>\n text, since you can just directly construct ctx.

But stepping back -- this seems like a terrible idea to me. The "signmessage" functionality is intentionally domain-separated by this Bitcoin signed message text so that you can't accidentally sign a transaction by signing a maliciously-crafted message. This eliminates that protection. It also makes it impossible for the the Jade to verify what it's signing, since you're just providing it a hash with no preimage data. This eliminates all the protection provided by the Jade having a screen etc.

This is in addition to how inherently inefficient this scheme is.

@KyrylR
Copy link
Copy Markdown
Collaborator Author

KyrylR commented May 22, 2026

Why provide both the nonce point and R from the signature? The nonce point by itself is sufficient and will save you a check and an error path.

Got it, thx, will do the optimization if we decide to proceed with the approach

You also don't need to (and should not) actually has the Bitcoin signed message:\n text, since you can just directly construct ctx.

As I understand, this is related to the second part (correct me if I am wrong)

But stepping back -- this seems like a terrible idea to me. The "signmessage" functionality is intentionally domain-separated by this Bitcoin signed message text so that you can't accidentally sign a transaction by signing a maliciously-crafted message. This eliminates that protection. It also makes it impossible for the the Jade to verify what it's signing, since you're just providing it a hash with no preimage data. This eliminates all the protection provided by the Jade having a screen etc.

Created this: Blockstream/Jade#296

If I understand you correctly you wanna have the approach the prevents blind signing by default, while spending the Simplicity input on the Jade

This is in addition to how inherently inefficient this scheme is.

Fully agree

Thought this PoC was the best way to quickly explain the problem faced by guys on Simplicity Lending and have a discussion

@apoelstra
Copy link
Copy Markdown

If I understand you correctly you wanna have the approach the prevents blind signing by default, while spending the Simplicity input on the Jade

Yes. The Jade needs to know what transaction it's signing (at least, it needs to know that it's signing a transaction!).

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.

3 participants