Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): Dirk multi-node delegation support #509

Merged
merged 13 commits into from
Dec 3, 2024

Conversation

merklefruit
Copy link
Collaborator

@merklefruit merklefruit commented Dec 2, 2024

This PR adds support for creating signed delegations from multi-node Dirk instances (aka DistributedAccount).

Unfortunately, the BLS library we have used until now (BLST) doesn't support M-N threshold signature recovery.
See the related issue: supranational/blst#123

Since this operation is not overly complex, I've decided to implement it manually in recover_signature.rs,
following the C reference implementation in MCL directly for the Lagrange interpolation

The implementation is tested by generating a signed delegation against a 2-of-3 Dirk setup running locally and then verifying the signature against the combined public key.

One important caveat for testing is that the multi-node setup only works if you modify your /etc/hosts file to add aliases for localhost to localhost-1, localhost-2, localhost-3 because it's the only way to have different valid TLS certificates on the same machine.

@merklefruit merklefruit marked this pull request as ready for review December 3, 2024 07:59
Copy link
Contributor

@thedevbirb thedevbirb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. BLS is so cool

bolt-cli/src/common/dirk/distributed.rs Outdated Show resolved Hide resolved
bolt-cli/src/common/dirk/distributed.rs Outdated Show resolved Hide resolved
bolt-cli/src/common/dirk/test_util.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@mempirate mempirate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work

@merklefruit merklefruit merged commit 53205e8 into unstable Dec 3, 2024
3 checks passed
@merklefruit merklefruit deleted the feat/dirk-multinode branch December 3, 2024 10:53
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.

3 participants