** Decoding Oshibcki « Inside the Bad Swide »: Handmade Bitcoin-Transaction
As a delay, the transaction with the use of Python, you, believed, looked up with the oscillate « bad ». This is the case that your transaction, in the part of the Multi-2 2, does not meet the strict non-standard treats of the bitcoins. In this state, we will subment myself that they call this problem, and implement the decrease for the construction of the current transaction.
NO -Standard Swideel
In the bitcoins, the « Swideel » is taken to the counter -attack or the inteling program, which runs the transaction. The non -standard aspect of the tie with the deer to the manifolds are recruited (then there are records of several signatures). In Bitcoin Core (BTC-QT) multi-signs are ogricted from the problem of the reliableness.
Problem: 2 Sur-2 Multisig Input
At the creation of multi-2 in 2 transaction, the entrance with two partial key. The first key (for example, 0x1234567890abc) is sustained by the departure, in that time as the second key (for example, 0x876543210987654321 ‘
If your transaction is Multi-2 Multi-2 does not keep up as a partly key, and their compatible signatures, you enlist the « AT-DEPTER ». This can be said to be a non -logical one, because the first key should be conscious for the transaction signature.
PRICH ASHIBKY
Topics of this problem can be varied in the exposure from your concrete servant. However, there is some kind of tufting walls that can be taken to this scoop:
1.
- unbelievable parting key : first closed key (
0x1234567890ABC is used for the transaction signature, but this is not true, to guarantee the entryness of the transaction.
Resolution
To solve this problem and build a transaction of Multi-2, the actual 2 from 2, the powder of the pursuit:
1.
- verify the signature
: Keep that the second closed key (for example,0x876543210987654321 ‘) will be confirmed that the first personality (
0x1234567890ABCDEF) will be confirmed.
3.
Primer code
Here's the primer that, as to send the "Diplinity" in the use ofSECP256K1 ‘in Python:
`Piton
Import SECP256K1

Generate partial keys (change your)
Key1 = secp256k1.evp_keygen ()
Key2 = Key1.generate_secret ()
tx_input = b '\ x01 \ x02'
Verify on Key2
Signature_Key2, Public_key2 = Key2
Signature = Signing_Key2.Sign (TX_INPUT)
Receive what signatures the first personality (use the renewed miles)
Imported Bitcoin
Swideel = Bitcoin.witeness (4, TX_INPUT)
Signedtx = sticle.Sign Bitcoins ()
If Inecdededtx.verify (TX_INPUT, KEY1):
Transaction is actual!
other:
Get Valueerror ("Non -Free Transaction")
` ‘
The trace of this step and the use of the bibliote Bitkinov, you are able to align the acting many-2 transaction 2 from 2. Do not forget to replace the data on the real information of transaction.
I hope that this hand was helpful to you and spread the « Diple Swidelings » of the Bitcoin-Transaction with Python!