mpcium icon indicating copy to clipboard operation
mpcium copied to clipboard

Taurus CMP (ECDSA)

Open vietddude opened this issue 1 year ago • 3 comments

PR Summary

Implement all Taurus protocols (CMP, FROST, Taproot) and add Presign support for CMP (CGGMP21).

Presign for CMP (CGGMP21)

  • Added presign endpoint for preparing pre-signature data.
  • To optimize latency, call Presign before signing a transaction.
  • Presign entries are cached locally with TTL and cleaned up automatically.

vietddude avatar Oct 06 '25 10:10 vietddude

image

I just checked documentation. Presign is a step to generate a preSig that doesn't depend on the message being signed

So I think we might need to change implementation of Presign api , in the presign examples, it's presigning with transaction data which make it difficult for application integration.

txMsg := &types.PresignTxMessage{
		KeyType:             types.KeyTypeCGGMP21,
		WalletID:            "196c6858-30de-4a49-9134-8bc825d40764", // Use the generated wallet ID
		NetworkInternalCode: "solana-devnet",
		TxID:                txID,
		Tx:                  dummyTx,
	}
	err = mpcClient.PresignTransaction(txMsg)
	if err != nil {
		logger.Fatal("PresignTransaction failed", err)

I think the correct flow is that it only expose PresignTransaction that accept KeyType only.

And we can specify the number of Presigs that we want to generate. For intance 30 , that will be generated sequentially through a worker. The presigs can be stored both in Ram using a pool implementation, and can be persisted in badger with used boolean to mark if the presig is already used or not

Pooling strategy

Keep RAM pool (e.g. up to 30 unused pre-signs per wallet) for sub-millisecond access.

Persist all in BadgerDB (or Postgres if cluster-wide).

Worker thread runs in background:

If pool size < threshold (e.g. 30), refill N new presigns.

Mark used=true atomically to prevent reuse.

Encryption: store pre-signs encrypted with workspace key (AES-GCM).

In the config, we can have a flag to automatically enable presig pool fill. This mean that when the mpcium node detects that it's idle doesn't process any transaciton, it will run fillPresignPool

anhthii avatar Nov 01 '25 15:11 anhthii

The pull request lacking pratical examples for cggmp21 + taproot + frost signing. May need to add more examples in examples folder

anhthii avatar Nov 01 '25 15:11 anhthii

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub.com/​fxamacker/​cbor/​v2@​v2.4.098100100100100
Addedgithub.com/​taurusgroup/​multi-party-sig@​v0.7.0-alpha-2025-01-28100100100100100

View full report

socket-security[bot] avatar Nov 06 '25 10:11 socket-security[bot]