Skip to content

Instantly share code, notes, and snippets.

@moonsettler
Last active December 15, 2023 17:04
Show Gist options
  • Save moonsettler/d4eb59c62a2b8f104c72603231b73a41 to your computer and use it in GitHub Desktop.
Save moonsettler/d4eb59c62a2b8f104c72603231b73a41 to your computer and use it in GitHub Desktop.
Non interactive anti-exfil

Signing protocol:

x: private key
X: public key
m: message to sign
n: nonce extra

1. signing device

q = hash(x|m|n)
Q = q·G
k = q + hash(Q|m|n)
R = k·G
e = hash(R|X|m)

s = k + x·e

2. return to wallet app

Q, s

3. wallet app calculates

R = Q + hash(Q|m|n)·G
R, s

4. verify

e = hash(R|X|m)

s·G ?= R + e·X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment