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
Does bitcoinjs lib has instruments for creating MuSig key-path spend wallets with n-n scheme? #2034
Comments
I would also like to know about this. |
Found it finnaly To extract your signatures : To import signatures: To extract the Transaction: To import the Transaction: |
In a MuSig wallet, the public keys need to be aggregated before generating the combined public key. The specific functions for combining public keys may depend on the cryptographic library or framework you are using. Assuming you are using a library like BitcoinJS, you would typically perform the following steps: javascript // Combine public keys // Use combinedPubkey in your transaction |
Thanks for the response, I will check this solution. Have you found a way to properly sign the transaction? For now, in your solution, I found two questions:
|
Thanks for the response, do you know the way how can I create an aggregated signature for MuSig wallet using bitcoinjs lib? |
Just txb.finalizeAllInputs(); after you added all the signatures
To generate the address controlled by the multisig you can
You create the tx object using : and consume inputs from the multisig address like this :
sign all the inputs with a single private key :
And then you finalize and get the completed hex string:
If you make progress on this I really want to know if there is a way to generate multiple address with the same multisig using BitcoinJS (working for a Typescript project that needs it atm) |
Thanks for the detailed response, but how did you compute |
Does |
export function tweakKey(
pubKey: Buffer,
h: Buffer | undefined,
): TweakedPublicKey | null {
if (!NBuffer.isBuffer(pubKey)) return null;
if (pubKey.length !== 32) return null;
if (h && h.length !== 32) return null;
const tweakHash = tapTweakHash(pubKey, h);
const res = getEccLib().xOnlyPointAddTweak(pubKey, tweakHash);
if (!res || res.xOnlyPubkey === null) return null;
return {
parity: res.parity,
x: NBuffer.from(res.xOnlyPubkey),
};
}` In bitcoinjs I found this function for tweaking. And this resource can explain tweak operation in more detail. And about your last response, are you sure you created a correct key-path spend n-n MuSig wallet?
Do you have the same scenario? |
@leo42 @IvanKodak
Let me know if this helps you or if you have any questions |
Could someone help me please.
I want to create a taproot MuSig wallet with an n-n scheme and make a payment from this wallet. And I have a few questions:
Thanks a lot for a response
The text was updated successfully, but these errors were encountered: