Search content
Sort by

Showing 20 of 24 results by barno
Post
Topic
Board Discussioni avanzate e sviluppo
Re: Raccolta fonti di codice sorgenti legati al Bitcoin e crittovalute
by
barno
on 28/12/2020, 10:33:04 UTC
un ottimo debug per Bitcoin Script: https://github.com/kallewoof/btcdeb
Post
Topic
Board Bitcoin Technical Support
Re: Generate P2WSH - redeemScript does not correspond to witnessScript
by
barno
on 14/04/2020, 06:52:55 UTC
Yes I saw the PR!
I thought that another example should be interest to understand the bug  Wink

Post
Topic
Board Bitcoin Technical Support
Re: Generate P2WSH - redeemScript does not correspond to witnessScript
by
barno
on 13/04/2020, 21:24:36 UTC
I create another script P2SH-P2WSH wrap P2PK and I get the same error.
Post
Topic
Board Bitcoin Technical Support
Re: Generate P2WSH - redeemScript does not correspond to witnessScript
by
barno
on 01/04/2020, 15:39:55 UTC
It looks like you've run into a bug in Bitcoin Core

Specifically, for historical reasons, Bitcoin Core will sometimes automatically convert P2PKH scripts into P2WPKH outputs when doing segwit stuff. So what happened is that when it checks whether the redeemScript matches the witnessScript, it mistakenly computes the P2WPKH script for your P2PKH witnessScript instead of the P2WSH script that you are expecting. This causes a mismatch and the error.

You could try omitting the redeemScript field from your call to signrawtransactionwithkey but it may fail to sign then.

I've opened a PR to fix this.

Thanks for reply.
I tried to omit the redeem script
Code:
$ bitcoin-cli signrawtransactionwithkey $TX_DATA '["'$PK'"]' '[{"txid":"'$TXID'","vout":'$VOUT',"scriptPubKey":"'$SCRIPTPUBKEY'","witnessScript":"'$WITNESSCRIPT'","amount":"'$TOTAL_UTXO_AMOUNT'"}]'
error code: -8
error message:
redeemScript/witnessScript does not match scriptPubKey

But I get the same error
Post
Topic
Board Bitcoin Technical Support
Merits 31 from 7 users
Topic OP
Generate P2WSH - redeemScript does not correspond to witnessScript
by
barno
on 31/03/2020, 14:39:51 UTC
⭐ Merited by LoyceV (12) ,ETFbitcoin (6) ,malevolent (5) ,nc50lc (2) ,bones261 (2) ,Heisenberg_Hunter (2) ,o_e_l_e_o (2)
I want to generate P2WSH to study it. I read the spec https://bitcoincore.org/en/segwit_wallet_dev/#creation-of-p2sh-p2wsh-address but I have an error during spend it. (redeemScript does not correspond to witnessScript)

I create a bash script to generate private and public key, and I will report only the part to create redeem script etc.

Witness script
Code:
SCRIPT="76a9"$PBLENGTH$PBH"88AC"
printf $SCRIPT > witness_script.txt
> result: 76a9147ee744d9b09a4042c45f5f33d259d12855bd250188AC

Create Script Hash, use sha256 once
Code:
ADDR_SHA=`printf $SCRIPT | xxd -r -p | openssl sha256| sed 's/^.* //'`
printf $ADDR_SHA > scripthash.txt
> result: 8f80f8328dac332d68d545b5187c6142467ca541f1b108e152d66c7965573a41

Create redeem script  (i.e. 0x0020{32-byte scripthash})
Code:
REDEEMSCRIPT="0020"$ADDR_SHA
printf $REDEEMSCRIPT > redeem_script.txt
> result: 00208f80f8328dac332d68d545b5187c6142467ca541f1b108e152d66c7965573a41

Create SCRIPTPUBKEY (OP_HASH160 hash160(redeemScript) OP_EQUAL) where hash160 is Sha256 and ripemd160
Code:
  ADDR_160=$(printf $(printf $REDEEMSCRIPT | xxd -r -p | openssl sha256| sed 's/^.* //') | xxd -r -p | openssl ripemd160 | sed 's/^.* //')
  SCRIPTPUBKEY="A914"$ADDR_160"87"
  printf $SCRIPTPUBKEY > scriptPubKey.txt
> result: A9147ed644ee46780f7dc74a191368866a7b0e49cf9d87

Create Address (regtest, prefix is C4)
Code:
  ADDR=`printf $VERSION_PREFIX_ADDRESS$ADDR_160 | xxd -p -r | base58 -c`
  printf $ADDR > address_p2sh-p2wsh.txt
> result: 2N4osp9J5PywDDvSuTqN3vxxiQZ25jQo4fY

Then I create a transaction from this address to anther address. I have 50 bitcoin available.
Code:

REDEEMSCRIPT=`cat redeem_script.txt`
SCRIPTPUBKEY=`cat scriptPubKey.txt`
WITNESSCRIPT=`cat witness_script.txt`

TX_DATA=$(bitcoin-cli createrawtransaction '[{"txid":"'$TXID'","vout":'$VOUT'}]' '[{"'$ADDR_DEST'":'$AMOUNT'}]')

TX_SIGNED=$(bitcoin-cli signrawtransactionwithkey $TX_DATA '["'$PK'"]' '[{"txid":"'$TXID'","vout":'$VOUT',"scriptPubKey":"'$SCRIPTPUBKEY'","redeemScript":"'$REDEEMSCRIPT'","witnessScript":"'$WITNESSCRIPT'","amount":"'$TOTAL_UTXO_AMOUNT'"}]'  | jq -r '.hex')

At that moment I have this error
redeemScript does not correspond to witnessScript
Post
Topic
Board Crittografia e decentralizzazione
Re: Che cos'è PGP?
by
barno
on 13/03/2020, 14:32:32 UTC
Post
Topic
Board Bitcoin Technical Support
Re: Get private_key.pem from WIF format
by
barno
on 08/03/2020, 11:32:58 UTC
Amazing dex1, it works!
Can you explain
Code:
PRE_STRING=302e0201010420
secp256k1_ID=a00706052b8104000a
I searched more details but I don't find good resources
Post
Topic
Board Bitcoin Technical Support
Topic OP
Get private_key.pem from WIF format
by
barno
on 06/03/2020, 16:09:55 UTC
I want to retrieve my private_key.pem format in order to sign my transaction

For example, I create P2SH address
Code:
$ ADDR_DEST_1=`bitcoin-cli getnewaddress`            
$ echo $ADDR_DEST_1
2MzdMAQKoPr2x7Bzm6tpGpDPnvWmsL9AjQA

I can Get Private key WIF
Code:
$ bitcoin-cli dumpprivkey $ADDR_DEST_1
cP73T5gHo6Wnyco11T2fsxocZqsQE6hwPG9UG1vcupMZh4iLyH19

Now I can do base58 decode
Code:
$ printf cP73T5gHo6Wnyco11T2fsxocZqsQE6hwPG9UG1vcupMZh4iLyH19 | base58 -d | xxd -p -c 76    
ef2d7238106df87d7b70f9d7cc4ff833ff9fad86aa5e50f8cf42689c238d70f72301c597c498

ef  is version prefix for testnet/regtest
01 compression flag
c597c498 should be the checksum.

Then My key is: 2d7238106df87d7b70f9d7cc4ff833ff9fad86aa5e50f8cf42689c238d70f723

Now I need to get private key pem.
Then I tried with

Code:
echo 2d7238106df87d7b70f9d7cc4ff833ff9fad86aa5e50f8cf42689c238d70f723 > btc_priv.key

$ openssl ec -noout -text -inform DER -in foo_priv.key
read EC key
unable to load Key

$ openssl x509 -in btc_priv.key -inform DER -outform PEM
unable to load certificate
4486393452:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1220:
4486393452:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:386:Type=X509

$ cat btc_priv.key | xxd -r -p  > test.bin  
$ openssl ec -in test.bin -inform DER -pubin -text -noout                
read EC key
unable to load Key
4456304236:error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data:a_d2i_fp.c:247:

I searched in https://github.com/bitcoin/bitcoin/blob/452bb90c718da18a79bfad50ff9b7d1c8f1b4aa3/src/secp256k1/contrib/lax_der_privatekey_parsing.c and https://github.com/bitcoin/bitcoin/blob/99813a9745fe10a58bedd7a4cb721faf14f907a4/src/rest.cpp But I don't understand Sad
Post
Topic
Board Bitcoin Technical Support
Merits 6 from 4 users
Re: Sign Transaction Bitcoin with Openssl
by
barno
on 03/03/2020, 21:50:31 UTC
⭐ Merited by joniboini (2) ,ABCbits (2) ,BrewMaster (1) ,Heisenberg_Hunter (1)
Ok I'm back! Smiley

The problem is
Code:
openssl dgst -sha256 -hex -sign chiave_priv_3.pem a.txt
In that way I do another SHA256! I did SHA256 3 times!  Shocked

To resolve this issue, I can do something like
Code:
$ openssl pkeyutl -inkey chiave_priv_3.pem -sign -in a.txt -pkeyopt digest:sha256 | xxd -p -c 256
or I can do single SHA256 and apply another SHA256 with openssl
Code:
$ printf 0200000001e2a8148889a8ec60fd9d28564ed8996bf7ffd6b11388ed9c044d2c250088d83b000000001976a914d2bb7890f3f6356d89673367b44e9a7d0265009188acffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac0000000001000000 | xxd -r -p | sha256sum -b | xxd -r -p > a.txt
$ openssl dgst -sha256 -hex -sign chiave_priv_3.pem a.txt

I prefer the first solution!

About "mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high) (code 16)" it's more complicated than that.
I converted the S (DER signature) to base10. (it's another signature, not the same of thread, sorry but I have my notes)
For example:
Code:
$ s=`echo "ibase=16; $(printf 00f00e64e164ce4fee984165ba8205a8544ece37458006687cdaa53d4e6e1859bc  | tr '[:lower:]' '[:upper:]')" | bc |  tr -d '\n' | tr -d '\' | awk '{print $1}'`
$ echo $s
108580515770129610852831425129233053758690240817412348750872366071983533218236

Then convert N to base 10, and get N/2
Code:
$ N=`echo "ibase=16;FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141" | bc  |  tr -d '\n' | tr -d '\' | awk '{print $1}'`
$ echo $N
108580515770129610852831425129233053758690240817412348750872366071983533218236

$ N2=`echo "$N/2" | bc |  tr -d '\n' | tr -d '\' | awk '{print $1}'`
$ echo $N2
57896044618658097711785492504343953926418782139537452191302581570759080747168

You can find very cool stuffs if u search 108580515770129610852831425129233053758690240817412348750872366071983533218236 or 57896044618658097711785492504343953926418782139537452191302581570759080747168 in google

Now I Check if s is greater than N/2, if it is I need to subtract it. (N-S)
Code:
$ s=`echo "$N - $s" | bc |  tr -d '\n' | tr -d '\' | awk '{print $1}'`  
$ echo $s
7211573467186584570739559879454854094147323461662555631732797069534628276101

Convert the result to base16
Code:
$ s=`echo "obase=16;$s" | bc`
$ echo $s
E2412F237BCDCA1AD1AD7DA1075D8C0AD258A07066D695F99DEA0AAEC7034A4

Sometimes you can get odd bytes, in that case I have 63 hex.
Code:
$ printf FF19B1E9B31B01167BE9A457DFA57AA6BE0A5A12F4237BEE52D213E621DE785 | wc -c
  63
It's very similar when you get seed phrase, if you don't have a block of 11 bits, you need to add some "padding", then I add 0 at the beginning.

Code:
s=0FF19B1E9B31B01167BE9A457DFA57AA6BE0A5A12F4237BEE52D213E621DE785

Now I can make a "new" DER signature, replace the old s with the new one, calculate the length of it and the length of signature!
And it works! Smiley
I hope to help someone!
Thanks to Andrew Chow and BrewMaster for your time guys
(English is not my mother tongue; please excuse any errors on my part)


Post
Topic
Board Bitcoin Technical Support
Re: Sign Transaction Bitcoin with Openssl
by
barno
on 25/02/2020, 15:25:14 UTC
Thanks for your reply, I saw that links about that issue "mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high) (code 16)".

https://github.com/bitcoin-core/secp256k1/blob/544435fc90a5672d862e2a51f44c10251893b97d/src/ecdsa_impl.h#L310-L315

Do you know If I can check S before signature or If I can do that function 
Code:
if (S > N/2) then S = N - S
in bash without use external library?

thanks
Post
Topic
Board Bitcoin Technical Support
Re: Sign Transaction Bitcoin with Openssl
by
barno
on 17/02/2020, 11:56:05 UTC
Thanks again.
I created a script to replicate my goal.
I change public key uncompressed with compressed.

Sometimes I get that error:
mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high) (code 16)
It's the issue that you explain in the last post.

