Thor Kamphefner
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
1
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- tags: public, tss, dkg --- # Walking Through Distributed Key Generation (DKG) This post is a follow-along to a talk on Distributed Key Generation at DevConnect, Amsterdam 2022 ([slides here](https://drive.google.com/file/d/1ejnOVwu6JPaUl72jiDGglndYFIIT0Rdh/view?usp=sharing)). It also functions as a stand-alone resource. The post is intended to briefly introduce the motivation for threshold signatures, relating them to multisignatures, and clarify the Distributed Key Generation protocol from [GG20](https://eprint.iacr.org/2020/540.pdf), S3.1, p14. Implementing the protocol has been a core component of my work at [Entropy](https://entropy.xyz), the trustless decentralized asset custodian. A mathematically complete description of the protocol begins in the latter half of the document; the first half remains technically high level, and should be accessible to non-technical readers. Questions and corrections are invited via [Twitter](https://twitter.com/cryptograthor). ## Knowledge Check! It will be helpful to be familiar with several concepts: - Langrange interpolation, on which Shamir Secret Sharing relies - Shamir Secret Sharing Scheme - Commitment Schemes, in particular Pedersen's Commitment Scheme (everything in cryptography is a scheme, except for programs which are invariably in Rust) Each have reasonably good Wikipedia articles. Pallier encryption, Schnorr's zk proof of knowledge of exponent, and the Feldman modification to Shamir secret sharing, which are used in the signing protocol, will not be necessary here. ## What Threshold Signature? And Briefly, What Multisignatures A t-of-n secret sharing of some secret $u$ produces $n$ "shares" of $u$, of which any $t+1$ can reconstruct $u$. There is some notation confusion whether t-of-n should refer to a minimum of $t+1$ parties or $t$ parties; $t+1$ is the convention used by GG20, so we will use it here. A similar construction to the threshold signature is the t-of-n multisignature: - $n$ parties hold private keys - Some trusted entity (eg. a smart contract) collects $t+1$ unique signatures on some message, (eg. a transaction), and then signs that message itself In a t-of-n threshold signature: - Key Generation: Some secret key $u$, secret to all parties, is constructed. At the end of a DKG, every party possesses some secret share from which $u$ may be reconstructed. No party knows another party's share. - Any $t+1$ parties can collaborate to sign a message, producing a single signature. No party learns of any other party's share. The protocol effectively reconstructs the private key, $u$, in zero knowledge, and uses it to sign a message. **Relative Advantages of a multisignature** - Simplicity of implementation: the trusted party simply must store and verify $t+1$ signatures, before constructing its own - No new cryptography - Async: parties do not need to all be online at the same time **Relative Advantages of a threshold signature** - Space-efficiency, verifier-efficiency: Only a single signature need be stored and verified - Modularity: The implementation logic of a threshold signature can be isolated from the environment that verifies the signature, allowing a threshold signature to be computed entirely off-chain ## But what if we just...centralized it? In this centralized setting, a trusted party, Alice, will construct all the shares, and simply send them to the $n$ parties. Alice may simply pick her favorite secret sharing scheme (eg. Shamir's) to do so. In the centralized setting, Alice is a back door to the threshold signature, as she may simply construct signatures using the private key. In the next section we will eliminate Alice as a trusted party for true DKG. The centralized scheme has one "key" property: Alice can bring her own private key to the threshold signature, where the rest of the threshold signing protocol continues as if Alice were a normal player. That is to emphasize that, in the DKG model, an entirely new secret key is constructed that no player possesses. Therefore, if Alice were to delete her private key, then the setting would be identical to the next section. Since it is impossible to verify whether Alice has kept a copy, we turn to cryptography to construct Distributed Key Generation. ## Cryptography time! This section follows S3.1 in GG20. In several places, I've added notation not in the original paper. These are explicitly labelled, noted to avoid creating confusion. The DKG proceeds in 3 phases. Participants in the protocol will be called "players". A word of warning: there will be many moving parts here. Note-taking is encouraged. ### Phase 1 Each player selects their private share, and broadcasts a commitment to it. The $:=$ notation is used here to denote a calculation done by a given player. Each player, $P_i$ constructs: * $u_i$, an initial private share, selected at random by the player * $(KGD_i,KGC_i):=(g^{u_i}, Com(g^{u_i}))$, a commitment **to the hiding** of $u_i$ to send to each other player. Note that this is essentially **a commitment to a commitment of a secret.** Each player receives: * $KGC_j\space \forall j$, the commitment broadcast by all other players * $E_j\space \forall j$, the (Pallier) public key, broadcast by all players. This will be used to encrypt messages sent to player $P_j$, and to perform the signing protocol. That it is a Pallier cryptosystem public key is irrelevant for the scope of this post. ### Phase 2 Players first decommit their public keys (broadcasting $g^{u_i}$), then perform a secret sharing and determine the group secret sharing. Denote the $(t,n)$-secret sharing scheme of the secret $u_i$ (my notation): $$SS_{t,n}(u_i:\text{secret},z:\text{evaluation index})=u_i+a_{i,1}z+...+a_{i,t}z^t$$ and the the jth evaluation of the polynomial, $$s_{i,j} =SS_{t,n}(u_i,j)=u_i+a_{i,1}j+..+a_{i,t}j^t=u_i+\sum_k a_{j,k}j^k$$ Where the coefficients $a_{i,k}$ are selected at random by $P_i$. The reader should verify that $P_i$ can compute $s_{i,j}$ for all $j$. Each player, $P_i$: * assigns $y_j=KGD_j\space \forall j<t$, the hiding of the of each other player's secret. Henceforth, the symbol $\forall$ denotes for all players. * computes $y:=\prod y_i=g^{\sum u_i}$, the "public key" of the group; the group's "secret key" will be the sum of shares, $\sum u_i$. * selects random coefficients to construct $SS_{t,n}(u_i,z)$, the temporary secret sharing polynomial for their own secret. * computes shares $s_{i,j}\space \forall j$ to privately send to each other player. Player $P_i$ receives $s_{j,i}$ from each other player $P_j$. * computes $x_i:=\sum_j s_{j,i}$ * computes the hiding of $x_i$, $X_i=g^{x_i}$ Denote the group secret $x=\sum u_i$. We will now show that Player $P_i$ has computed a $(t,n)$ secret share of $x$: $$x_i:=\sum_j s_{j,i} = \sum_j SS_{t,n}(u_j,i)$$ $$=(\sum_j u_j)+(\sum_j a_{j,1})i+...+(\sum_j a_{j,t})i^t$$ $$=SS_{t,n}(\sum_j u_j: \text{group secret}, i: \text{player index})$$ Note that coefficients of this polynomial are shared by all players, but not known to any player. Therefore, each player $P_i$ now posseses in $x_i$ a $(t,n)$-secret-sharing of $x$. ### Phase 3: Verifiability Suppose Player $P_i$ were able to lie to player $P_j$ about the value of $X_i$, the hiding of their secret key share. This would allow player $P_i$ to volunteer to participate in the signing protocol, but prevent the creation of a valid signature, without anyone knowing! By adopting the Feldman VSS, which extends the Shamir SS, Player $P_i$ gains the ability to calculate each other player $P_j$'s commitment $X_j$. This step prevents any player from cheating in the signature protocol. In the Feldman VSS, each party also publishes the hiding of each coefficient of their polynomial, $g^{a_{i,k}}\space \forall k$. For convenience, denote the coefficients of our final polynomial: $$b_k=\sum_j a_{j,k} \quad \text{and} \quad b_0 = \sum u_j$$ Then player $P_i$'s share can be expressed: $$SS_{t,n}(\sum_j u_j,i)=\sum_j b_ji^j$$ By exploiting commitments from Feldman's, any player $P_i$ may calculate $g^{b_k}\space \forall k$: ### $$g^{b_k}=g^{\sum_j a_{j,k}}=\prod_j g^{a_{j,k}}$$ Where each player broadcast the hiding of their coefficients $g^{a_{i,k}}$ as part of the Feldman protocol. Player $P_i$ exploits the above lemma to compute $g^{b_k}$, and may thereby compute $X_j$: ### $$X_j=g^{x_j}=g^{\sum_k b_kj^k}=\prod_k {(g^{b_k})}^{j^k}$$ There are several checks from Phase 3 that are elided. They are straightforward, but would require introducing Pallier encryption, Schnorr's zk proof-of-knowledge-of-exponent, and a square-free proof, which I feel would bloat the scope of this post. ## Wrap up Yay, you made it here! Things you may have learned: - An application of repeated secret key sharing to construct a distributed secret - What threshold signatures are, and how they compare to multisignatures - Taking good notes is hard! I feel that last one in particular. If that was an exciting cryptographic rabbithole, consider reaching out on [Twitter](https://twitter.com/cryptograthor); we're hiring.

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully