Skip to content

Verify node-signed results with t+1 threshold - #171

Open
vietddude wants to merge 1 commit into
devfrom
feat/sign-result
Open

vietddude wants to merge 1 commit into
devfrom
feat/sign-result

Conversation

@vietddude

Copy link
Copy Markdown
Collaborator

Summary

  • Nodes sign every keygen, signing and reshare result event with their identity key (node_id + result_signature).
  • The client verifies the signature against known node public keys (NodeKeyLookup) and rejects unsigned or tampered results.
  • With RequiredNodeSignatures set to t+1, the client delivers a result only after t+1 distinct nodes report the same outcome. Each operation triggers the callback exactly once.
  • Result idempotent keys now include the node ID, so JetStream no longer drops the other nodes' copies.
  • Reshare results carry session_id and are grouped per session. The required count for a reshare is the new committee's threshold + 1.

Testing

  • Unit tests for signing/verifying results and for the aggregator (go test -race ./pkg/client ./pkg/event).
  • Full e2e suite (keygen, reshare, signing) passes with RequiredNodeSignatures = mpc_threshold + 1. The e2e tests now fail if any error result is received.

Known limitations

  • An error reported by only one node is delivered after the 15s aggregation timeout instead of immediately.
  • The per-session reshare threshold is only known to the client that sent the reshare. Another client receiving the result falls back to the old t+1, so a reshare to a smaller committee can report ERROR_INSUFFICIENT_NODE_SIGNATURES there.
  • On macOS, e2e/setup_test_identities.sh needs GNU sed, and the tests need GOWORK=off when run inside the workspace.

Nodes sign keygen, signing and reshare result events with their identity key.
The client verifies each signature and only delivers a result once t+1
distinct nodes report the same outcome.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@vietddude
vietddude requested a review from anhthii October 26, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant