Skip to content

Instantly share code, notes, and snippets.

@tnakagawa
Last active October 11, 2018 07:36
Show Gist options
  • Save tnakagawa/0c3bc74a9a44bd26af9b9248dfbe598b to your computer and use it in GitHub Desktop.
Save tnakagawa/0c3bc74a9a44bd26af9b9248dfbe598b to your computer and use it in GitHub Desktop.

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.
  • Each player's public keys are P1 , ... , Pu : point
  • c = hash(bytes(P1) || ... || bytes(Pu))
  • μ1 = int(hash(c || 1)) mod n , ... , μu = int(hash(c || u)) mod n
  • P = μ1P1 + ... + μuPu
  • 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 + eμidi 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 - eμjPj
    • 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