input+signrpc+lnwallet+multi: implement combined nonce support
Add CombinedNonce() and RegisterCombinedNonce() methods with full implementation stack. Interface and core implementation: - input/musig2.go: Added methods to MuSig2Session and MuSig2Signer interfaces - input/musig2_session_manager.go: MusigSessionManager implementation using HaveAllNonces flag for state tracking (simplified, no extra fields) - internal/musig2v040: Stub implementations returning ErrUnsupportedMethod - Mock implementations (MockInputSigner, MockSigner, DummySigner) RPC layer: - lnrpc/signrpc/signer.proto: RPC method definitions and messages - lnrpc/signrpc/signer.yaml: REST API endpoint mappings - Generated protobuf code (all .pb.go files) - lnwallet/rpcwallet/rpcwallet.go: RPCKeyRing client implementation The proto types and RPCKeyRing are added together since RPCKeyRing implements the Signer interface and requires proto types to fulfill the contract. For v0.4.0, these methods return ErrUnsupportedMethod. Use MuSig2Version100RC2 to access these features.
This commit is contained in:
15 files changed
+1204
-175
No files matched your search
@@ -258,6 +258,29 @@ func (m *MockInputSigner) MuSig2RegisterNonces(versio MuSig2SessionID,
|
||||
return args.Bool(0), args.Error(1)
|
||||
}
|
||||
|
||||
// MuSig2RegisterCombinedNonce registers a pre-aggregated combined nonce for a
|
||||
// session identified by its ID.
|
||||
func (m *MockInputSigner) MuSig2RegisterCombinedNonce(sessionID MuSig2SessionID,
|
||||
combinedNonce [musig2.PubNonceSize]byte) error {
|
||||
|
||||
args := m.Called(sessionID, combinedNonce)
|
||||
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// MuSig2GetCombinedNonce retrieves the combined nonce for a session identified
|
||||
// by its ID.
|
||||
func (m *MockInputSigner) MuSig2GetCombinedNonce(sessionID MuSig2SessionID) (
|
||||
[musig2.PubNonceSize]byte, error) {
|
||||
|
||||
args := m.Called(sessionID)
|
||||
if args.Get(0) == nil {
|
||||
return [musig2.PubNonceSize]byte{}, args.Error(1)
|
||||
}
|
||||
|
||||
return args.Get(0).([musig2.PubNonceSize]byte), args.Error(1)
|
||||
}
|
||||
|
||||
// MuSig2Sign creates a partial signature using the local signing key that was
|
||||
// specified when the session was created.
|
||||
func (m *MockInputSigner) MuSig2Sign(sessionID MuSig2SessionID,
|
||||
|
||||
Reference in new issue
Block a user