Skip to content

Instantly share code, notes, and snippets.

@vietlq
Forked from tnakagawa/bipschnorr-Multisignature.md
Created September 5, 2018 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vietlq/84ffe9022a48c587162996fa7aaa28b8 to your computer and use it in GitHub Desktop.
Save vietlq/84ffe9022a48c587162996fa7aaa28b8 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.
  • 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