and sometimes I get that error:
mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)
Post
Topic
Board Bitcoin Technical Support
Merits 1 from 1 user
Re: Sign Transaction Bitcoin with Openssl
by
barno
on 17/02/2020, 10:51:54 UTC
⭐ Merited by o_e_l_e_o (1)
Thanks for reply.

I followed the steps but I have some issues.

Paste the new parts here, public keys and private keys are the same.
My enviroment is regtest.

this is my UTXO
Code:
  {
   {
    "txid": "3bd88800252c4d049ced8813b1d6fff76b99d84e56289dfd60eca8898814a8e2",
    "vout": 0,
    "address": "mzjCn3ojXBGWcRjWYfJdNdrM9yr5UbpXgq",
    "label": "",
    "scriptPubKey": "76a914d2bb7890f3f6356d89673367b44e9a7d0265009188ac",
    "amount": 49.99900000,
    "confirmations": 6,
    "spendable": true,
    "solvable": true,
    "desc": "pkh([d2bb7890]03d6e5ff918b8388dc49cdfc115ddc1ea9fd4d884dd8b87ef6602a6bd07b5c1748)#67xu85z0",
    "safe": true
  },


there are my parameters for my transaction:
Code:
TXID=3bd88800252c4d049ced8813b1d6fff76b99d84e56289dfd60eca8898814a8e2
VOUT=0
AMOUNT=49.998
ADDR_MITT=msPjuNgbmbRSkNGJPvquKJRRmrbzS96s62

Now create my transaction data
Code:
$ bitcoin-cli createrawtransaction '[{"txid":"'$TXID'","vout":'$VOUT'}]' '[{"'$ADDR_MITT'":'$AMOUNT'}]'
0200000001e2a8148889a8ec60fd9d28564ed8996bf7ffd6b11388ed9c044d2c250088d83b0000000000ffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac00000000

Now I put the scriptPubKey and SigHash.
Code:
0200000001e2a8148889a8ec60fd9d28564ed8996bf7ffd6b11388ed9c044d2c250088d83b000000001976a914d2bb7890f3f6356d89673367b44e9a7d0265009188acffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac0000000001000000

(I tried even with ScriptPub of previous transaction. The UTXO of 3bd88800252c4d049ced8813b1d6fff76b99d84e56289dfd60eca8898814a8e2.)

Double SHA256
Code:
printf 0200000001e2a8148889a8ec60fd9d28564ed8996bf7ffd6b11388ed9c044d2c250088d83b000000001976a914d2bb7890f3f6356d89673367b44e9a7d0265009188acffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac0000000001000000 | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b > a.txt

Code:
result:
f1f941f66a7bd080f14506ff91a05bd3d525dae236a4d86bac5dfa6e3bce4563

Signature
Code:
openssl dgst -sha256 -hex -sign chiave_priv_3.pem a.txt
EC-SHA256(a.txt)= 30450220120a27e6e275545d4b1c79d4fad40a5d6dc9d44f512a00d5b2b71b68e5e4d376022100bf6284c39500565c089efec95db1d82869882a08b30513a3de0287ff223b834f

add 01 at the end.
Code:
30450220120a27e6e275545d4b1c79d4fad40a5d6dc9d44f512a00d5b2b71b68e5e4d376022100bf6284c39500565c089efec95db1d82869882a08b30513a3de0287ff223b834f01

48 is the signature Length.

Public key not compressed is
Code:
04d6e5ff918b8388dc49cdfc115ddc1ea9fd4d884dd8b87ef6602a6bd07b5c1748321ac6d22737633f56538a28158d2558ca09407d9f6cc221c54b873e4cb9b999

41 is the public key length.

Signature+public key is 278 char => 8B

The whole transaction is
Code:
0200000001e2a8148889a8ec60fd9d28564ed8996bf7ffd6b11388ed9c044d2c250088d83b000000008B4830450220120a27e6e275545d4b1c79d4fad40a5d6dc9d44f512a00d5b2b71b68e5e4d376022100bf6284c39500565c089efec95db1d82869882a08b30513a3de0287ff223b834f014104d6e5ff918b8388dc49cdfc115ddc1ea9fd4d884dd8b87ef6602a6bd07b5c1748321ac6d22737633f56538a28158d2558ca09407d9f6cc221c54b873e4cb9b999ffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac00000000

Code:
$ bitcoin-cli sendrawtransaction 0200000001e2a8148889a8ec60fd9d28564ed8996bf7ffd6b11388ed9c044d2c250088d83b000000008B4830450220120a27e6e275545d4b1c79d4fad40a5d6dc9d44f512a00d5b2b71b68e5e4d376022100bf6284c39500565c089efec95db1d82869882a08b30513a3de0287ff223b834f014104d6e5ff918b8388dc49cdfc115ddc1ea9fd4d884dd8b87ef6602a6bd07b5c1748321ac6d22737633f56538a28158d2558ca09407d9f6cc221c54b873e4cb9b999ffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac00000000
error code: -26
error message:
mandatory-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation) (code 16)

Code:
$ bitcoin-cli decoderawtransaction 0200000001e2a8148889a8ec60fd9d28564ed8996bf7ffd6b11388ed9c044d2c250088d83b000000008B4830450220120a27e6e275545d4b1c79d4fad40a5d6dc9d44f512a00d5b2b71b68e5e4d376022100bf6284c39500565c089efec95db1d82869882a08b30513a3de0287ff223b834f014104d6e5ff918b8388dc49cdfc115ddc1ea9fd4d884dd8b87ef6602a6bd07b5c1748321ac6d22737633f56538a28158d2558ca09407d9f6cc221c54b873e4cb9b999ffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac00000000
{
  "txid": "0101c9603426d1476d813617bc9af7c83eb62d1efec973c096ba55ad74c3501b",
  "hash": "0101c9603426d1476d813617bc9af7c83eb62d1efec973c096ba55ad74c3501b",
  "version": 2,
  "size": 224,
  "vsize": 224,
  "weight": 896,
  "locktime": 0,
  "vin": [
    {
      "txid": "3bd88800252c4d049ced8813b1d6fff76b99d84e56289dfd60eca8898814a8e2",
      "vout": 0,
      "scriptSig": {
        "asm": "30450220120a27e6e275545d4b1c79d4fad40a5d6dc9d44f512a00d5b2b71b68e5e4d376022100bf6284c39500565c089efec95db1d82869882a08b30513a3de0287ff223b834f[ALL] 04d6e5ff918b8388dc49cdfc115ddc1ea9fd4d884dd8b87ef6602a6bd07b5c1748321ac6d22737633f56538a28158d2558ca09407d9f6cc221c54b873e4cb9b999",
        "hex": "4830450220120a27e6e275545d4b1c79d4fad40a5d6dc9d44f512a00d5b2b71b68e5e4d376022100bf6284c39500565c089efec95db1d82869882a08b30513a3de0287ff223b834f014104d6e5ff918b8388dc49cdfc115ddc1ea9fd4d884dd8b87ef6602a6bd07b5c1748321ac6d22737633f56538a28158d2558ca09407d9f6cc221c54b873e4cb9b999"
      },
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 49.99800000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 824441111b374bec1952a5b3fa9dd4e3ed679b38 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "msPjuNgbmbRSkNGJPvquKJRRmrbzS96s62"
        ]
      }
    }
  ]
}


Post
Topic
Board Bitcoin Technical Support
Merits 18 from 8 users
Topic OP
Sign Transaction Bitcoin with Openssl
by
barno
on 16/02/2020, 11:11:46 UTC
⭐ Merited by suchmoon (7) ,bones261 (3) ,joniboini (2) ,OgNasty (2) ,mocacinno (1) ,Heisenberg_Hunter (1) ,ETFbitcoin (1) ,o_e_l_e_o (1)
I created Legacy address in testnet enviroment.
Code:
    $ openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out chiave_priv.pem
    -----BEGIN EC PARAMETERS-----
    BgUrgQQACg==
    -----END EC PARAMETERS-----
    -----BEGIN EC PRIVATE KEY-----
    MHQCAQEEIIec9IrjQkpFhCAqMMNHQuU/6X7+DDH7p/TPr2on9j+XoAcGBSuBBAAK
    oUQDQgAEJNcNWmojf5IU23BoNL6mG1VLcV08UAqXp/YrE6AbMkaVj05xJJCPg2FN
    wu/j5c/5zp6GoBla+XuYagwHl0VwAQ==
    -----END EC PRIVATE KEY-----

    $ openssl ec -in chiave_priv.pem -outform DER|tail -c +8|head -c 32 |xxd -p -c 32 > btc_priv.key
    879cf48ae3424a4584202a30c34742e53fe97efe0c31fba7f4cfaf6a27f63f97

It's my private key WIF
Code:
    cS8KGbfbAxW6DLWvDQAfR4ZPXC2yJVXa7Qj4gYrFZNNGcWtbyPJ6

it is my compressed public key
Code:
    0324d70d5a6a237f9214db706834bea61b554b715d3c500a97a7f62b13a01b3246

it's my transaction data that I want to sign with my private key
Code:
    0200000001bc010c04e1c44a991760fa1cb7af1076bf755077d1cba60d3d4ca3f0de670d210000000000ffffffff01c0aff629010000001976a914f6b61a355d427c892e51bdb261d4f56c4e93b16f88ac00000000

I know that I have to do double sha256
Code:
    $ printf 0200000001bc010c04e1c44a991760fa1cb7af1076bf755077d1cba60d3d4ca3f0de670d210000000000ffffffff01c0aff629010000001976a914f6b61a355d427c892e51bdb261d4f56c4e93b16f88ac00000000 | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b > a.txt

Now Sign it (maybe here the error?)
Code:
    $ openssl dgst -sha256 -hex -sign chiave_priv.pem a.txt 
    EC-SHA256(a.txt)= 30440220113f4da0dab33c850b13c3f8e8239acdb9d474808d9c65e91a9304c4573ac3fc0220514df1aaf115535de6e3a7da19011b416b84bd2ec8737958d2d97c6eed6985f7

Create ScriptSig

 - 6A ScriptSig length => 212 char hex
 - 47 Signature Length+SIGHHASH => 142 char hex
 - < signature > 01
 - 01 => SIGHASH_ALL
 - 21 Public key length => 66 char hex
 - < public key >

Below you can find the whole transaction data
Code:
0200000001bc010c04e1c44a991760fa1cb7af1076bf755077d1cba60d3d4ca3f0de670d21000000006A4730440220113f4da0dab33c850b13c3f8e8239acdb9d474808d9c65e91a9304c4573ac3fc0220514df1aaf115535de6e3a7da19011b416b84bd2ec8737958d2d97c6eed6985f701210324d70d5a6a237f9214db706834bea61b554b715d3c500a97a7f62b13a01b3246ffffffff01c0aff629010000001976a914f6b61a355d427c892e51bdb261d4f56c4e93b16f88ac00000000

When I try to sentransaction, I get a error
Code:
    $ bitcoin-cli sendrawtransaction 0200000001bc010c04e1c44a991760fa1cb7af1076bf755077d1cba60d3d4ca3f0de670d21000000006A4730440220113f4da0dab33c850b13c3f8e8239acdb9d474808d9c65e91a9304c4573ac3fc0220514df1aaf115535de6e3a7da19011b416b84bd2ec8737958d2d97c6eed6985f701210324d70d5a6a237f9214db706834bea61b554b715d3c500a97a7f62b13a01b3246ffffffff01c0aff629010000001976a914f6b61a355d427c892e51bdb261d4f56c4e93b16f88ac00000000
        error code: -26
        error message:
        mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)

Decoderawtransaction:
Code:
bitcoin-cli decoderawtransaction 0200000001bc010c04e1c44a991760fa1cb7af1076bf755077d1cba60d3d4ca3f0de670d21000000006A4730440220113f4da0dab33c850b13c3f8e8239acdb9d474808d9c65e91a9304c4573ac3fc0220514df1aaf115535de6e3a7da19011b416b84bd2ec8737958d2d97c6eed6985f701210324d70d5a6a237f9214db706834bea61b554b715d3c500a97a7f62b13a01b3246ffffffff01c0aff629010000001976a914f6b61a355d427c892e51bdb261d4f56c4e93b16f88ac00000000
    {
      "txid": "3f360942dca166a75397cbc3f481771bea8f1c2b0c79313b034fb067882b3b36",
      "hash": "3f360942dca166a75397cbc3f481771bea8f1c2b0c79313b034fb067882b3b36",
      "version": 2,
      "size": 191,
      "vsize": 191,
      "weight": 764,
      "locktime": 0,
      "vin": [
        {
          "txid": "210d67def0a34c3d0da6cbd1775075bf7610afb71cfa6017994ac4e1040c01bc",
          "vout": 0,
          "scriptSig": {
            "asm": "30440220113f4da0dab33c850b13c3f8e8239acdb9d474808d9c65e91a9304c4573ac3fc0220514df1aaf115535de6e3a7da19011b416b84bd2ec8737958d2d97c6eed6985f7[ALL] 0324d70d5a6a237f9214db706834bea61b554b715d3c500a97a7f62b13a01b3246",
            "hex": "4730440220113f4da0dab33c850b13c3f8e8239acdb9d474808d9c65e91a9304c4573ac3fc0220514df1aaf115535de6e3a7da19011b416b84bd2ec8737958d2d97c6eed6985f701210324d70d5a6a237f9214db706834bea61b554b715d3c500a97a7f62b13a01b3246"
          },
          "sequence": 4294967295
        }
      ],
      "vout": [
        {
          "value": 49.99000000,
          "n": 0,
          "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 f6b61a355d427c892e51bdb261d4f56c4e93b16f OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "76a914f6b61a355d427c892e51bdb261d4f56c4e93b16f88ac",
            "reqSigs": 1,
            "type": "pubkeyhash",
            "addresses": [
              "n41SfwRvQD7tXJsbZsEcDWKFQ7DLYi3P7i"
            ]
          }
        }
      ]
    }
Post
Topic
Board Tokens (Altcoins)
Re: [ANN]🌎Bitminer Factory : BLOCKCHAIN MADE SUSTAINABLE🌎
by
barno
on 17/08/2018, 11:56:35 UTC
Bitminer Factory company offers to install the Dashboard app for your smartphone to mine with It

no, it's not true. Bitminer Factory Offers Mining Contract Where you can earn with mining
Post
Topic
Board Tokens (Altcoins)
Re: [ANN]🌎Bitminer Factory : BLOCKCHAIN MADE SUSTAINABLE🌎
by
barno
on 17/08/2018, 11:50:17 UTC
I can get discount for buy tokens after 20th September? Answer please

At the moment No, the last discount expire on 20th September
Post
Topic
Board Alt-Currencies (Italiano)
Airdrop condivisione REF
by
barno
on 21/02/2018, 10:38:05 UTC
Ciao a tutti,
esiste un canale per condividere il proprio ref ?
Io ho fatto un canale per farlo https://t.me/joinchat/CiQOCg6_FokssBcNlb_flg
non so se ne esiste già uno.
Amici di airdrop avevano vietato il ref
Grazie
Ciao
Post
Topic
Board Bounties (Altcoins)
Re: 💰💰[ANN][PreSale]G-global - official bounty 💰💰up to $1 000 000 to share💰💰
by
barno
on 19/02/2018, 11:50:46 UTC
Post
Topic
Board Bounties (Altcoins)
Re: ⭐️[Airdrop] SIGLO - Future of Mobile Connectivity.JOIN TELEGRAM,EARN REWARD⭐️
by
barno
on 10/02/2018, 21:14:13 UTC
Bitcointalk Username:  barno
Bitcointalk Profile:       https://bitcointalk.org/index.php?action=profile;u=1584891
Post
Topic
Board Bounties (Altcoins)
Re: [Airdrop] LegacyLotto
by
barno
on 08/02/2018, 15:06:56 UTC
1) Twitter account link : https://twitter.com/barno7
2) Telegram account: barno7_Red_Army_member
3) Link to your post with : https://bitcointalk.org/index.php?topic=2851932.msg29866022#msg29866022
4) ETH wallet: 0x34D09cdd03727F744C2b7BF4066f1e752A8233e0


Post
Topic
Board Tokens (Altcoins)
Re: [ANN][ICO] LegacyLotto | World’s first ticket mining blockchain lottery.
by
barno
on 08/02/2018, 14:52:42 UTC
Very very nice project! the whitepaper (https://static1.squarespace.com/static/5a39e108aeb6254304496341/t/5a69dc9f41920243676c6409/1516887201401/WHITE+PAPER.pdf) is very nice and clear, even the video is so nice!