How ibm/tss works
Project type and purpose
• This is a Go-based cryptographic library (“TSS”) that implements Threshold Signature Schemes. It is not a web or full-stack application but a pluggable library composed of multiple modules:
• A discovery/synchronization layer (“disc”)
• A reliable broadcast layer (“rbc”)
• An optional networking layer (“net”)
• Pluggable MPC backends for different signature schemes (“mpc/binance/…”, “mpc/bls”, “mpc/ps”)
• A top-level orchestrator (“threshold”) that wires these pieces together
• Common types (“types”) and test utilities.
File structure
• Top-level directories:
• disc/ – discovery protocol
• rbc/ – reliable byzantine broadcast
• net/ – encrypted/authenticated messaging implementation
• mpc/ – multiple submodules, each a Go module wrapping or implementing a TSS scheme:
– binance/ecdsa
– binance/eddsa
– bls
– ps
• threshold/ – orchestration of disc, rbc, net, mpc; implements Scheme interface
• types/ – interface and shared type definitions
• testutil/ – TLS key generation for tests
• test/ – integration tests across backends
• Configuration/build:
• go.mod at root and in each mpc submodule
• CI workflow under .github/workflows/CI.yml
• Test scripts under scripts/
README for additional insights
• The README describes:
• How threshold.Scheme is constructed (LoudScheme vs. SilentScheme)
• Dependency injection pattern for passing custom disc, rbc, net, mpc implementations
• Separation of UniversalID vs. PartyID domains
• Flow of key generation vs. signature phases
• How each module’s API looks and interacts
Main components & their relationships
a. Components:
1. Client code / consumer (initializes threshold.Scheme, feeds messages, retrieves signatures)
2. threshold.Scheme (orchestrator)
3. disc (member discovery, bootstrapping)
4. rbc (reliable broadcast layer)
5. net (optional secure transport, implements send/receive)
6. mpc backends (binance-ecdsa, binance-eddsa, bls, ps)
7. types (shared structs like IncMessage)
b. Interactions / Data flow:
• Consumer invokes Scheme.KeyGen or Scheme.Sign
• Scheme uses disc to establish membership (UniversalID → PartyID mapping)
• Scheme wires up rbc and net (or user-provided transport) to multicast messages
• MPC backend is initialized via a callback (sendMsg) for sending partial msgs to other parties
• Incoming messages from net are dispatched by Scheme.HandleMessage to the correct module (disc, rbc, mpc)
• rbc ensures non-equivocation; disc ensures all parties are present; mpc executes threshold protocol
• Results (key shares, partial signatures) bubble up to Scheme, which returns bytes to consumer
c. Architectural patterns and principles:
• Dependency Injection – Scheme receives interfaces for disc/rbc/net/mpc
• Modular design – each TSS variant lives in its own Go module, no circular imports
• Pluggable pipeline – discovery → broadcast → MPC
• Separation of concerns – network vs. protocol vs. orchestration
d. Key technologies/frameworks:
• Go modules, standard Go testing
• Binance tss-lib for ECDSA/EdDSA
• gnark-crypto bn254 for BLS
• IBM Pointcheval‐Sanders for PS
• Simple in-memory TLS generator in testutil