go-cggmp-tss

Go Reference License: MIT

A pure Go implementation of the CGGMP21 Threshold Signature Scheme (TSS) protocol.

Note: This library is currently in active development (Alpha). Do not use in production environments without a thorough security audit.

Overview

This library implements the CGGMP21 protocol (Canetti-Gennaro-Goldfeder-Makriyannis-Peled), which allows a group of parties to generate a key and sign messages without ever reconstructing the private key in a single location.

Key Features

Installation

go get github.com/smallyu/go-cggmp-tss

Quick Start

The core of the library is the StateMachine pattern. Here is a high-level view of how to integrate it:

import (
    "github.com/smallyu/go-cggmp-tss/pkg/tss"
    "github.com/smallyu/go-cggmp-tss/internal/protocol/keygen"
)

// 1. Initialize the State Machine
state, outMsgs, err := keygen.NewStateMachine(params)

// 2. Run the Event Loop
for {
    // Receive message from your network layer
    msg := network.Receive()
    
    // Update the state machine
    nextState, outMsgs, err := state.Update(msg)
    if err != nil {
        log.Fatal(err)
    }
    
    // Send output messages to other parties
    network.Broadcast(outMsgs)
    
    // Check for completion
    if nextState == nil {
        result := state.Result()
        // Handle result (KeyShare or Signature)
        break
    }
    
    state = nextState
}

For a complete step-by-step guide, please read the Usage Documentation.

Documentation

Architecture

The library is structured to separate cryptographic primitives from protocol logic:

License

MIT