Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Multisignature

This sentence is a procedure for n-of-n Multisignatures to the following URL.

The symbols and functions used are defined in the following URL.

https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki

Introduction

  • The number of users u.
  • The public key P = P1 + ... + Pu : a point
  • The message m: an array of 32 bytes

The n , G and functions are cited from the original text.

Signing

Step 1

Every user(i = 1...u) prepare secret key , random point and hash value.

  • The secret key di: an integer in the range 1..n-1.
  • Let ki = int(hash(bytes(di) || m)) mod n.
  • Let Ri = kiG.
  • Let hi = hash(bytes(Ri)).

Step 2

Every user(i = 1...u) sends hash value (hi) to other users(j = 1...u , i ≠ j).

Step 3

If all hash values are received, users(i = 1...u) send random point(Ri) to other users(j = 1...u , i ≠ j).

Step 4

Every user(i = 1...u) checks :

  • For j = 1...u , i ≠ j:
    • Let h = hash(bytes(Rj)).
    • Fail if hj ≠ h.

Every user(i = 1...u) sign :

  • Let ki = int(hash(bytes(di) || m)) mod n.
  • Let R = R1 + ... + Ru.
  • If jacobi(y(R)) ≠ 1 , let ki = n - ki.
  • Let e = int(hash(bytes(x(R)) || bytes(P) || m)) mod n.
  • Let si = bytes(ki + edi mod n).

Every user(i = 1...u) sends their signature(si) to other users(j = 1...u , i ≠ j).

Step 5

Every user(i = 1...u) checks:

  • Let R = R1 + ... + Ru.
  • Let e = int(hash(bytes(x(R)) || bytes(P) || m)) mod n.
  • For j = 1...u , i ≠ j:
    • Fail if sj ≥ n.
    • Let R = sjG - ePj
    • Fail if infinite(R') or x(R) ≠ x(Rj).

Step 6

Any user creates a signature :

  • Let R = R1 + ... + Ru.
  • Let s = s1 + ... + su mod n.
  • The signature is bytes(x(R)) || bytes(s).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment