0

I am building a service that is based on multisig wallets. My current progress is so that I've implemented the multisigs for Bitcoin network and it works fine. Now I am on Litecoin and I am facing some issues and would appreciate any help or guidance on that.

Disclaimer: This may be related to how Electrum-LTC works, I am not sure. I am happy to hear experts oppinion on that.

On Bitcoin network your multisig wallet is composed of 3 parts:

ScriptSig
  Signatures
  0 <Sig1> <Sig2> ... <SigM>

  Redeem script
  M <PubKey1> <PubKey2> ... <PubKeyN> N OP_CHECKMULTISIG

ScriptPubKey
  OP_HASH160 <Redeem script hash> OP_EQUAL

And that works just fine with my implementation. I can generate 2-of-2 multisig with Electrum (btc) and sign it with both keys, both with my code and with Electrum wallets. Outcome transaction in both cases is correct and accepted by network.

Now, for Litecoin I am using Electrum-ltc and the process is exactly the same. I can successfully generate multisig address on Litecoin

Suppose I Have following  Redeem script
  2 028c895128a8113bb5d599b4f463df685220ba726fc664013b3df56cb0bae74dc4 02c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf435 2 OP_CHECKMULTISIG

The address I see in Electrum-ltc matches the one I generated myself which tells me I am on the right way.

However, when I sing a transaction with wallet a redeem script in the transaction hex looks totally different and does not match my manually generated redeem script

Manually generated redeem script
5221028c895128a8113bb5d599b4f463df685220ba726fc664013b3df56cb0bae74dc42102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf43552ae

broken apart
52 - OP_2
21028c895128a8113bb5d599b4f463df685220ba726fc664013b3df56cb0bae74dc4 - PubKey1
2102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf435 - PubKey2
52 - OP_2
ae - OP_CHECKMULTISIG

And here is a redeem script that I get from Electrum-ltc once I signed transaction with one key

524c53ff0488b21e0000000000000000006a88a8afff7c30e2adc4ebee877e842b7868f11c6fafe5635fecd85337366bd802f8ecc3fc0be1c7b7d7bf4968df349845ede9dd6044beb0bcf25145612fa3b4e4000000002102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf43552ae

broken apart
52 - OP_2
4c53ff0488b21e0000000000000000006a88a8afff7c30e2adc4ebee877e842b7868f11c6fafe5635fecd85337366bd802f8ecc3fc0be1c7b7d7bf4968df349845ede9dd6044beb0bcf25145612fa3b4e4000000002102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf435
52 - OP_2
ae - OP_CHECKMULTISIG

So, what this thing the middle? And why it does not match my redeem script? Is this a bug with Electrum-ltc or I am missing something. Would appreciate any feedback.

0

If you signed your Bitcoin transaction with only one key, you would see the same behavior.

What you are observing is how Electrum handles partially signed transactions. It does not produce the correct scripts until the transaction is fully signed. What you see as the public key in your transaction is just how Electrum internally represents public keys.

  • It is not, as redeem script is the same regardless, whether you signed transaction or not. Electrum for bitcoin works as expected. Electrum for litecoin does not and I wonder wither this is bug or protocol difference – Max Feb 19 at 16:31
  • Then this is an issue with Electrum. Litecoin works pretty much in the same way Bitcoin does. The script and UTXO systems are identical. Also keep in mind that Electrum-ltc may not be up to date with Electrum. At some point in time, IIRC Electrum itself exhibited this behavior. – Andrew Chow Feb 19 at 17:18
  • Can you recommend any GUI based Litecoin wallet that support multi signatures? – Max Feb 20 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.