Skip to main content

Off-Chain Multisignature

TL;DR

The off-chain multi-signature collection has reduced the transaction costs and made the number of validators scalable.

Definition

Digital Signature (DS) is a function implementing an asymmetric cryptography algorithm that securely links a signer's secret key (SK) with the message. The authenticity of a signature can be verified using the public key (PK).

Why is it secure?

By contrast with symmetric cryptography, where the same key is employed for encryption and decryption, asymmetric cryptography utilizes two keys: public (PK) and private (SK). While in symmetric cryptography, there's a fundamental problem of secure transportation of the secret key in asymmetric cryptography, the issue is solved. The PK is cryptographically derivable from the private key (SK), but the secret key cannot be back-engineered from the public key. It allows to freely distribute the PK and use it to verify the authenticity of the message signed with the secret key without exposing the SK to the public.

Schnorr Signature

Claus-Peter Schnorr (born 1943-08-4), a German mathematician & cryptographer, suggested in 1989, filed in 1990, and finally patented in 1991 1 a digital signature algorithm using elliptic curve cryptography but enjoying several advantages over ECDSA in terms of computational efficiency and thus speed, privacy, and storage requirements. The patent expired in 2008 and was soon noticed and utilized by the evolving blockchain industry.

What makes Schnorr efficient?

The most significant advantage of Schnorr is key aggregation. By contrast with the regular multisig (mโˆ’ofโˆ’n)(m-of-n) address where
Msign=((pk0..pkmโˆ’1),M,(Sig0...Sigmโˆ’1))Msig_{n} = ((pk_0..pk_{m-1}),M, (Sig_0...Sig_{m-1})):

  • MsignMsig_{n} - multisignature of size nn
  • pk0pk_0 - The first public key
  • pkmโˆ’1pk_{m-1} - The last public key out of mm required for success
  • MM - the signed message
  • Sig0Sig_0 - The first signature
  • Sigmโˆ’1Sig_{m-1} - The last signature out of mm required for success

the Schnorr scheme allows to aggregate the heavy arrays of pkmpk_m and SigmSig_m to single objects, thus saving on storage and computation. Hence, Schnorr multi-signature has an mm times more efficient form: Schnorrn=(pkฮ”,M,Sigฮ”)Schnorr_{n} = (pk_\Delta,M, Sig_\Delta). Verification complexity is reduced from O(m)O(m) to O(1)O(1).

Mathematical Representation of Schnorr Signature

The Schnorr Digital Signature (DS) scheme can be represented as a 3 component tuple of algorithms, where DS=(Kg,Sign,Vfy)DS = (Kg, Sign, Vfy)

KgKg or key generation can be represented as Kg=sk=>pkKg = sk => pk, where public key pkpk is generated from the secret key sksk
SignSign(sk,M)(sk,M) generates a signature ฯƒ\sigma on message Mฯต{0,1}โˆ—M\epsilon\{0,1\}^*
VfyVfy (pk,M,ฯƒ)(pk, M, \sigma) outputs 1 in case the signature ฯƒ\sigma is valid for the message mm and 0 otherwise.

Algorithm Parameters

ParameterDescriptionSecrecy
ppA prime numberPublic
qqfactor of pโˆ’1p-1Public
aaaq=1modโˆฅpโˆฅa^q = 1 mod \|p\|Public
MMThe message, where Mฯต{0,1}โˆ—M \epsilon \{0,1\}*Public
vvaโˆ’smodโˆฅqโˆฅa^{-s} mod \|q\|Public Key
rrA random number 0<r<q0 < r < qSecret
ss0<s<q0 < s < qSecret

Step 1. Signing a message

  1. Choose a random rr, where 0<r<q0 < r < q
  2. Compute x=armodโˆฃpโˆฃx = a^r mod |p|
  3. Concatenate e=h(Mโˆฃโˆฃx)e = h(M || x)
  4. Compute y=(r+se)modโˆฃqโˆฃy = (r + se) mod |q|

Step 2. Sending the message

Message: MM
Signature (e,y)(e, y)

Step 3. Receiving the signed message

  1. Received: M,(e,y)M, (e,y)
  2. Public: a,p,q,va, p, q, v

Step 4. Reading the message

The receiver has to compute: xโ€ฒ=ayvemodโˆฃpโˆฃx' = a^y v^e mod |p|

The math behind it:
xโ€ฒ=ayve=ayase=ayโˆ’se=arxmodโˆฃpโˆฃx' = a^y v^e = a^ya^se = a^{y-se} = a^r x mod |p|

Outcome:

(y=r+ser=yโˆ’se)\begin{pmatrix}y = r + se\\r = y - se\end{pmatrix}

Step 5. Signature Verification:

rv=gsyer_v = g^sy^e
ev=H(Mโˆฃโˆฃx)e_v = H(M || x)
If eve_v computed above matches with the one ee received, the signature was valid.

Footnotes