Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Bitcoins the hard way: Using the raw Bitcoin protocol (righto.com)
229 points by kens on Feb 1, 2014 | hide | past | favorite | 26 comments


Do not, do not, DO NOT, try writing raw transactions at home. You will fail and you will lose a lot of money.

If you must: - Use testnet! If you don't know what testnet is, you have no business writing live raw transactions. - ALWAYS validate your transaction first by having bitcoind pretty-print it, and checking the output carefully, before sending.


>Do not, do not, DO NOT, try... You will fail and you will lose a lot of money.

Typical HN top comment :)


For some reason it makes me really want to try writing raw transactions at home, even though I have no idea what I am doing.


> Do not, do not, DO NOT, try writing raw transactions at home. You will fail and you will lose a lot of money.

I don't see the harm in putting a dollar or two into a new wallet just to have some fun. Just be careful not to mix up the private key with your real wallet, if you have one.


> I don't see the harm in putting a dollar or two into a new wallet just to have some fun

I did this with "a dollar or two" in early 2011 before USD parity.

You might eventually be happier if you use "a satoshi or two" instead.


The big problem was that you could forget to specify a "change" output, and then any unspend bitcoins would become the transaction fee. For large inputs this could be a disaster.

The 0.9 release candidate of bitcoin-qt now does sanity checks on the transaction fee, so this shouldn't be such a big problem anymore.


If I remember correctly there is a testing network for bitcoin. You shouldn't try on real money but you should definitively try.


Right, it's called testnet. I left more info in another comment.


Unfortunately, there is no way to spend a multisig (or any other nonstandard) transaction besides using the createrawtransaction API. It would be really nice if somebody implemented a better(safer) interface for them - n-of-m transactions could seriously increase security in many scenarios, but it's hard to get them right.


What someone does with their money (virtual or not) is their choice, and not for you to decide...


It's solid advice, as it's very easy to lose money writing transactions manually.


gwillen isn't deciding anything for anyone. They've provided advice to people so they can save themselves a lot of heartache. Would you be so upset if someone were to post about (let's use a Myth Busters example) sticking your hand in molten lead, and the top comment was "Don't try this at home! If you're off by a few degrees you will seriously injure yourself."?


Be careful if you try this at home; a lot of people have lost money this way. (Not sending change is a common mistake.)


To elaborate on that. If not very careful, you can end up sending a big fee, since the fee is calculated in the following way:

sum of all inputs values - sum of all outputs values

"Change" is an output that you control to which you will send the remaining amount. Failing to do so will end up sending all remaining value as transaction fee, which then goes to the miners.

If you end up doing that (as I did few months ago) you still have a chance though - through blockchain.info you can get information about who mined the block in which your transaction was included. If you're lucky, it will be one of the big pools. You can then try to contact them and ask to send the amount back to the originating address. In my case BTC Guild was nice enough to do exactly this.


With pools moving towards paying miners the transaction fees it becomes more difficult to recover from mistakes like this. The pool would have to contact the miners that received the fees to recover them.


Don't do anything experimental with real coins. That's what testnet is for: https://en.bitcoin.it/wiki/Testnet.

If you need a coin or two to get started, I run a testnet faucet at [redacted].

Or check out https://github.com/freewil/bitcoin-testnet-box.


There was a patch[1] some time ago that prevents sending fees larger than 1 BTC. Still a lot of money, but it won't let you lose thousands of dollars.

1: https://github.com/bitcoin/bitcoin/pull/2949


If you want something in a similar vein, Khan Academy has some good videos describing the protocol and not just a high-level overview (though there is that, too).

https://www.khanacademy.org/economics-finance-domain/core-fi...


One of the best articles I've ever read about bitcoin.


Agreed, this is a great reference and high level low level overview. Having though of doing the exact same thing, it's nice to have a guide in case I ever decide to do so. Thanks!


Came in here just to say that. Thank you for whoever posted this and more importantly, whoever wrote it.


It looks like they're one and the same, so the karma is going to the right place :)


I've always wanted to learn how to query a coin network for things like current difficulty and total hashrate without running a full blown wallet to get a console.

Is this documented anywhere perhaps? I cannot seem to find.

This helps a little https://en.bitcoin.it/wiki/Protocol_specification

but very low level and no mention of hashrate


Try https://blockchain.info/stats for stats from the past 24 hours. That site also has a whole lot of historical charts.


Linking to a thread about a paranoid blog/rant, regarding:

"Bitcoin is a cryptographic botnet"

  Bitcoin, I believe after reviewing the protocol 
  description here is a US gov’t black op.
https://news.ycombinator.com/item?id=7165893

Possibly worth discussing, since it's reactionary slant was directly provoked by OP's topic.

Seems to have gotten buried. Possible deliberate forum sliding?

http://lunaticoutpost.com/Topic-Technique-1-FORUM-SLIDING

The only reason I might suggest considering this botnet premise is due to hardware mining.

ASICs are pretty much the norm for mining now, and near as I can tell, there hasn't been much discussion regarding all the custom hardware floating around lately.


Not familiar with the crackpot index, huh?

BTW, the behavior of ASICs is well understood and has been audited by the authors of mining software (who are independent from the ASIC vendors).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: