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

Allow the user to use custom signing scheme and multiple keys in vtxo tree signatures #422

Merged
merged 26 commits into from
Jan 30, 2025

Conversation

louisinger
Copy link
Collaborator

@louisinger louisinger commented Jan 15, 2025

This PR adds a way for the user to sign only its branch during the vtxo tree signing process.

now RegisterOutputsForNextRound RPC expects the following request:

message Musig2 {
  repeated string cosigners_public_keys = 1;
  uint32 signing_type = 2;
}

message RegisterOutputsForNextRoundRequest {
  string request_id = 1;
  // List of receivers for to convert to leaves in the next VTXO tree. 
  repeated Output outputs = 2;
  optional Musig2 musig2 = 3;
}
  • ephemeral_pubkey has been replaced by musig2.cosigners_public_keys. It allows setting multiple signing keys for the same request. Useful for collaborative VTXO contracts.
  • signing_type is a flag signalling to the server the type of signing scheme the user wants to use, 2 are supported:
    • SignAll = 0 is the existing scheme where one signs all branches of the tree.
    • SignBranch = 1 is the new scheme where one signs only the branch(es) related to his VTXO(s) in the tree.

BREAKING CHANGES:

With this, the tree's PSBTs don't embed the sweep tapscript leaf and internal taproot key as unknown fields anymore. They are replaced instead with the batch lifetime, as clients know all other info to reconstruct the sweep leaf on their own.

@tiero @altafan @sekulicd please review

@louisinger louisinger requested a review from altafan January 15, 2025 16:38
common/locktime.go Outdated Show resolved Hide resolved
common/tree/type.go Outdated Show resolved Hide resolved
@louisinger louisinger requested a review from altafan January 18, 2025 23:19
@louisinger louisinger requested a review from altafan January 22, 2025 08:47
@altafan
Copy link
Collaborator

altafan commented Jan 22, 2025

Tried to make 2 rest client settle at the same time and they crashed because of the encoding of the nonces. Seems like some elems of the matrix are nil when signing a branch.

@louisinger louisinger requested a review from altafan January 30, 2025 10:04
@altafan altafan merged commit 1620265 into ark-network:master Jan 30, 2025
9 checks passed
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.

2 participants