I am trying to figure out how to produce a valid signed transaction to consume BTC from a multisig address.
1) First let’s look into producing a signature for an UTXO associated to a regular address:
Assume we are creating a transaction to consume a single UTXO, output 0 of transaction
1111111111111111111111111111111111111111111111111111111111111111 (hex), depositing 1 BTC to address
147Us9aEq2PvBC5wobBJw1yEpQEbPKzssA, for which the HASH160 is
This would be the raw transaction before signing, formatted for readability:
01000000 01 1111111111111111111111111111111111111111111111111111111111111111 00000000 00 ffffffff 01 00e1f50500000000 19 76 a9 14 2222222222222222222222222222222222222222 88 ac 00000000
Assume the UTXO is associated to the following key pair and regular address:
L2hYQuKeAUr4hLAdDspnwm4YCcFb222REdW34WsmonEeJP5Wp4qt 02d619bbd8166614b3c6cdb2833392a71793a1f531693e3a18e7ac3ccbdd161972 15Rrie5X6VgDRVwMvB63hKf8Uk5MBZEmbC
After signing the transaction with the private key above, we obtain ECDSA signature
304402205c2ce1a04b7eb882cf39bfff278b59b9c90ae8c98ce3911bd63b0909bd524df3022000dd5393fa0526ed2d30eff4102c8592c0502406adb0e5a925cd299f8eeb770d (hex) which, appended with SIGHASH_ALL byte
01 (hex), is then embedded in it using the Pay-to-PubkeyHash scriptSig for regular addresses: <sig> <pubKey>.
01000000 01 1111111111111111111111111111111111111111111111111111111111111111 00000000 6a 47 304402205c2ce1a04b7eb882cf39bfff278b59b9c90ae8c98ce3911bd63b0909bd524df3022000dd5393fa0526ed2d30eff4102c8592c0502406adb0e5a925cd299f8eeb770d 01 21 02d619bbd8166614b3c6cdb2833392a71793a1f531693e3a18e7ac3ccbdd161972 ffffffff 01 00e1f50500000000 19 76 a9 14 2222222222222222222222222222222222222222 88 ac 00000000
In order to produce this signature, we had to sign the following modified transaction:
01000000 01 1111111111111111111111111111111111111111111111111111111111111111 00000000 19 76 a9 14 3093fd17ee01616456cc3e8d792d8d03ec31e624 88 ac ffffffff 01 00e1f50500000000 19 76 a9 14 2222222222222222222222222222222222222222 88 ac 00000000 01000000
Basically we patched the raw transaction with the Pay-to-PubkeyHash scriptPubKey of the source UTXO: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG. We also appended the
3093fd17ee01616456cc3e8d792d8d03ec31e624 (hex) is the HASH160 of public key
To facilitate the replay calculation of the signature, the k used in the signing procedure was obtained deterministically according to RFC6979. Its value for this example is
2) Now, for the case where the UTXO is associated to a multisig address, we need to produce a different signed transaction:
We assume here a 1-of-2 multisig address.
The second key pair/address used is the following:
Kwc7zeCyVsemqAED2cpL138hKYRTcBQgaWYHLqAPARj3K2UwjPuK 0340f2f93487edb2ea49ffbdfc7de20481e54dae44420135fc6c6ea8262477fc9b 1DUDqhpJS7YHsQXuchWhPJUHr2DRnHYp6X
Therefore the derived multisig address is
The associated raw transaction is the same. However, the signed transaction should have a different structure as we need to patch it with a Pay-to-Script-Hash scriptSig:
01000000 01 1111111111111111111111111111111111111111111111111111111111111111 00000000 91 00 47 30xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 01 47 51 21 02d619bbd8166614b3c6cdb2833392a71793a1f531693e3a18e7ac3ccbdd161972 21 0340f2f93487edb2ea49ffbdfc7de20481e54dae44420135fc6c6ea8262477fc9b 52 ae ffffffff 01 00e1f50500000000 19 76 a9 14 2222222222222222222222222222222222222222 88 ac 00000000
I am trying to obtain the ECDSA signature
30xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx which computed using the first private key and its length in
xs here is not precise.
I tried to produce such signature using the raw transaction patched with the Pay-to-Script-Hash scriptPubKey OP_HASH160 <scriptHash> OP_EQUAL, but the resulting signature
304402201264c3a19e805ff976241c20897a2c702a5fa9a3882524317ef1444b0bfebdf502207bc45af98867c9366368f2be2d3a7335bd2681c4ad58ad38224b982029fda8e5 (hex) seems not to be valid.
Below is the above mentioned modified raw transaction. Note that
285071ecf3cce5e8eeb80aa289c3b7ba611cdd6d (hex) is the script HASH160 associated to the multisig address
01000000 01 1111111111111111111111111111111111111111111111111111111111111111 00000000 17 a9 14 285071ecf3cce5e8eeb80aa289c3b7ba611cdd6d 87 ffffffff 01 00e1f50500000000 19 76 a9 14 2222222222222222222222222222222222222222 88 ac 00000000 10000000
Again, to facilitate the replay calculation of the signature, the k used in the signing procedure was obtained deterministically according to RFC6979. Its value for this example is
TL;DR – How to patch the raw transaction of the example above in order to produce an ECDSA signature for the associated multisig UTXO? Can you also provide the a sample signed transaction and the k used in the signature calculation?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!