Bitcoin Forum
December 15, 2024, 05:19:18 PM *
News: Latest Bitcoin Core release: 28.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 4669 times)
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: 1026



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!