You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is a bug or I'm missing something.
I'm attempting to generate the same addresses as a multisig Electrum wallet using this library. When I enter the public keys into coinb.in of each address generated in Electrum, I get the same address as the one in Electrum, as long as I lexicographically order the public keys.
Using this library, I am not able to generate the same addresses. Here's the script I'm using:
require"btcruby"# For context, not actually used in the script below.cosigners=[{electrum_seed: "hotel congress unable service silver wool fabric ski buffalo orbit damp enjoy",master_public_key: "xpub661MyMwAqRbcGHY2QrfyiUyvSv93zCQN8Cv3eXFB3ivnq7SQ6TLUJueJnGZKR8r8CQ5cLsGrr9D71uwAW9RLKqFyUybARtbbqg1kiHopBsZ",},{electrum_seed: "trust diary skull hidden album awesome lady zoo polar gorilla alley credit",master_public_key: "xpub6D4K8Hb6sMZwwtbk6p94RnRewTb6PykJc1zZwB3GUozGSNXLnTdL2T8uXRehiD9d5Dis3bDpJCvR3pFZcYUu2xpPj5Z73oFNUUQKwkFTewo",},]# Copied from electrum 1-of-2 multisig wallet using the keys above. public_keys order is as shown in the address' "details" window of Electrum.addresses={0=>{address: "3GbE5Hn5NNfAbkk33AquoZqtoehkDDBEZn",public_keys: ["02c71e2fd1793943296f2c708ee44d0c7df113b3d9f6808180801835d510beb794","036822f8013573775f7cb0c9aa1cbf7fba9b59480af59415685328a334b5f5c369",],redeem_script: "512102c71e2fd1793943296f2c708ee44d0c7df113b3d9f6808180801835d510beb79421036822f8013573775f7cb0c9aa1cbf7fba9b59480af59415685328a334b5f5c36952ae",},4=>{address: "35gx2GzbtVy116Ai2kop8u95xWVHYfFPne",public_keys: ["03b064e3adf933622eff9b33e7dbc881e1bc9ec3030f96bf0ddd53cabd862adf7c","0228f4d23588f5dd93ad64c1d1502f43c779e9d3811fcbe8af5f54faf585f68ece",],redeem_script: "51210228f4d23588f5dd93ad64c1d1502f43c779e9d3811fcbe8af5f54faf585f68ece2103b064e3adf933622eff9b33e7dbc881e1bc9ec3030f96bf0ddd53cabd862adf7c52ae",},9=>{address: "3C1KyYDMg8woFnZZXqfmkdvUEJuLMuajCV",public_keys: ["03b84384cd966c8554ddc2303101fd416f5b4f260161c788d6c62d6c6d293b4880","0336e728be1b9370565204b5de4050d418704cc9c5c2db47f13be30173f7f5bd46",],redeem_script: "51210336e728be1b9370565204b5de4050d418704cc9c5c2db47f13be30173f7f5bd462103b84384cd966c8554ddc2303101fd416f5b4f260161c788d6c62d6c6d293b488052ae",},}addresses.eachdo |idx,addr_details|
public_keys=addr_details[:public_keys].sortmultisig_script=BTC::Script.multisig(public_keys: public_keys,signatures_required: 1)p2sh_script=multisig_script.p2sh_scriptgenerated_addr=p2sh_script.standard_address.to_sifgenerated_addr == addr_details[:address]puts"YES MATCH:"puts"We generated the same one for address #{idx}: #{addr_details}"elseputs"NO MATCH:"puts" - Generated address from lexicographically ordered keys: #{generated_addr}"puts" - Expected address: #{addr_details[:address]}"endendputs"Done"
Not sure if this is a bug or I'm missing something.
I'm attempting to generate the same addresses as a multisig Electrum wallet using this library. When I enter the public keys into coinb.in of each address generated in Electrum, I get the same address as the one in Electrum, as long as I lexicographically order the public keys.
Using this library, I am not able to generate the same addresses. Here's the script I'm using:
Links to coinbin:
The text was updated successfully, but these errors were encountered: