Bitcoin Forum
May 05, 2024, 12:53:03 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: 1 2 3 [All]
  Print  
Author Topic: [WTB]Tutorial on how to make non-standard outputs  (Read 4587 times)
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 05, 2015, 08:08:45 PM
 #1

Hi I would like to buy a step by step tutorial on how to make OP_TRUE and OP_EQUAL(tx like this https://blockchain.info/tx/a4bfa8ab6435ae5f25dae9d89e4eb67dfa94283ca751f393c1ddc5a837bbc31b) non-standard outputs on bitcoind or bitcoinqt debug window(raw transaction).An example of how to make OP_RETURN tutorial https://bitcointalk.org/index.php?topic=453086.msg5302717#msg5302717

Will pay a little amount of 0.01BTC for it.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
1714870383
Hero Member
*
Offline Offline

Posts: 1714870383

View Profile Personal Message (Offline)

Ignore
1714870383
Reply with quote  #2

1714870383
Report to moderator
1714870383
Hero Member
*
Offline Offline

Posts: 1714870383

View Profile Personal Message (Offline)

Ignore
1714870383
Reply with quote  #2

1714870383
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714870383
Hero Member
*
Offline Offline

Posts: 1714870383

View Profile Personal Message (Offline)

Ignore
1714870383
Reply with quote  #2

1714870383
Report to moderator
1714870383
Hero Member
*
Offline Offline

Posts: 1714870383

View Profile Personal Message (Offline)

Ignore
1714870383
Reply with quote  #2

1714870383
Report to moderator
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 06, 2015, 04:00:15 PM
Last edit: January 06, 2015, 04:24:13 PM by yakuza699
 #2

Moved from Services to Development & Technical Discussion.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 06, 2015, 04:30:17 PM
 #3

Step 1: Follow the OP_RETURN tutorial up until you get to the part where you are making the OP_RETURN output. (as everything else is the same)
Step 2: Prepare your hash. (so figure out what you will hash, hash it, and get the hash in hex)
Step 3: Create the output as follows:

Code:
23   // the number 35 in hex... this means "THE OUTPUT SCRIPT IS 35 BYTES TOTAL"

a8   // This is the OP for OP_SHA256.... do not confuse with OP_HASH256 (which is 2 sha256s in a row)
20   // the number 32 in hex... means "PUSH 32 BYTES ONTO STACK"
931d236179670b00348f87bea4199fe18297f0ef26da02c7542bd54d5b7836d8   // My SHA256 hash of the secret I will need to redeem it.
87  // This is OP_EQUAL

Also, one note: The scriptlen is in VarInt format
https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer

However, pushdata inside the actual script is in PUSHDATA OP format:
(Up to 75 bytes is just that number in hex, above that you need to add a byte before the length and represent it in a little endian multi-byte integer.)
https://en.bitcoin.it/wiki/Script#Constants


Here's how to redeem:

My secret was gibberish:
Code:
adfladsfhuifo8ry8fh4u4et4e5tsg415et458s43etg41s35e4g3541r35g143sg54s385g41s535e1g435s4g;.:;,[@snrltgnjslenjrgklsnleignilsnklgnslnglk

But I need this in hex format, so I convert each ASCII byte to hex to get:
Code:
6164666c61647366687569666f38727938666834753465743465357473673431356574343538733433657467343173333565346733353431723335673134337367353473333835673431733533356531673433357334673b2e3a3b2c5b40736e726c74676e6a736c656e6a72676b6c736e6c6569676e696c736e6b6c676e736c6e676c6b

That's 132 bytes total.

So my input script that spends the output would be:
Code:
86  // This input script is 134 bytes long... VarInt is one byte up to fc.

4c84  // 4c is "the next byte is a PUSHDATA byte.... 84 is "132" in hex...
6164666c61647366687569666f38727938666834753465743465357473673431356574343538733433657467343173333565346733353431723335673134337367353473333835673431733533356531673433357334673b2e3a3b2c5b40736e726c74676e6a736c656e6a72676b6c736e6c6569676e696c736e6b6c676e736c6e676c6b  // My secret

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 07, 2015, 05:12:50 PM
 #4

Didn't really understood. Can you make a formula like for example on OP_RETURN it's
Code:
0100000001AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABB00000000ffffffff0100000000000000004e6a4cCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC00000000
and how do I do it on https://blockchain.info/address/1CTnGM9uapUSg8wvdXkpJPG2nbfGcxytPF

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 07, 2015, 06:02:05 PM
 #5

Code:
01000000 // version
01 // number of inputs
9f9b54077ebaf05f41c38a22fd2269a481089c922c5cf6b4a241cbf28e29e683 // hash of the tx you gave me, reversed
00000000 // your input was first, so index is 0
00 // this is just here for when you sign. placeholder.
ffffffff // this is sequence for nLockTime
01 // this is output count
18310c0000000000 // This says the output is worth 0.00799 BTC (leaving 0.00001 BTC in fees, because the input is worth 0.008 BTC)
23 // The length of the output is 35 bytes
a8 // OP_SHA256
20 // push 32 bytes on the stack
931d236179670b00348f87bea4199fe18297f0ef26da02c7542bd54d5b7836d8 // this is the 32 bytes that are pushed (your hash) REPLACE WITH A HASH OF SOMETHING ONLY YOU KNOW!
87 // OP_EQUAL
00000000 // nLockTime... leave at 0

clumped all together.

Code:
01000000019f9b54077ebaf05f41c38a22fd2269a481089c922c5cf6b4a241cbf28e29e6830000000000ffffffff0118310c000000000023a820931d236179670b00348f87bea4199fe18297f0ef26da02c7542bd54d5b7836d88700000000

This is what you use for signrawtransaction.

I will replace the sha256 hash with XXX so you can see where to put it.

Code:
01000000019f9b54077ebaf05f41c38a22fd2269a481089c922c5cf6b4a241cbf28e29e6830000000000ffffffff0118310c000000000023a820XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX8700000000

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 08, 2015, 02:08:57 PM
 #6

Code:
18310c0000000000 // This says the output is worth 0.00799 BTC (leaving 0.00001 BTC in fees, because the input is worth 0.008 BTC)
Everything was clear expect this one. When I try to convert from text to hex I get 302e3030373939 how did you got the 18310c0000000000 number?

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 08, 2015, 02:20:06 PM
 #7

Code:
18310c0000000000 // This says the output is worth 0.00799 BTC (leaving 0.00001 BTC in fees, because the input is worth 0.008 BTC)
Everything was clear expect this one. When I try to convert from text to hex I get 302e3030373939 how did you got the 18310c0000000000 number?

1. all bitcoin amounts on the blockchain are in satoshis, so convert 0.00799 BTC into satoshis
= 799000 satoshis
2. convert the 799000 decimal number to hexidecimal number (base 16 which counts 0123456789abcdef )
= C3118 satoshis
3. make sure the hex number is a multiple of 2 digits (this one is 5, so we will stick an extra zero on the left hand side.
= 0C3118 satoshis
4. take the hex number and split into groups of two digits.
= 0C  31  18  satoshis
5. reverse the groups of 2's order, but do not flip them individually (so don't turn 31 into 13 or anything)
= 18  31  0C  satoshis
6. join them together
= 18310C satoshis
7. add 0's to the RIGHT SIDE until it comes out to 16 digits long... this is 6 digits now, so add 10 zeroes to the right side.
= 18310C0000000000 satoshis

Congratulations, you know now how to convert a numerical bitcoin amount and convert it into a little endian satoshi value! :-)

Edit:

Here's a decimal to hexidecimal converter to verify:
http://www.binaryhexconverter.com/decimal-to-hex-converter

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 08, 2015, 04:24:03 PM
 #8

Ok so I followed your instructions and created
Code:
01000000019f9b54077ebaf05f41c38a22fd2269a481089c922c5cf6b4a241cbf28e29e6830000000000ffffffff0100350C000000000023a8209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c0812338700000000
But is there any easy way to sign that transaction(yes I have the private keys) without using bitcoin qt?

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 08, 2015, 04:34:50 PM
 #9

Ok so I followed your instructions and created
Code:
01000000019f9b54077ebaf05f41c38a22fd2269a481089c922c5cf6b4a241cbf28e29e6830000000000ffffffff0100350C000000000023a8209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c0812338700000000
But is there any easy way to sign that transaction(yes I have the private keys) without using bitcoin qt?

https://coinb.in/#sign

1. paste transaction in lower box
2. paste WIF format private key (starts with K, L or 5) in the upper box
3. click "submit"

the signed transaction will be shown in a green box below.

Pushing a non-standard tx to the network is tricky though...


I coded Coinbin's signature algorithm to be RFC6979 compliant.
(tl;dr: the signatures are super safe)

PS. you can download the website on your computer with Ctrl + S and unplug your internet while you sign if you want.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 08, 2015, 04:42:14 PM
 #10

Ok so I followed your instructions and created
Code:
01000000019f9b54077ebaf05f41c38a22fd2269a481089c922c5cf6b4a241cbf28e29e6830000000000ffffffff0100350C000000000023a8209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c0812338700000000
But is there any easy way to sign that transaction(yes I have the private keys) without using bitcoin qt?

https://coinb.in/#sign

1. paste transaction in lower box
2. paste WIF format private key (starts with K, L or 5) in the upper box
3. click "submit"

the signed transaction will be shown in a green box below.

Pushing a non-standard tx to the network is tricky though...


I coded Coinbin's signature algorithm to be RFC6979 compliant.
(tl;dr: the signatures are super safe)

PS. you can download the website on your computer with Ctrl + S and unplug your internet while you sign if you want.
I knew that service I tried it but it's bad.Signed the transaction and it returned to
Code:
01000000019f9b54077ebaf05f41c38a22fd2269a481089c922c5cf6b4a241cbf28e29e683000000008a473044022031b026269e3ab349be70e032348882fe9f4ff9b7752bd5a9c67d95995ba8ca800220412d70a9e336cdc607eae7ac2ca0c1901bf4335a44aac8bcec36c41c36434e7a014104d79737e9137e54a6ed4d3f6ccabb2a2232bc0020477c911f0d7d74db62d6f7b2f6fdd88457e6c408033edc7b12539584d42c8acaefff6347165f24f0abbcb9c2ffffffff0100350c000000000023a8209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c0812338700000000
http://webbtc.com/relay_tx relays all the transactions if they are valid(well sometimes to only 0%) but when I sign transactions through coinb.in no one relays those tx's. Any other way?

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 08, 2015, 06:45:46 PM
 #11

http://webbtc.com/relay_tx relays all the transactions if they are valid(well sometimes to only 0%) but when I sign transactions through coinb.in no one relays those tx's. Any other way?

Change the "00" placeholder in the input of the unsigned transaction with the following:
"1976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588ac"

THEN sign it with coinb.in...

BUT FIRST

Lower your output to 0.00799 BTC. I noticed it's 0.008. You need at least a 0.00001 BTC fee. (which a fee is just the value of the inputs minus the value of the outputs, which is why sending 0.00799 BTC will leave a fee for the miners.

If you don't leave a fee, good luck getting it mined at all. ESPECIALLY if it's non-standard, miners will ignore your transaction outright.

Some miners will accept non-standard IF there is a large fee. (like 0.0001 or 0.0005)

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 08, 2015, 07:02:37 PM
 #12

I don't know what to do I think it's impossible to relay a TX which has non-standard outputs is below 0.01 and has 0 fee.I pushed it on webbtc it relayed(to 0%) then I pushed it to RelayNetwork(not sure if it propagated). Tried to push a double-spend tx(the only way to know if other tx propagated is to push double-spend tx if it relays it, then they didn't got the previous tx if it doesn't relay it woohoo means that they have the other TX in their memory pool) on https://www.f2pool.com/pushtx and unfortunately it relayed. Don't know other ways I tried to push non-standard tx's through my normal bitcoin core connected to Eligius nodes my client doesn't relay them,RelayNetwork doesn't relay it last hope is to broadcast through Luke's version of qt which will take me a whole decade to re-index or hope that they open http://eligius.st/~wizkid057/newstats/pushtxn.php again is there anything else I could use to relay those transactions.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 08, 2015, 07:09:51 PM
 #13

non-standard output detected on my radars:

f457f0191e10281d6537d314e3f920bb187388736896defe3b1044b7281f7e62

Code:
01000000019F9B54077EBAF05F41C38A22FD2269A481089C922C5CF6B4A241CBF28E29E683000000008A47304402202FA6D22E9051F12A0D98FD6E08104A7206B3C81F8A783E17920E89E4F5814539022034EF868C5CB58D69115745DDD808C549D69728702D9695F30F9E0505B347BA49014104D79737E9137E54A6ED4D3F6CCABB2A2232BC0020477C911F0D7D74DB62D6F7B2F6FDD88457E6C408033EDC7B12539584D42C8ACAEFFF6347165F24F0ABBCB9C2FFFFFFFF0100350C000000000023A8209C0F28FC262F58E9AD1F021AB707662CAD96C754ECF3AD43BE5C26E49C0812338700000000

"vin" : [
{
"txid" : "83e6298ef2cb41a2b4f65c2c929c0881a46922fd228ac3415ff0ba7e07549b9f",
"vout" : 0,
[...]
"vout" : [
{
"value" : 0.00800000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_SHA256 9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233 OP_EQUAL",
"hex" : "a8209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c08123387",
"type" : "nonstandard"
}
}
]

yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 08, 2015, 07:24:16 PM
 #14

non-standard output detected on my radars:

f457f0191e10281d6537d314e3f920bb187388736896defe3b1044b7281f7e62
Well then the strangest thing is how did f2pool relayed the double-spending transaction. Guess your tool actually worked but maybe it didn't relayed through all non-standard accepting nodes one of them was f2pool's. Maybe it would have even reached f2pool after few seconds, but that is just my hypothesis.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 08, 2015, 07:34:25 PM
 #15

f457f0191e10281d6537d314e3f920bb187388736896defe3b1044b7281f7e62
Well now it even confirmed the double-spend transaction of f457f0191e10281d6537d314e3f920bb187388736896defe3b1044b7281f7e62 by this one https://blockchain.info/tx/838e0b2c5c377fea2ab15b21a7451588876882052656d5759de4a3bce46d88df Strange.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 09, 2015, 04:15:01 AM
 #16

I don't know what to do I think it's impossible to relay a TX which has non-standard outputs is below 0.01 and has 0 fee.I pushed it on webbtc it relayed(to 0%) then I pushed it to RelayNetwork(not sure if it propagated). Tried to push a double-spend tx(the only way to know if other tx propagated is to push double-spend tx if it relays it, then they didn't got the previous tx if it doesn't relay it woohoo means that they have the other TX in their memory pool) on https://www.f2pool.com/pushtx and unfortunately it relayed. Don't know other ways I tried to push non-standard tx's through my normal bitcoin core connected to Eligius nodes my client doesn't relay them,RelayNetwork doesn't relay it last hope is to broadcast through Luke's version of qt which will take me a whole decade to re-index or hope that they open http://eligius.st/~wizkid057/newstats/pushtxn.php again is there anything else I could use to relay those transactions.

Eligius accepts non-standard, but you need a certain fee.

I forgot where their non-standard fee list was...

But if you stick a 0.001 BTC fee on it and push to eligius I'm sure they'll mine it.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 09, 2015, 01:15:29 PM
 #17

Eligius accepts non-standard, but you need a certain fee.

I forgot where their non-standard fee list was...

But if you stick a 0.001 BTC fee on it and push to eligius I'm sure they'll mine it.
My main goal is not to get the transaction(with non-standard outputs) to confirm. My main goal is to get the transaction that is below 0.01 has non-standard outputs and 0 fee relayed. To be more exact I want f2pool to have that transaction in their memory pool.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 09, 2015, 02:23:55 PM
 #18

detected

Code:
0100000001DF886DE4BCA3E49D75D5562605826887881545A7215BB12AEA7F375C2C0B8E83000000008A473044022032D5B1258CB6EDCD9AB3E381F6872F978E0C8C4890004C490D456DC8FD4AC696022032A08AF17D4F88C0EF7064C23B037017A091CC39E0BBF965878DA06E367155EC014104D79737E9137E54A6ED4D3F6CCABB2A2232BC0020477C911F0D7D74DB62D6F7B2F6FDD88457E6C408033EDC7B12539584D42C8ACAEFFF6347165F24F0ABBCB9C2FFFFFFFF0100350C000000000023A8209C0F28FC262F58E9AD1F021AB707662CAD96C754ECF3AD43BE5C26E49C0812338700000000

{
"txid" : "38a66ab2e5ad44ec287006ea3bcb13f5364112162f001b2f7968bf694c8e052e",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "838e0b2c5c377fea2ab15b21a7451588876882052656d5759de4a3bce46d88df",
"vout" : 0,
[...]
"vout" : [
{
"value" : 0.00800000, // WHERE ARE THE FEES ?
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_SHA256 9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233 OP_EQUAL",
"hex" : "a8209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c08123387",
"type" : "nonstandard"
}
}
]
}
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 09, 2015, 02:33:52 PM
 #19

My main goal is not to get the transaction(with non-standard outputs) to confirm. My main goal is to get the transaction that is below 0.01 has non-standard outputs and 0 fee relayed. To be more exact I want f2pool to have that transaction in their memory pool.
Currently you have maybe 99.9% of nodes against you. (as a large majority will not relay your tx)

Look forward to hear if you succeed.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 09, 2015, 04:27:56 PM
 #20

detected
Unfortunately f2pool relayed the double-spending tx again 901dd16927eac839cdbb44fb3762792c95db07871b42c254eb55ff850ecd6b06  the owner of f2pool seems to be very inactive I sent many PM's to him but he didn't responded. Any ideas on how else I could make the first tx appear on their memory pool?

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 09, 2015, 05:11:07 PM
 #21

Quote
Unfortunately f2pool relayed the double-spending tx again 901dd16927eac839cdbb44fb3762792c95db07871b42c254eb55ff850ecd6b06
Your non-standard transaction doesn't pay fee.
f2pool ignores it as spam (and it is definetely spam)

yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 09, 2015, 05:52:04 PM
 #22

Quote
Unfortunately f2pool relayed the double-spending tx again 901dd16927eac839cdbb44fb3762792c95db07871b42c254eb55ff850ecd6b06
Your non-standard transaction doesn't pay fee.
f2pool ignores it as spam (and it is definetely spam)
Well then it's very strange. Because when I relay same transactions(but they are standard it's just that it pays 0 fee for 3000+bytes below 0.01BTC tx) they hold it(Eligius doesn't) how's that not a spam? What criteria should I meet to relay it to them does paying 100sat fee and/or sending above 0.01 help?

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
January 09, 2015, 06:47:05 PM
Last edit: January 09, 2015, 07:17:04 PM by DeathAndTaxes
 #23

WARNING:  Before you go any further you should understand that a script locked by a hash of a "secret" is insecure and trivially easy to steal.  When this owner tries to redeem this output the secret will be in plain text in the input.  Any miner could simply change the output to their output and include it in the next block.   

Quote
Well then it's very strange. Because when I relay same transactions(but they are standard it's just that it pays 0 fee for 3000+bytes below 0.01BTC tx) they hold it(Eligius doesn't) how's that not a spam? What criteria should I meet to relay it to them does paying 100sat fee and/or sending above 0.01 help?

You seem to be confusing to separate aspects.   "Standard transactions" and priority/fee.  Most nodes follow the lead of the reference client when it comes to relaying txns so your best bet is to simply comply but it can be done indirectly w/ P2SH and redemption will get easier once v0.10 is widely deployed (see release notes for v0.10).

Priority/fee
High priority txns do not need to pay a fee in order to be relayed so that might be what you are observing. The coin age of the inputs must be at least "one bitcoin day" or more (i.e. spending a 1 BTC output you received 144 blocks ago).   There actually is an exact formula but the wiki seems to be down right now.   So if your txn is low priority you will need to pay the min fee of 1000 sat per KB or the txn won't be relayed (by 99%+ of the network).  There is no point in paying a fee >0 and less than the min fee as it won't be relayed regardless.   Also understand the fee rules apply regardless of if the txn is standard or not.   If your txn is low priority and you don't want to pay the fee your only option is to bypass the network and find some one to get the txn directly to a miner.   This would be the only reason to pay a fee greater than zero but less than the min (1,000).  As a heads up There no longer is a >=0.01 BTC output rule to avoid txn fees.  It was removed way back in v0.8.6 but you may still see old docs refer to that.

Standard Transaction
Customs scripts are non-standard and won't be relayed by most of the network.  This can be bypassed by replacing the "output script" with a P2SH script including the HASH160 of your redemption script.

Quote
Pubkey script: OP_HASH160 <Hash160(redeemScript)> OP_EQUAL
Signature script: <sig> [sig] [sig...] <redeemScript>

So using the example txn linked above instead of having an output of:
Quote
OP_HASH256 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 OP_EQUAL

That becomes the redeem script and the HASH160 of it goes in an output like this:
Quote
OP_HASH160 <Hash160(yourscript)> OP_EQUAL

To redeem that output, the signature script (in input of the txn spending this output) would be the redemption script you hashed plus whatever satisfies the conditions (in this case the secret that was hashed):
Quote
<secretThatWasHashed> OP_HASH256 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 OP_EQUAL

Also you need to make sure the min output is above the dust threshold to avoid it being considered spam (which is always non-standard).
Quote
(nValue*1000)/(3*((int)GetSerializeSize(SER_DISK,0)+148)) < nMinRelayTxFee

yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 09, 2015, 08:11:10 PM
Last edit: January 09, 2015, 08:47:31 PM by yakuza699
 #24

WARNING:  Before you go any further you should understand that a script locked by a hash of a "secret" is insecure and trivially easy to steal.  When this owner tries to redeem this output the secret will be in plain text in the input.  Any miner could simply change the output to their output and include it in the next block.
Yep read that in the wiki page long time ago.
You seem to be confusing to separate aspects.
No I might write like I would confuse them but no I don't think so.(I guess)
High priority txns do not need to pay a fee in order to be relayed
If you meant "doesn't need to pay a fee to get mined" than yes but low priority tx's will still be relayed. Look at http://mempool.info/ scroll down a bit and you see lots of transactions like this https://blockchain.info/tx/25692930af2f39c0fb0725b19241ab53a4807772261e542aa5ed955ae4398a6e
So if your txn is low priority you will need to pay the min fee of 1000 sat per KB or the txn won't be relayed (by 99%+ of the network).
Wrong even my 0.8.6 relays them.When I push it to let's say blockchain.info/pushtx it appears on all blockchain explorers and also on my client.
There is no point in paying a fee >0 and less than the min fee as it won't be relayed regardless.
I must agree that there is no point of doing that in most cases but in mine there is.
Also understand the fee rules apply regardless of if the txn is standard or not.
I fault that non-standard transactions need to pay double the fee.
If your txn is low priority and you don't want to pay the fee your only option is to bypass the network and find some one to get the txn directly to a miner.  
What do you call a low priority transaction? For me its low priority=output less than 0.01,it has not passed enough time to qualify for free tx(and still be high priority),it does not pay any fee and it is above 1000bytes
As a heads up There no longer is a >=0.01 BTC output rule to avoid txn fees.  It was removed way back in v0.8.6 but you may still see old docs refer to that.
In 0.8.6 or after 0.8.6? I still use 0.8.6 and now downgraded to 0.8.5(Luke's Jr version of qt)
Customs scripts are non-standard and won't be relayed by most of the network.  This can be bypassed by replacing the "output script" with a P2SH script including the HASH160 of your redemption script.
Wouldn't that be standard then?

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
Taras
Legendary
*
Offline Offline

Activity: 1386
Merit: 1053


Please do not PM me loan requests!


View Profile WWW
January 09, 2015, 10:19:04 PM
 #25

Customs scripts are non-standard and won't be relayed by most of the network.  This can be bypassed by replacing the "output script" with a P2SH script including the HASH160 of your redemption script.
Wouldn't that be standard then?
And would this then work?
OP_DUP OP_HASH160 7db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e3925 OP_EQUALVERIFY OP_CHECKSIG OP_SHA256 9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233 OP_EQUALVERIFY
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 10, 2015, 10:57:38 AM
 #26

detected

Code:
0100000001066BCD0E85FF55EB54C2421B8707DB952C796237FB44BBCD39C8EA2769D11D90000000008A47304402203D10ECE797B624A5296BDD6FB86216E4CFED0BD6C85ED99F16D48DEC835CE53C022020962978A7BD9B7EE9BEB45C8D80289C475A257E74CA5519B77DE47818AA8FFE014104D79737E9137E54A6ED4D3F6CCABB2A2232BC0020477C911F0D7D74DB62D6F7B2F6FDD88457E6C408033EDC7B12539584D42C8ACAEFFF6347165F24F0ABBCB9C2FFFFFFFF0100350C000000000023A9209C0F28FC262F58E9AD1F021AB707662CAD96C754ECF3AD43BE5C26E49C0812338700000000

"txid" : "ae26b54c5443278909d77983d03e535013d7e26906f5328a91c4fcb45f711210",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "901dd16927eac839cdbb44fb3762792c95db07871b42c254eb55ff850ecd6b06",
"vout" : 0,
[...]
"vout" : [
{
"value" : 0.00800000, // no miners fee again?
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_HASH160 9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233 OP_EQUAL", // UNSPENDABLE because hash160 can not be equal to 32-byte value
"hex" : "a9209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c08123387",
"type" : "nonstandard"
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 10, 2015, 10:58:18 AM
 #27

Not sure if that is exactly what DeathAndTaxes meant but I created
Code:
0100000001066bcd0e85ff55eb54c2421b8707db952c796237fb44bbcd39c8ea2769d11d90000000008a47304402203d10ece797b624a5296bdd6fb86216e4cfed0bd6c85ed99f16d48dec835ce53c022020962978a7bd9b7ee9beb45c8d80289c475a257e74ca5519b77de47818aa8ffe014104d79737e9137e54a6ed4d3f6ccabb2a2232bc0020477c911f0d7d74db62d6f7b2f6fdd88457e6c408033edc7b12539584d42c8acaefff6347165f24f0abbcb9c2ffffffff0100350c000000000023a9209c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c0812338700000000
I pushed it, it got relayed then tried to push the double-spending tx to f2pool and they accepted it. So it means that they still ignore it or didn't got the first tx.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 10, 2015, 12:37:12 PM
 #28

Customs scripts are non-standard and won't be relayed by most of the network.  This can be bypassed by replacing the "output script" with a P2SH script including the HASH160 of your redemption script.
Wouldn't that be standard then?
And would this then work?
OP_DUP OP_HASH160 7db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e3925 OP_EQUALVERIFY OP_CHECKSIG OP_SHA256 9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233 OP_EQUALVERIFY
Nope. you would SHA256 hash the number 1, as if CHECKSIG is OK then it will leave OP_1 on the top of the stack.

You would also need something that checked if OPCHECKSIG gave a 1 or 0... which is why you should use OP_CHECKSIGVERIFY instead, as that will fail the script immediately if it fails, AND it won't leave a 1 on the stack.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 10, 2015, 12:45:37 PM
 #29

Hi I would like to buy a step by step tutorial on how to make OP_TRUE and OP_EQUAL(tx like this https://blockchain.info/tx/a4bfa8ab6435ae5f25dae9d89e4eb67dfa94283ca751f393c1ddc5a837bbc31b) non-standard outputs on bitcoind or bitcoinqt debug window(raw transaction).An example of how to make OP_RETURN tutorial https://bitcointalk.org/index.php?topic=453086.msg5302717#msg5302717

Will pay a little amount of 0.01BTC for it.

Since your bounty requirements were just to teach you how to make the non-standard output, and you have succeeded, I would like to ask that you deposit the bounty to my tip address in my sig.

Thank you.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 10, 2015, 01:45:03 PM
 #30

Hi I would like to buy a step by step tutorial on how to make OP_TRUE and OP_EQUAL(tx like this https://blockchain.info/tx/a4bfa8ab6435ae5f25dae9d89e4eb67dfa94283ca751f393c1ddc5a837bbc31b) non-standard outputs on bitcoind or bitcoinqt debug window(raw transaction).An example of how to make OP_RETURN tutorial https://bitcointalk.org/index.php?topic=453086.msg5302717#msg5302717

Will pay a little amount of 0.01BTC for it.

Since your bounty requirements were just to teach you how to make the non-standard output, and you have succeeded, I would like to ask that you deposit the bounty to my tip address in my sig.

Thank you.
I guess OP_TRUE won't differ much from the OP_EQUAL(sha-256) so I send you a full bounty. https://blockchain.info/tx/678fe4a407b2ea100b6ce7ad1eda0c692465260c3498d0b691ff529b0e1ef5b8

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 10, 2015, 01:51:27 PM
 #31

Hi I would like to buy a step by step tutorial on how to make OP_TRUE and OP_EQUAL(tx like this https://blockchain.info/tx/a4bfa8ab6435ae5f25dae9d89e4eb67dfa94283ca751f393c1ddc5a837bbc31b) non-standard outputs on bitcoind or bitcoinqt debug window(raw transaction).An example of how to make OP_RETURN tutorial https://bitcointalk.org/index.php?topic=453086.msg5302717#msg5302717

Will pay a little amount of 0.01BTC for it.

Since your bounty requirements were just to teach you how to make the non-standard output, and you have succeeded, I would like to ask that you deposit the bounty to my tip address in my sig.

Thank you.
I guess OP_TRUE won't differ much from the OP_EQUAL(sha-256) so I send you a full bounty. https://blockchain.info/tx/678fe4a407b2ea100b6ce7ad1eda0c692465260c3498d0b691ff529b0e1ef5b8

Thank you very much. Let me know if you have any other questions about non-standard transactions.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 13, 2015, 07:28:49 PM
 #32

Thank you very much. Let me know if you have any other questions about non-standard transactions.
Um how does one sign this transaction
Code:
0100000001a0f48023ba779fbe20b0c0e0447fa46d5eceb9ef2911b6e72566b45c172c192b000000001976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588acffffffff0100350c000000000017a914f837bec6fc1610acc74b1089ab4ef060ecfe254a8700000000
without using bitcoin core(yes I have all the 10 private keys)

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 13, 2015, 07:45:43 PM
 #33

Quote
Um how does one sign this transaction [...] without using bitcoin core(yes I have all the 10 private keys)

all 10 keys of what?
of msig-address 3QKUHN3uCLqX3KSbFkut2EdoDynrxFs2s7 which is the output of
https://blockchain.info/tx/2b192c175cb46625e7b61129efb9ce5e6da47f44e0c0b020be9f77ba2380f4a0

take the keys.
create digest of your transaction (remove scriptsig at all and do sha256^2)
the scriptsig will be
OP_FALSE, sig1, sig2... sigx, bip16
where hash160 (bip16) = f837bec6fc1610acc74b1089ab4ef060ecfe254a
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 14, 2015, 02:03:49 PM
 #34

take the keys.
create digest of your transaction (remove scriptsig at all and do sha256^2)
the scriptsig will be
OP_FALSE, sig1, sig2... sigx, bip16
where hash160 (bip16) = f837bec6fc1610acc74b1089ab4ef060ecfe254a
Didn't understood it. Especially the part where you have to make a digest of the tx.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 14, 2015, 02:19:49 PM
 #35

Quote
Didn't understood it. Especially the part where you have to make a digest of the tx.

OK, I'll try to explain.
May be there will be errors in my explanation, because I do not want to check with a compiler all steps.
I was wrong in previous message. You should not remove scriptSig.

1) Just create a digest of your data - sha256 ( sha256 ( your-raw-transaction-in-binary-representation-concatenated-with-SIGHASH_ALL ) )
2) Take your favorite ECDSA library and sign this digest with your private keys
3) Create new scriptSig: OP_FALSE signature-of-privkey1 signature-of-privkey2.... signature-of-privkeyN
where every signature is concatenated with byte 0x01 (SIGHASH_ALL)
4) Append bip16 msig string to a scriptSig
5) replace scriptSig bytes 76a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588ac in your template with new scriptSig
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 15, 2015, 07:56:17 PM
 #36

Went to bitcoin core typed createrawtransaction
Code:
"{\"1Jtwbwd8xtiU1tjbRyrhuMA5k6RFdHjVun\":0.008}"]createrawtransaction
"[
{\"txid\":\"ac1d26f3bc37d48718a8128c586ffdc2c837c5698d9943c05dd5b84a7eb339ab\",\"vout\":0},
{\"txid\":\"ac1d26f3bc37d48718a8128c586ffdc2c837c5698d9943c05dd5b84a7eb339ab\",\"vout\":1}
]"
"{\"1Jtwbwd8xtiU1tjbRyrhuMA5k6RFdHjVun\":0.008}"
Got
Code:
0100000002ab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac0000000000ffffffffab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac0100000000ffffffff0100350c00000000001976a914c44ceea4b4738e74483219e9af1435b7a0e8127788ac00000000
Went to coinb.in signed with one key copied the generated data and signed it with the other key, got
Code:
0100000002ab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac000000008a47304402203a7bbd4960e7d09984de939e8a58c909342925bc4632256605e6a8769b85102202203d5ee29c7d3146312d49a5951e8d176d3db62cba37dda4fe293781b97b1b12a8014104d79737e9137e54a6ed4d3f6ccabb2a2232bc0020477c911f0d7d74db62d6f7b2f6fdd88457e6c408033edc7b12539584d42c8acaefff6347165f24f0abbcb9c2ffffffffab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac010000008a47304402203a7bbd4960e7d09984de939e8a58c909342925bc4632256605e6a8769b85102202203d5ee29c7d3146312d49a5951e8d176d3db62cba37dda4fe293781b97b1b12a8014104d79737e9137e54a6ed4d3f6ccabb2a2232bc0020477c911f0d7d74db62d6f7b2f6fdd88457e6c408033edc7b12539584d42c8acaefff6347165f24f0abbcb9c2ffffffff0100350c00000000001976a914c44ceea4b4738e74483219e9af1435b7a0e8127788ac00000000
tried to send it and failed
Code:
Input signature 0 invalid.
Input signature 1 invalid.
I tried to replace the placeholder(in the first stage) from 0 to 1976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588ac than the ending result was
Code:
0100000002ab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac000000008a47304402207e3644cc77d35d91a3b8832fd848e9db8478148c46c879c5cc6bdbcba5cb431a022056cceebf27ae1018c48029050b9c54ad3858b75b64d651c2b1c9e35a7cfae210014104d79737e9137e54a6ed4d3f6ccabb2a2232bc0020477c911f0d7d74db62d6f7b2f6fdd88457e6c408033edc7b12539584d42c8acaefff6347165f24f0abbcb9c2ffffffffab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac010000008b483045022100830735184d667729fbdb150a6042a5b7606d426fcd9f614014e6e351be2e13db022028f77a014556347be4a15a92c0ba96a5929b3e302c217e5a3a80f45568a32e09014104d79737e9137e54a6ed4d3f6ccabb2a2232bc0020477c911f0d7d74db62d6f7b2f6fdd88457e6c408033edc7b12539584d42c8acaefff6347165f24f0abbcb9c2ffffffff0100350c00000000001976a914c44ceea4b4738e74483219e9af1435b7a0e8127788ac00000000
but still got Input signature 0 invalid. What did I did wrong?

I was signing with coinb.in and no I will not try to sync it with bitcoin core as it would take me about 2(and maybe more) days to sync it(without turning the pc off)

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
January 21, 2015, 08:54:08 AM
 #37

Were you able to accomplish what you wanted to accomplish?  In this last post, the first input needs to sign the double-sha256 hash of:

Code:
0100000002ab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac000000001976a914c44ceea4b4738e74483219e9af1435b7a0e8127788acffffffffab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac0100000000ffffffff0100350c00000000001976a914c44ceea4b4738e74483219e9af1435b7a0e8127788ac0000000001000000

and the second key needs to sign the double-sha256 of

Code:
0100000002ab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac0000000000ffffffffab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac010000001976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588acffffffff0100350c00000000001976a914c44ceea4b4738e74483219e9af1435b7a0e8127788ac0000000001000000

Notice that in both of them, the input that is not the one that's doing the signing is always set to 00, and then the signature type (SIGHASH_ALL aka 01) is appended to the end (01000000 -- aka 00000001 but reversed so the 01 is the left-most byte).

So the unsigned transaction that you are given to put on the website to sign is where all inputs are set to 00 and the signature type isn't on the end.  Which looks like this:

Code:
0100000002ab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac0000000000ffffffffab39b37e4ab8d55dc043998d69c537c8c2fd6f588c12a81887d437bcf3261dac0100000000ffffffff0100350c00000000001976a914c44ceea4b4738e74483219e9af1435b7a0e8127788ac00000000

So if you sign that separately with each and then in each position swap the 00 with the sig+pubkey, which will likely be:

[8a or 8b, the length of the sig+pubkey combo] followed by
[47 or 48, the length of the signature]
[30.......01, the DER signature, which will be 71 or 72 bytes long, ending in 01 aka SIGHASH_ALL] followed by
[41, the length of the uncompressed pubkey] followed by
[04......., the uncompressed pubkey]

So you swap each 00 with each key's sig+key data in the format above.

You probably already know this, because the last code-quote in your last post there looks correct syntactically, but the signatures just don't verify against the tx.

yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 28, 2015, 10:49:21 AM
 #38

I just created this transaction
Code:
01000000
01
b25674cb772bc4a788a9da826609672175b9f02bab3b252446b2357f01115d9f
00000000
1976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588ac
fffffff
01
204E000000000000
23
a8
20
9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233
87
00000000
I tried to sign it with the corresponding private key of 12ZMT7Qn2rysM3XKxkSBrVfzdXXufoS13t and it failed why? I need help ASAP.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 28, 2015, 10:56:41 AM
 #39

Quote
I tried to sign it with the corresponding private key of 12ZMT7Qn2rysM3XKxkSBrVfzdXXufoS13t and it failed why? I need help ASAP.

There is at least one error in line #6
only 7 'f' but should be 8
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 28, 2015, 11:07:08 AM
 #40

Quote
I tried to sign it with the corresponding private key of 12ZMT7Qn2rysM3XKxkSBrVfzdXXufoS13t and it failed why? I need help ASAP.

There is at least one error in line #6
only 7 'f' but should be 8
Changed from 7 to 8 but still when I tried to sign it returned me the same hash(unsigned one).

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 28, 2015, 05:02:33 PM
 #41

I just created this transaction
Code:
01000000
01
b25674cb772bc4a788a9da826609672175b9f02bab3b252446b2357f01115d9f
00000000
1976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588ac
fffffff
01
204E000000000000
23
a8
20
9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233
87
00000000
I tried to sign it with the corresponding private key of 12ZMT7Qn2rysM3XKxkSBrVfzdXXufoS13t and it failed why? I need help ASAP.

https://blockchain.info/address/1CTnGM9uapUSg8wvdXkpJPG2nbfGcxytPF
Check the Hash 160 part of this address's page?
Look familiar?
Line 5 of your transaction is using the scriptpubkey for 1CTnGM9uapUSg8wvdXkpJPG2nbfGcxytPF for some reason...

(I think maybe you copy pasted something from earlier, or input something wrong into some tool you are using.)

Your transaction SHOULD be the following:
Code:
01000000
01
b25674cb772bc4a788a9da826609672175b9f02bab3b252446b2357f01115d9f
00000000
1976a914111681ec5a5138c0e2348a346e90db822d2c70dc88ac
fffffff
01
204E000000000000
23
a8
20
9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233
87
00000000

Then you just need to be absolutely certain that the private key you're using to sign is the key for 12ZMT7Qn2rysM3XKxkSBrVfzdXXufoS13t and you should be good to go.

Note: however, your transaction has 0 fees attached... Though, looking at your mess of a transaction history, I won't bother... Why can't all these tests be done on testnet?

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 28, 2015, 05:22:13 PM
 #42

Yes.
The second error is (as said dabura667)
that the script for redeeming output #0 of
https://blockchain.info/tx/9f5d11017f35b24624253bab2bf0b9752167096682daa988a7c42b77cb7456b2
before signing (line #5)

should be
Code:
1976a914 111681ec5a5138c0e2348a346e90db822d2c70dc 88ac

not
Code:
1976a914 7db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e3925 88ac
yakuza699 (OP)
Hero Member
*****
Offline Offline

Activity: 935
Merit: 1002


View Profile
January 28, 2015, 05:28:37 PM
 #43

(I think maybe you copy pasted something from earlier, or input something wrong into some tool you are using.)
Yes I did thank you very much.
Why can't all these tests be done on testnet?
Because the BTC that I get from signature campaigns is used for these kind of tests.

▄▄▄▄▄▄▄▄
▄▄▄▄▄▄
▄▄▄▄
BTC BitDice.me 
.
poutine310
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
February 03, 2015, 07:04:42 AM
 #44

I wrote this tutorial awhile back on writing nonstandard transactions. I have done all sorts of weird ones.

http://pastedown.ctrl-c.us/#_kbv9v7Bt2tAXE4y_XJjerp3HYE.markdown
luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 793
Merit: 1016



View Profile
February 04, 2015, 10:46:53 PM
Last edit: February 04, 2015, 11:18:21 PM by luv2drnkbr
 #45

I just created this transaction
Code:
01000000
01
b25674cb772bc4a788a9da826609672175b9f02bab3b252446b2357f01115d9f
00000000
1976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588ac
fffffff
01
204E000000000000
23
a8
20
9c0f28fc262f58e9ad1f021ab707662cad96c754ecf3ad43be5c26e49c081233
87
00000000
I tried to sign it with the corresponding private key of 12ZMT7Qn2rysM3XKxkSBrVfzdXXufoS13t and it failed why? I need help ASAP.

The input script is wrong.  1976a9147db9fbceb81b5dc4cbcc84ab6b0cd9e57d1e392588ac corresponds to the address 1CTnGM9uapUSg8wvdXkpJPG2nbfGcxytPF, but the input you are referencing is the address 12ZMT7Qn2rysM3XKxkSBrVfzdXXufoS13t, so you need to change the 1976.... to that address, which would be 1976a914111681ec5a5138c0e2348a346e90db822d2c70dc88ac.

Additionally, you understand you aren't required to SIGN anything for that output, right?  All somebody needs to do is know the reverse of that hash.  There is no signature required to claim that money.  If the data that creates that hash is a public key, you need to change

OP_SHA256 ... OP_EQUAL

to

OP_DUP OP_SHA256 ... OP_EQUALVERIFY OP_CHECKSIG

if you want a public key and its signature required.

Also, I would recommend OP_HASH256, aka double sha256, instead of a single sha256 for your output.  For all the same reasons normal bitcoin mining stuff does double sha256.  So change the a8 to aa and the hash to d90169532083120128c4e2c0e5ad29ee3d4aff5cb7d65a54384fddd65a6de727

(Although now with that hash being publicly known, it doesn't really matter, but in the future I'd recommend double sha256.)

Edit:  Sorry, I had only finished page 1, and didn't see other people had corrected the input error.

Pages: 1 2 3 [All]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!