DannyHamilton (OP)
Legendary
Offline
Activity: 3388
Merit: 4653
|
|
March 27, 2013, 11:41:40 AM |
|
Given the following usage from https://en.bitcoin.it/wiki/Raw_Transactionscreaterawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}
I'm assuming I can type the following in the Bitcoin-Qt console window: createrawtransaction [{\"txid\":\"7e252ce7176a7a585ed99d4a6ecfb005f34b34574fc933748113a7aa755f824d\",\"vout\":1}] {\"13YteEVecArYiRETzyccPvG7nrTrjg1mhD\":5.40537687}
The balance of the output being used is (at the time of writing this post) 5.40537687 according to this: https://blockchain.info/tx/7e252ce7176a7a585ed99d4a6ecfb005f34b34574fc933748113a7aa755f824dThis should create a transaction that has no transaction fee, correct? My first concern before trying this is that I thought that Bitcoin-Qt represented balances internally as integers, so I'm not certain if I should use 5.40537687 for the "amount" or if I should use 540537687
|
|
|
|
|
|
|
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
Stephen Gornick
Legendary
Offline
Activity: 2506
Merit: 1010
|
|
March 27, 2013, 01:09:12 PM |
|
This wasn't your question but there is no "balance" for a transaction. A transaction output is for a specific amount, period. That amount is immutable -- it won't change. Once the transaction is spent it will still be that same amount, it just will have been spent so some views of it might show a balance of 0, but the amount never changed. My first concern before trying this is that I thought that Bitcoin-Qt represented balances internally as integers, so I'm not certain if I should use 5.40537687 for the "amount" or if I should use 540537687
The amount is decimal. Here's an example. - http://bitcointalk.org/index.php?topic=104512.msg1146645#msg1146645But this is what Testnet is for! (Or use a transaction with an amount small enough so an error isn't costly)
|
|
|
|
DannyHamilton (OP)
Legendary
Offline
Activity: 3388
Merit: 4653
|
|
March 27, 2013, 02:50:57 PM |
|
- snip - This wasn't your question but there is no "balance" for a transaction. A transaction output is for a specific amount, period. That amount is immutable -- it won't change. Once the transaction is spent it will still be that same amount, it just will have been spent so some views of it might show a balance of 0, but the amount never changed.
Yes, I realize this. I wrote my post in the wee hours of the morning after a long night of drinking and gambling, so I may not have phrased it properly. I suppose it would have been clearer if I'd have said "the value of the output", rather than "the balance of the output"
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1078
Ian Knowles - CIYAM Lead Developer
|
|
March 27, 2013, 02:53:40 PM |
|
I can confirm that the value is decimal (have done many raw tx's) and as long as you are spending all of the UTXO then all is good. BTW I have a simple web page for doing such simple raw tx's (its included in the CIYAM Safe distro) also if you have bitcoin-qt or bitcoind running then "decoderawtransaction" is a good way to "double check" the tx before you send it. (although I would not recommend sending raw tx's after a few too many drinks)
|
|
|
|
DannyHamilton (OP)
Legendary
Offline
Activity: 3388
Merit: 4653
|
|
March 27, 2013, 03:10:43 PM |
|
(although I would not recommend sending raw tx's after a few too many drinks)
Agreed. I figured I'd ask the question before going to bed so that the answer would be there when I woke up. I realize that if I screw up a transaction, I can end up with a significantly larger than expected "transaction fee". I'm taking this slow and careful, and I really hope I don't screw up with real bitcoins. Maybe I'll look into Testnet, I'd really like to get comfortable with the process. I've been thinking about a handful of bitcoin tools (such as an automatic dust sweeper, and a few new coin selection routines).
|
|
|
|
CIYAM
Legendary
Offline
Activity: 1890
Merit: 1078
Ian Knowles - CIYAM Lead Developer
|
|
March 27, 2013, 03:12:03 PM |
|
Am sure you'll do fine - but please don't try and break my 111 BTC fee record!
|
|
|
|
|
DannyHamilton (OP)
Legendary
Offline
Activity: 3388
Merit: 4653
|
|
March 27, 2013, 03:15:28 PM |
|
Am sure you'll do fine - but please don't try and break my 111 BTC fee record!
Yes, I'm aware of it. It's one of the main reasons that I'm hesitant and double checking everything I do. Additionally, I'll create a fresh wallet and only send a handful of bitcoins to an address at that wallet to work with (significantly reducing my risk exposure).
|
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1025
|
|
March 27, 2013, 04:48:44 PM |
|
Don't look at a website to find the value of an unspent output. Use listunspent, or getrawtransaction/decoderawtransaction.
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
DannyHamilton (OP)
Legendary
Offline
Activity: 3388
Merit: 4653
|
|
March 27, 2013, 06:59:05 PM |
|
Don't look at a website to find the value of an unspent output. Use listunspent, or getrawtransaction/decoderawtransaction.
Yes. I was using listunspent, but thanks.
|
|
|
|
themerkle
|
|
July 28, 2015, 09:20:12 PM |
|
I am sorry for necroing this thread but I thought this might be of use to some. I was having a hard time calling the createrawtransaction function through an RPC client. I didn't see this anywhere else until it worked.
bitcoin-cli -regtest createrawtransaction ''' [ { "txid": "'334a94b6a337e86cc88afb1db5a22fa9b1b44546e0b1823c9f1d853be1c6177d'", "vout": '0' } ] ''' ''' { "'1KupPMonFcC1Qn6a75kexDZPvwHRuD679s'": 49.9999 }'''
This string will work. and bitcoin-cli should output (I used a random address on blockchain.info for this tx so its probably not valid):
01000000017d17c6e13b851d9f3c82b1e04645b4b1a92fa2b51dfb8ac86ce837a3b6944a3300000 00000ffffffff01f0ca052a010000001976a914cf6f731517e7e0c66d97c946d4fda0f98f7a23cd 88ac00000000
One important detail I found when messing around with the rpc client is that the vout has to be an integer. All the variables have to have matching types meaning the amount along with the vout has to be an integer and not a string. If you get a code 500 check your parameter types.
|
|
|
|
|