text:
Where can I find people willing to pay me in bitcoin for services?
For those of us unable or unwilling to spend our native currencies on bitcoin, but willing to work for them. Where are the bitcoin-jobs(or micro-jobs) to be found?

CoinWorker pays Bitcoins for repetitive jobs such as identifying images that contain adult content, or rating search engine results.  It acts as a Bitcoin interface to the CrowdFlower network.

You might try bitcoinLocator. You can advertise services that you provide in your area, and people can message you privately.
You can also try posting on the bitcoin forums services board

In bitcoinlocator there are currencly 13 offers (combining buy+sell) in the whole world.

I looked at the suggestions. Best to meet people that pay a decent wage....don't work for  pennys....make a website and offer your service. But don't work for nickel and dimes...hold to your integrity. If they want workers for a penny a day i am sure they will find them and a lot of them....there is hell ..stay out of hell.
Google sites have free websites.http://www.google.com/services/ Then you can offer you service or grow your service.

Right now, I'd say the best place to do this is the Marketplace forum of bitcointalk: https://bitcointalk.org/index.php?board=5.0 - be forewarned that to use this forum, you need to have created a bitcointalk account, post five posts in the newbie forum, and stay logged in for four hours.  Until then, you're stuck in the Newbie forum.
But after that, there are a lot of people offering services on that site, so if you want to join them, feel free.  A hint to make those four hours go by faster: you need to be logged into the forum and on your computer, but you don't need to be actively browsing the forum that whole time.
If you're just talking about a one off jobs, this is probably your best bet.  If you want to actually build something that appeals to a large amount of people in the bitcoin community, you might want to crowd fund it using Bitcoinstarter: https://bitcoinstarter.com/

I tried out bitcoinget.com. I've been paying visit to them regularly for 3 days, and I have been paid everyday (around 10PM EST). One of those days I have earned $6 worth of bitcoins(0.0056 BTC) in few hours. $6 might not sound like a lot, but considering many websites pretty much refuse to pay you your earning until certain threshold, them actually paying over a $1 worth of payment daily is a huge plus.
In terms of Microworking for bitcoins, I think bitcoinget.com offers easiest tasks(not some bs tasks that makes you run around jumping hoops) for quite a bit of payment for single tasks. (16-24 uBTC for 20sec tasks, sometimes I've seen--still seeing--tasks that are super easy but pays around 90-120 uBTC per task.)
If you are interested in Microworking for straightforward USD, and has very low payout,
Try out Amazon Mechanical Turk. Minimum payout is $1, and it is owned by amazon. It really pays.
I've wrote a income report from both bitcoinget.com and Amazon Mturk on my blog, you can checkout payment proofs here.

You can try these sites:

http://www.bitcoinjobs.com/
http://bittask.com/
http://bitgigs.com/

...

Use the right tool for the job:

Elance, Freelancer, oDesk, Zaarly, Taskrabbit, Peddl, Craiglist, eBay, etc.

Then exchange those proceeds into bitcoins.
At some point those might offer bitcoins for cashout, particularly those with an international worker base.  But for now, take the (relatively) higher rates paid by these sites and do the conversion to bitcoin yourself.
Also read:

https://www.ogrr.com/viewtopic.php?f=26&t=1424

The obvious answer is ForBitcoin.com.

really? The site seems kind of stagnant to me.

@lathomas64 have you offered your services there?

Maybe #bitcoin-otc as well

Although it hasn't launched yet, eventually http://codeforbitcoins.com will allow for posting and working on programming jobs for bitcoins

There are two Reddits that are good for this:

http://www.reddit.com/r/Jobs4Bitcoins/
http://www.reddit.com/r/Jobs4Litecoins/

Best Place less fee and secure is, http://iwill4coin.com  its  growing rapidly, post your jobs/services there and get paid with bitcoin, no other payments accepted..


text:
Is it possible to trace fraud committed via a service the bridges banking and bitcoin?
Consider the following scenario:

An individual, the "buyer" buys something online from someone else, the "seller". The buyer cannot verify the identity of the seller.
The seller wants money upfront before shipping and communicates bank account details to the buyer. The buyer trusts the seller because he assumes the seller can be identified using via the banking details if the seller should attempt to defraud the buyer.
However, the bank account is not a personal account in the seller's names. It's a service that will convert all incomming funds into bitcoin and sent them to a bitcoin address under the control of the seller.
The seller runs away with the money (bitcoin) and never ships the goods. The buyer attempts to track the seller using the banking transaction and finds out about the service used. The service operator discloses the bitcoin address (e.g. when law enforcement gets involved), but cannot provide any further information about the seller.

Is is possible to track down the seller using publicly available information from the blockchain?

Please ask a clearer question and point out how it is bitcoin-related. To my knowledge there exist no bank account that automatically converts incomming fiat money (wire transfers) into Bitcoin. Independent thereof, if a person "buyer" sends fiat money via wire transfer and finds himself defrauded, he wants to trace the wire transfer to the bank account owner ("scammer"). Whether the scammer walks away with gold, bitcoin or USD cash is irrelevant if the bank cannot identify him.

Im from another country, and here it is possible to buy bitcoins by transfering money directly from bank, using reference number/code. There is a company that does that.

OK, I see, I have edited your question to make this clear. Hope this passes peer review.

Realistically, law enforcement probably wouldn't get involved. The operator of the Bitcoin service would be on the hook because the buyer would reverse the payment. Operators of Bitcoin services have had very little luck getting law enforcement involved when they get ripped off. (This is why such services don't exist. Scammers force them to raise their rates to cover fraud loss. That chases off legitimate users. And then the service's bank accounts get closed because of all the fraud. Game over.)

It may be feasible to trace amounts sent to the scammer's address, but it would require a lot of work, mostly communication to strangers, to pin an identity to an address. This difficulty would be further exacerbated by the employment of green addresses, mixing services, or simple holding.
Bitcoin is pseudonymous, meaning that tracing is only as easy as the person being traced allows it to be.
Bitcoin is not fungible, meaning primary that a "coin" is not uniquely identifiable. Rather, it's a distributed leger system, with value being subtracted from one account and added to another in each transaction.
The only traceable entities are thus the accounts receiving and sending, and the only relation to the physical world in each transaction is an IP address. Given the employment of an anonymizing service such as TOR or a lower-anonymity proxy, tracing that IP address to a physical location with a person is highly improbable (if you figure out how, I'll bet you could make a lot of money from governments!)
If you're still up for it, BlockViewer may assist in the tracing.
As an aside, it's pretty safe to say that any BTC sent would require nearly Herculean effort to reacquire. It would most certainly necessitate the involvement of law enforcement, which has not likely yet been trained how to deal with digital currency investigations. This highlights the importance of a third-party escrow service or a personal relationship between the buyer and the seller.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
How can I generate wallet files for multibit or armory?
I'm considering working on a bitcoin project that will need to generate wallet files.  I'm not looking to create receipt addresses that a customer can send funds to for an existing wallet.  Instead, I need to generate numerous wallet files, each with preferably only 1 payment address, that can be distributed across multiple locations.
Can this easily be done from a daemon command or with an existing API?  If there is an API for this, any language is fine, though I would prefer Python.

Related: pywallet

Thanks Nick ODell.  Post an answer and I'll give you a +1.

For MultiBit you could use the command line utility called WalletTool that Mike Hearn wrote. You can use it to create bitcoinj wallets (which is what MultiBit uses).
There is a description of it here:
https://bitcointalk.org/index.php?topic=43616.msg1451177#msg1451177
You could wrap calls to it in your favourite scripting tool fairly easily I imagine.

And what about armory?? Also I can't even find WalletTool... link?

You can try this utility called pywallet. You don't need to run pywallet from the command line though - just put it in the same directory, do import pywallet, and you can use any of the functions in there. You should try running it from the command line first though, because it'll show you any missing dependencies.
Functions you might find interesting:

create_new_wallet
KEY.generate
update_wallet

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Is it possible to send one satoshi to every bitcoin address?
As a random whim, I want to see if it's possible to send one satoshi to every bitcoin address that's ever been used. How much would that be? I'm betting the transaction fee would be a lot more, though. Is this even possible? How would I do it?

Hm.. kind of multicast. I am not sure how useful this could be, but it is not possible now. You need to create as many transactions required.

Yes. There are currently about 10 million unique addresses in the block chain, so 0.1 BTC would be enough to send a satoshi to each address. The transaction data would be about 340 MB. The network's anti-spam protections would make this project either very expensive (due to transaction fees) or very time-consuming.

Thanks! So it's infeasible. =( As an estimate, how much do you think the transaction fee would be?

@lurfjurv It's not infeasible. The fee might be about 170 BTC, though this depends on many factors.

How do you know there are 10 million unique addresses?

@Shamoon I gathered that data from the block chain.

@theymos Is it up on blockchain.info anywhere?

@Shamoon I don't know. I didn't get the info from a website.

It's weird. I got a 1 satoshi transaction from 1Enjoy1C4bYBr3tN4sMKxvvJDqG8NkdR4Z. You don't need to provide a transaction fee, but it might be quite a while before a miner decides to process it.


text:
OSX Vanitygen broken makefile
Whenever I try to install by running "make" it gives me tons of errors.
$ make
cc -ggdb -O3 -Wall   -c -o pattern.o pattern.c
pattern.c:32:18: error: pcre.h: No such file or directory
pattern.c:1604: error: expected specifier-qualifier-list before ‘pcre’
pattern.c: In function ‘vg_regex_context_add_patterns’:
pattern.c:1623: error: ‘vg_regex_context_t’ has no member named ‘vcr_nalloc’
pattern.c:1625: error: ‘vg_regex_context_t’ has no member named ‘vcr_nalloc’
pattern.c:1626: error: ‘vg_regex_context_t’ has no member named ‘vcr_nalloc’
pattern.c:1636: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1637: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1638: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_pat’
pattern.c:1641: error: ‘vg_regex_context_t’ has no member named ‘vcr_nalloc’
pattern.c:1642: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1643: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1643: error: ‘pcre’ undeclared (first use in this function)
pattern.c:1643: error: (Each undeclared identifier is reported only once
pattern.c:1643: error: for each function it appears in.)
pattern.c:1643: error: expected expression before ‘)’ token
pattern.c:1644: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1644: error: ‘pcre_extra’ undeclared (first use in this function)
pattern.c:1644: error: expected expression before ‘)’ token
pattern.c:1645: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_pat’
pattern.c:1646: error: ‘vg_regex_context_t’ has no member named ‘vcr_nalloc’
pattern.c:1651: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1652: warning: implicit declaration of function ‘pcre_compile’
pattern.c:1654: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1667: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1668: warning: implicit declaration of function ‘pcre_study’
pattern.c:1668: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1671: warning: implicit declaration of function ‘pcre_free’
pattern.c:1671: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1674: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_pat’
pattern.c: In function ‘vg_regex_context_clear_all_patterns’:
pattern.c:1692: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1693: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1694: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c: In function ‘vg_regex_context_free’:
pattern.c:1706: error: ‘vg_regex_context_t’ has no member named ‘vcr_nalloc’
pattern.c:1707: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c: In function ‘vg_regex_test’:
pattern.c:1723: error: ‘pcre’ undeclared (first use in this function)
pattern.c:1723: error: ‘re’ undeclared (first use in this function)
pattern.c:1764: warning: implicit declaration of function ‘pcre_exec’
pattern.c:1764: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1765: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1771: error: ‘PCRE_ERROR_NOMATCH’ undeclared (first use in this function)
pattern.c:1779: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1783: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1788: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_pat’
pattern.c:1797: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1798: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1799: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1806: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1806: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1807: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1808: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_extra’
pattern.c:1809: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_pat’
pattern.c:1809: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex_pat’
pattern.c: In function ‘vg_regex_context_new’:
pattern.c:1840: error: ‘vg_regex_context_t’ has no member named ‘vcr_regex’
pattern.c:1841: error: ‘vg_regex_context_t’ has no member named ‘vcr_nalloc’
make: *** [pattern.o] Error 1

Related: https://github.com/samr7/vanitygen/issues/18

You are missing a dependency required to compile it. More specifically pcre.h or the Perl Compatible Regular Expressions library.
To solve this install MacPorts and then use it to download the required dependencies:
sudo port install autoconf
sudo port install pcre
sudo ln -s /opt/local/include/pcre.h /usr/include/

This is untested as I'm no Mac user, but it should work.

Thanks! Worked perfectly! My sudo was broken though, so I had to login root, but then I couldn't run port so I had to go to /opt/local/bin and run ./port install autoconf and all that stuff.

the last step would better be cd /usr/include/; sudo ln -s /opt/local/include/pcre.h

This works with brew also brew install pcre

Error: Unable to execute port: Could not open file: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/autoconf/Portfile

This isn't exactly the solution you were looking for, but someone created a Docker container for vanitygen and I found it much easier to run on my Mac with Docker:
https://hub.docker.com/r/cbeams/vanitygen/

Thanks, but I was really looking for how to build it on mac. (also, I asked this >4.5 years ago). I ended up getting an address on vanitypool instead of generating locally.

Fair enough. I was just looking for a way to do it locally on my mac and using Docker was the simplest solution available.
So I figured I would leave it as a suggestion for anyone who's in the same position and who stumbles across this post in the future.


text:
Sending bitcoins programatically without running a node
How can I send bitcoins in my web app without running the daemon on my server?
Is there a way to do it? Do third parties allow you to send through them?

Yes this is completely possible. There are services which run fully featured API's that provide almost everything that the client can do.
http://blockchain.info/api
There are other merchant processors which have similar functionality depending on exactly what you want to do also.

but these require that you keep your private keys with them, do they not?

If you could somehow track the outputs at your disposal (which you may therefor send in an outgoing transaction you could in fact create a transaction, sign it and submit it to a bitcoind daemon or blockchain.info (via the sendrawtransaction API call) to get it into the network.
Tracking outputs is the sole reason you likely have to run a daemon. Even if you create a single output for 100 BTC and then start creating transactions from that output, by splitting off small amounts and send the change back, it makes the transactions dependent on each other. As soon as a single transaction is not validated (due to a bug, incomplete fees or a double spend), all following transactions will also fail.
Spending bitcoins without being connected to the network overlay is possible, but at some point you'll have to synchronize with the network to ensure the transactions have been accepted and to get fill up the output pool for future spends.

To send bitcoins you need:

Private key(s) for the address(es) being spent
Transaction hash + index for each transaction previously received to those addresses whose funds will be used for spending in this transaction
Bitcoin address(es) to send to, including change address if there will be change.

The Bitcoin.org client does all this elegantly without the user needing to know anything except what address(es) to pay and the amount.  To construct a transaction manually means obtaining data from the blockchain, performing a cryptographic signature using the private key, and broadcasting that transaction to peer nodes.
The Raw Transactions API article on the Bitcoin.it Wiki describes this further.
~~This is done using Javascript code from Brainwallet.org~~ [Update: this is defunct, link removed]:
Now if you simply need to send from a node that is not on a live connection (but has a current blockchain), you can do this using the Armory client:

http://bitcoinarmory.com/using-offline-wallets-in-armory

Also the Electrum client apparently can be used to provide to you the raw transaction that could then be broadcast to spend a coin.  Electrum uses a back-end server that does all the work that the Bitcoin.org client would do in building the transaction.
Once you have a raw transaction to broadcast, you can use the PushTx API on blockchain.info or BrainWallet.org will let you [broadcast a transaction][3] as well.

brainwallet.org doesn't resolve.  there's brainwallet.io but that seems like something else

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How do previous transactions work?
I'm confused about the inclusion of the hash of the previous transaction in a transaction. Is it mandatory? Should it be the hash of the last outbound transaction? What if an unexpected transaction messes up the linked list? I have written specific scenarios below for which I am unsure about the behaviour.

I have an account A for which its only transaction T1 was receiving 1 BTC from some other account. If I want to spend my 1 BTC in a transaction T2, do I need to include the hash of the transaction T1 in T2?
I have an account B which so far only received 1 BTC from a transaction T1 and I want to spend the 1 BTC in a transaction T2 referencing T1. But just before broadcasting T2, a transaction T3 also referencing T1 credits my account with 1 BTC. Will T2 be accepted despite T3 entering the blockchain before T2?
I have an account C to which someone will send 1 BTC tomorrow in a transaction T1. Is it possible to "pre-spend" the 1 BTC in a transaction T2 without knowing the hash of T1? By pre-spend I mean that as soon as my account gets credited with the 1 BTC from T1, transaction T2 can immediately also enter the blockchain.

Short answers: yes, yes, no.
The longer answer is that you should stop thinking in terms of accounts/addresses - they are irrelevant as they don't really exist at the protocol level (they're just a client-side abstraction in the wallet).
Bitcoin functions in terms of coins, very much like your physical wallet containing coins. Coins are produced and consumed by transactions.
Every coin has a value (between 0.00000000 and 21000000.00000000 BTC), and an address of its owner (that's a simplification, but it suffices for now).
Every transaction consumes one or more coins. This is done by referencing them explicitly (by stating the hash of the transaction that created it), and providing a signature (for each) that proves you are the owner. They are consumed entirely: they're either spent or unspent, there is no "withdrawing" or "crediting" of/to them.
Every transaction also produces one or more new coins, whose sum in value cannot be more than the value of the coins consumed by the transaction.
As transactions deal with complete coins all the time, this means we sometimes have leftovers that need to be returned. This is what change addresses are for. When you have a coin of value 3.1 BTC, and you want to pay me 1 BTC, you'll create a transaction with one input (consuming the 3.1 BTC coin), and two outputs (one 1 BTC coin to me, one 2.1 BTC coin to a possibly different address of yourself).
Even though the concept of "balance of an address" is well-defined (the sum of the value of all unspent coins assigned to that address), this concept does not exist at the protocol level. You always work with full coins, and arbitrary amounts that get added/subtracted from balances (though the value of those coins is arbitrary).

Aha, I see. So for example can I see on Blockchain.info the balance of an address down to the coin granularity?

If you click on a particular transaction, you can see which of its outputs are spent or not. In general, the view that these block explorer like sites present is misleading, as they interpret the data to make it look like a balance/ledger system.

In Bitcoin transactions you always have to specify where the coins came from. This even goes as far as not specifying how many coins an input feeds into the transaction, since the amount is specified in the previous output.

This is the classical case in which you spend coins that you previously received. The hash of T1 has to be specified in T2 as well as the index of the output being claimed.
Since T2 only spends the funds available from T1, regardless of how many other outputs are at the disposal of the address that is signing the transaction it will be valid, even if since its creation other outputs became available to the address. Transactions are self-contained to a certain degree.
Without knowing the output you want to claim, i.e., the tuple of previous transaction and index, you will not be able to create a valid transaction. Should the sending party however communicate the hash and index to you before broadcasting the transaction you'd indeed be able to create such T2.

authors: Виктор Чуприн


text:
c-lightning - Unknown Peer
I'm trying to create a channel using c-lighting (testnet), but I keep getting an Unknown Peer error message.

I used cli/lightning-cli connect which seemed to work fine.
I used cli/lightning-cli listnodes and I see whole bunch of nodes.
I used cli/lightning-cli listpeers and I see 1 peer.
I used cli/lightning-cli newaddr to create a new address and funded it (3 confirms so far)
I then try to use cli/lightning-cli fundchannel and I get an Unknown Peer message.

Everything but the last Comand looks correct. There is no command channel in c-lightning. In order to open a channel you need to execute
cli/lightning-cli fundchannel id satoshi [feerate] [announce] [minconf]
  Fund channel with {id} using {satoshi} (or 'all') satoshis, at optional {feerate}. Only use outputs that have {minconf} confirmations.

The thing that beginners sometimes oversee is that before opening a channel with a node you need to peer with it first via the connect command like you did.

That was a mistake in the question, I did do fundchannel which is what gives the Unknown Peer error.  Any other tests I can do to try to figure out why this is happening?

can you post information from the logfile? (with loglevel debug?)

Got it working.  I was making a noob mistake in that I did not realise that the connect address and the fundchannel address had to be the same...

Yes, that is quite a common mistake. It could also have been that between the connect and the fundchannel command the connection was lost, e.g., the remote peer closed the connection. In that case you would have had a connection on which to open a channel, but when attempting to fund the channel it'd be already gone again,

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Is there a 64-bit port of the original software for windows?
The download page on the Bitcoin site lists two clients for the windows platform. Both clients are a 32-bit binary.
Running a 64-bit build of Windows on a multi-core processor, I find myself wondering whether a 64-bit binary exists. So ... Is there a 64-bit port of Bitcoin-Qt for Windows out there?

Short answer: no.
Long answer: It's not likely to be necessary for some time.

There are still a considerable number of people on 32-bit Windows (~23% according to the Valve Hardware Survey, which paints a good picture of forefront computer enthusiast hardware, so the market share is likely to be larger among non-gamers).
Bitcoin-Qt doesn't yet push the limits of 32-bit memory address space. On my machine, Windows 7 64-bit, the program is consuming only ~128 MB of RAM while downloading blocks (haven't sync'd in a while). On my Mac, it's about 240 MB.
The type conversion necessary may be prohibitive, if there is significant code written specifically for win32. Qt itself is obviously working fine on 64 bit, as is the most of the bitcoind codebase. There may be things here and there to work out.
More likely to be prohibitive, or at least "not worth it", is the management of the release of another package. There's already five packages managed, so including another is just that much more.

I speculate that there won't need to be a 64-bit Windows version until 1.0 comes out. By that time, Windows XP will be wholly unsupported and I'll bet we're nearing if not past the Windows 7 mainstream support period. I read somewhere that Windows 8 OEMs must use 64-bit if available, so the problem of grandma buying a 32-bit computer for her bitcoin habit is likely to go away.


text:
Can you generate bitcoin addresses without storing a private key?
Suppose you have a possibly compromised system, which you do not trust enough to stores your private keys on.
Is there some process where you can generate unique bitcoin addresses within the system, that does not contain a private key?
To clarify:
You have a web server that clients use to make orders. You want to create a unique bitcoin address per purchase. In addition, you don't want the server to contain your bitcoin private keys - an attacker gaining access to the server shouldn't be able to touch your bitcoins.

I've no idea what are you talking about.

@Lohoris - I was missing the word "without" in the title. Added clarification in the question body.

Much better now, I'd like to have an answer too.

@Lohoris - I think my answer is not bad, but I open to other suggestions.

I was doubtful since you said "I guess", and I was waiting for someone to eventually confirm it can be done, as you guessed ;)

Yes
I love how all the upvoted answers talk about multisig or electrum but the one answer that mentions HD wallets is at -1.
HD wallets allow you to do this.
TL;DR Derivations per level on an HD wallet use 3 portions in 2 different hashes. 1 hash requires the parent public key and parent chain code (summed together creating the parent extended public key) and the other hash requires the parent private key and the left half of the output of the 1st hash.
Confused? The diagram at the bottom oughta help. At the end of the day, the private keys used to sign are derived from the chain of private keys all the way from the ECDSA key. If you only derive from the extended public key (public key + chain code) then you can derive as many addresses as your heart desires without giving up the private key. Minus the chain code and you're unable to generate many addresses (chain code gives up privacy AKA ability to derive many valid addresses)

Indeed! This is the best answer.

You should generate the keys in a secured environment and then move only the public parts to the server which you don't trust. Keep the private ones secured - you need these for spending.

This doesn't allow the insecure server to generate an arbitrary number of addresses without communication with the secure server.

Electrum seedless wallets for a desktop http://electrum.org and Electrum POS system for servers https://github.com/kangasbros/electrumpos
For desktop is really easy to setup, just restore from your Master Public Key and you'll get a seedless wallet without private keys but with the privilege of creating new addresses.
For servers you need to install Electrum pos system, see it in action here http://acceptbit.com

Multisig can be used for it, but is overkill and requires P2SH to be usable as phrased.
What you do need has been sometimes referred to as "EC magic". Both private keys and public keys are a sort of numbers which can be added, and the public key corresponding to the sum of private keys is the sum of public keys.
So in the secure server you'll have a private key d1. The insecure server will have the corresponding public key P1, and for every customer it will generate a private key d2 and corresponding P2. The public key is P1+P2; d2 can be sent to the secure server, which will calculate the private key d1+d2.
Schemes based on multiplication rather than addition are also possible.

This is the right way to do this. It works because EC's private key to public key conversion behaves like multiplication and G(X + Y) = G(X) + G(Y). So given G(X), but not X, you can pick a random Y, and calculate G(X) + G(Y) (which is also G(X+Y) and thus a public key) but not X + Y (the corresponding private key). If you store Y and G(X+Y), you have a public key and enough information to compute the private key only if given X (which you store on another machine). (Ripple's account families work this way.)

I believe multisig can be used to implement this - keep only one part of the pair on the system, and use it to generate addresses. I don't know whether multisig support exists in the popular packages implementing bitcoin, but it's one direction that would work.
You'll only be able to spend them using both keys, which are stored only on the secure system.

Armory enables exactly what you're looking to do with its Watching Wallet.  Because of its deterministic nature, you can generate unlimited public keys which you can assign to each customer while the private keys sit safely on an offline computer somewhere.

You can play with BIP32 here:
http://bip32.org/
With Bitcoin Master Private Key you can generate Derived Private Key(s) and Derived Public Key(s). With Derived Public Key you can generate Bitcoin addresses. With Derived Private Key you can later generate private keys to move Bitcoin from those addresses.


text:
Are HD wallets, with multiple hierarchies, supported across all crypto-currencies?
Suppose I want to create an arbitrary tree deriving from one master secret, with an arbitrary structure, with some branches being arbitrary different crypto-currencies (e.g. BTC/ETH/XRP/...).
Is this always possible? Are there any currencies that won't be supported by such a private key generation scheme?

As long as they utilize a form of public key cryptography, I think the answer is yes. My understanding is that BIP32 was meant to be a standard for Bitcoin, but not the only possible implementation of a hierarchy structure for deterministic key pair generation. The examples given in the standard are, however, specific to elliptic curve used by Bitcoin:

we will assume the public key cryptography used in Bitcoin, namely
  elliptic curve cryptography using the field and curve parameters
  defined by secp256k1

This means that it would work for other types of public key cryptography, though you may have to tweak the generation functions for different size keys (other than 32 bit private keys and 33 bit compressed public keys). Of course the security of the arbitrary scheme depends on the design, but that wasn't what this question was asking.


text:
Can I use my wallet on different computers?
I'm used to synchronize my data on different machines. Depending on the data I use SVN, Dropbox or SSH (Unison). Is this possible with the bitcoin wallet, too?

It is, with three provisos.

Never run the same wallet on more than one computer at a time.
Never run an older copy of a wallet when a newer version exists. If you send any funds, make sure to keep the newer copy of the wallet.
Make sure all client programs are linked to the same version of BerkeleyDB.

Overall, I think it's just not a good idea. The client software wasn't designed to cleanly handle the many things that can go wrong.

"not a good idea".  Gavin, technical lead of Bitcoin would concur. http://bitcointalk.org/index.php?topic=5324.msg77896#msg77896

Yes. The only file you need to worry about is wallet.dat (location dependent on operating system). If you copy that one file to another computer (or to a secure backup), you will have access to your money and address book. Conversely, that is the only file you need to protect -- all of the other files should be safe to share without worrying about anyone getting their hands on your money.
This only applies to your money and address book. If you only copy wallet.dat, you will need to re-download the entire block chain on the other computer (so you may want to copy the other files too, but it is not necessary). There is no point in backing up the other files, because if you need to, you can redownload everything else.
Finally, you should not leave your cleartext wallet in any server that you don't control (such as DropBox). Make sure you encrypt it before backing it up.

I think you do need to take care not to use the same wallet.dat simultaneously from two computers ... am I right?

By "simultaneously", do you mean take a copy of the file and use it in two places at once (without synchronising), or literally use the same file shared over a network from two PCs at once? In the case of two PCs using a copy -- it will work, but is probably wise not to do this, simply because it's hard to merge (a tool could be made to merge wallets). But because there are 100 pre-generated addresses, it is quite unlikely that using it for a short time in two places without synchronising would cause you to lose data when you copy one back over the other.

The other question (if you literally share a file over a network), this should be okay, because it internally uses Berkeley DB which I believe is designed to handle reads and writes from different processes or machines without conflict. So that approach should be fine, but I cannot guarantee it. The best solution would be to have only one "active" copy of a wallet at any given time, and every time you finish using it, synchronise it back over.

You can get yourself an online wallet at a site like Blockchain.
Then you can log in on the site from any computer to access your wallet.

This would probably be better as a comment to the original post as it doesn't necessarily provide an answer to the question.

@StephenGornick Why? With an online wallet you can log in from any computer to acces your wallet, so it's a really good way to acces your wallet from multiple computers.

@Jop there are many cases of blockchain users having their bitcoins stolen through various means even when using google 2 factor auth, via keylogging, malware etc. Its much safer to leave your main bank of coins in a cold storage wallet and just a small amount in blockchain


text:
What motivates nodes (or miners) to relay transactions?
Miners want to include as many transactions as possible in their block to get the (optional) transaction fee. But what motivates them to relay a transaction further to the network? Is this done solely for the greater good?

Nothing. That's why you send your TXs to several nodes.
Non mining nodes do it "to keep the whole thing working" as long as it is very cheap.
Because of this miners can't keep TXs for themselves and thus do not even bother to try and keep TXs secret. Maybe they also have a better conscience that way. :)

The only way to expect others to relay your own transactions is to do the same with theirs.
If you want your transaction included in a block you will either have to mine it yourself, which is nearly impossible if you would have to do so for every transaction you want to make or either you will have to assume that others will relay it to all miners so that eventually someone will include it in a block.
If you know from yourself that you are dependent on other miners, it is only logical that you help others to get their transactions in a block as well, so that you can assume they do the same with yours.
Relaying other transactions to miners also gives the miners the opportunity to make more profit (from fees), which will make it more likely that people will mine and that your transaction will eventually be included in one of their blocks.

This isn't a real answer. You're just justifying the golden rule (treat others the way you wish to be treated). If the golden rule were enough there wouldn't be any parasitism in the world. The OP wants to know what incentive there is for selfish nodes to relay transactions.


text:
How to find the change / sender address given a txid?
Suppose I'm making a service like SatoshiDice and when I receive a transaction I want to give some money back. Where can I find the sender address?
If I run this, e.g.:
bitcoin-cli gettransaction 8386a8d2870c0df79f652ef4d981b21649ebf40601948c1c0709de0f02de8c8c

I get:
{
    "amount" : -0.00750000,
    "fee" : -0.00050000,
    "confirmations" : 10130,
    "blockhash" : "00000000000000002b44cdc1b2fe4ec2aa6b31b25ae8eedc8d1ef16799bd3114",
    "blockindex" : 13,
    "blocktime" : 1398584440,
    "txid" : "8386a8d2870c0df79f652ef4d981b21649ebf40601948c1c0709de0f02de8c8c",
    "walletconflicts" : [
    ],
    "time" : 1398584248,
    "timereceived" : 1398584248,
    "details" : [
        {
            "account" : "",
            "address" : "1Gxua3AptLgz1DWbG38dakLP4DVY2Jia4d",
            "category" : "send",
            "amount" : -0.00750000,
            "fee" : -0.00050000
        }
    ],
    "hex" : "01000000013c75459d163a5343725362a5b412dde392784814ec04c4e77df7ee5edbd10352010000006a47304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca012102be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9ffffffff0250c30000000000001976a9144233e899673c755c11664d43d0a83a56d06ce23188acb0710b00000000001976a914af1ca5c63970b893a4ef79d030b28ca91ccd22ce88ac00000000"
}

I can find the address I am looking for in details -> address. But is this the right place to look? The details array can be empty or have more than one element?
I know there are two similar questions already: How to findout the sender of a transaction and What's the best way for a website to detect payments from green addresses? but the problem is that theses questions don't explain if I can use gettransaction securely to find it.
Following the answer tip, I was able to do this:
bitcoin-cli decoderawtransaction "01000000013c75459d163a5343725362a5b412dde392784814ec04c4e77df7ee5edbd10352010000006a47304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca012102be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9ffffffff0250c30000000000001976a9144233e899673c755c11664d43d0a83a56d06ce23188acb0710b00000000001976a914af1ca5c63970b893a4ef79d030b28ca91ccd22ce88ac00000000"

which produces:
{
    "txid" : "8386a8d2870c0df79f652ef4d981b21649ebf40601948c1c0709de0f02de8c8c",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "5203d1db5eeef77de7c404ec14487892e3dd12b4a562537243533a169d45753c",
            "vout" : 1,
            "scriptSig" : {
                "asm" : "304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca01 02be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9",
                "hex" : "47304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca012102be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.00050000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 4233e899673c755c11664d43d0a83a56d06ce231 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9144233e899673c755c11664d43d0a83a56d06ce23188ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1733nLJx6QrYa7AemEHXgq89G2NaWjPpRW"
                ]
            }
        },
        {
            "value" : 0.00750000,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 af1ca5c63970b893a4ef79d030b28ca91ccd22ce OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914af1ca5c63970b893a4ef79d030b28ca91ccd22ce88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1Gxua3AptLgz1DWbG38dakLP4DVY2Jia4d"
                ]
            }
        }
    ]
}

This let's me find the change address.
But can I skip these steps and take it from "details"?

Bitcoin may use multiple outputs from different addresses to fund the transaction. It will always be impossible to predict what the user is doing, for example, they could be using CoinJoin and the actual sender could be any of the inputs.
Also remember that services like SatoshiDice causes huge network strain and is preferred to use a deposit address and have the user specify an address to withdraw. It solves both network strain and your issue.
In addition, never assume that a certain output is the change address. The user could be doing anything (like sending the rest to someone else).
EDIT: Downvoting both mine and David Schwartz's answer doesn't help anything. It is just not possible to anticipate every use-case. In the words of the Satoshi client developers; "Sometimes a documentation limit is a feature, not a bug". The important point there is that if you have to ask then maybe giving you the answer will cause more harm than good. The only ways to do this are:

Try to guess the change address. If there are two outputs you could use the one that isn't yours. If the sender has an exact output then you might not even get a second output. If there are >2 outputs you might use the last one but that makes a ton of assumptions and any wallet that even cares about privacy will randomise the outputs.
Try to guess the sending address. If there is one sending address you could use that, in the case of more than one, it's anyone's guess (maybe use the top one?).

Noone can answer the question any more than that. Even my answer is just made up, it is not allocated for using the protocol and is just a guess based on how some wallet software works.
I can't recommend against this enough though. It is extremely dangerous. SatoshiDice is not recommended by anyone who knows anything about how Bitcoin works, it is simply popular because it was one of the first, if not the first Bitcoin betting site.

I know that it should be avoided (guess the change address) but I am not asking here best practices, I am asking how to do it. It's a controlled and specific situation, I know the sender won't use a mix service and so on.

I don't think that your question conveyed explicitly your special situation, so I don't think it is fair of you to rebut the answers you got for not catering to your special situation. Especially your question whether "it is the right place to look", easily allows for these answers. You should improve your question to precisely state the underlying conditions of your situation, instead of critizing the answers.

Related: http://bitcoin.stackexchange.com/questions/12111/how-does-blockchain-info-calculate-the-estimated-transaction-value

I'm somewhat confused by all this talk about change addresses and so forth. Why does it matter? If the OP is receiving money in the current transaction at address "1733nLJx6QrYa7AemEHXgq89G2NaWjPpRW", then it's clear that the other output is the change output. And since there's only one input in this transaction, its clear that the sole sender is the signer of that input. That is, the sender's pubkey is "02be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9" while the sender's address is "1388D9sHH4HXdGLxkSipxe2noZuekHZmaF".

how the block explorers have them then?

Each transaction can have multiple inputs and thus can have multiple senders.
Here's how you get the sender(s):

bitcoin-cli getrawtransaction 8386a8d2870c0df79f652ef4d981b21649ebf40601948c1c0709de0f02de8c8c 1

(the 1 flag indicates that you want the raw tx to be decoded)
Note: make sure that you have already indexed the blockchain or else this might not work. To index, restart bitcoind with txindex=1 as a config variable.
From that, you get a fairly big response, which contains the following:
"vin" : [{
    "txid" : "5203d1db5eeef77de7c404ec14487892e3dd12b4a562537243533a169d45753c",
    "vout" : 1,
    "scriptSig" : {
        "asm" : "304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca01 02be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9",
        "hex" : "47304402200ee65c9f757eb6c240efe5a7e4427e04174a32da14b1eef459d36d61d031f6e702202d6b5383f86f155d92a494e80a1242af7e160faf16d597ea457b6e3bf08bb1ca012102be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9"
    },
    "sequence" : 4294967295
}]

This means there's a single input, so there is in fact one sender.
Now, there are two ways to get the sender.
Method A (should always work but is slower):

grab the txid and the vout
do bitcoin-cli getrawtransaction <txid> 1
find the output of this new tx where the value n is equal to the vout of our original tx
go to the scriptPubKey section and check the hex or addresses field - that's the sender (in hex pubkey script or address form)

We now have:
"scriptPubKey" : {
    "asm" : "OP_DUP OP_HASH160 17492e77be2c666af78993020b90235cd1d3738d OP_EQUALVERIFY OP_CHECKSIG",
    "hex" : "76a91417492e77be2c666af78993020b90235cd1d3738d88ac",
    "reqSigs" : 1,
    "type" : "pubkeyhash",
    "addresses" : [
        "1388D9sHH4HXdGLxkSipxe2noZuekHZmaF"
    ]
}

and the sender is 1388D9sHH4HXdGLxkSipxe2noZuekHZmaF
Method B (faster but only works for certain types of transactions):

check the 'asm' field inside the 'scriptSig' field
if the field has two components separated by a space, and the second component is a valid public key, then we have a standard pay-to-pubkey(-hash) transaction, so convert the pubkey to an address
fallback to method A

We see that there is in fact a valid pubkey in the original tx scriptSig:
02be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9
We use Coinkit to extract the address:
$ sudo pip install coinkit
$ python
>>> from coinkit import BitcoinPublicKey
>>> pub = BitcoinPublicKey('02be7759e73363488269f0257158177f3295af42d1f3a6b2fdf8fb4380b1d16ae9')
>>> pub.address()
'1388D9sHH4HXdGLxkSipxe2noZuekHZmaF'

And we have the same answer!
P.S. you can inspect the Coinkit library I used above on github

−1 In your example for method A getrawtransaction 5203d1db5eeef77de7c404ec14487892e3dd12b4a562537243533a169d45753c 1 returns No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions. (code -5) so this don’t works.

Please just don't do this. If you have an agreement with someone and you want to pay them Bitcoins, just have them tell you what account to pay. Don't try kludges to figure out the correct address to pay because many payments do not contain any account the sender can receive Bitcoins from anywhere in the payment.
Here's what happens when you do this:
Jack uses Foo Online Wallet. He sends some Bitcoins to his deposit address. Foo Online Wallet credits his online wallet account for these Bitcoins. Jeff sends you money using his Foo Online Wallet. Foo uses the coins Jack deposited. So the source address for the transaction is Jack's deposit address. When you make a payment to the source address, you are sending the coins to Jack's deposit address -- giving the Bitcoins to the owner of the deposit coincidentally used by Foo Online Wallet. But you should be making the payment to Jeff's deposit address which you cannot know unless you ask Jeff.
Just Don't Do This

tell me why SatoshiDice do this and why is it so successful? It's so easy: you transfer bitcoin to an account and receive or not the change.
The point is: I want to do this, what is the better manner to do it? SatoshiDice warns the user like this: "Only use wallets that allow you to receive Bitcoin from the same address you sent from. If you're not sure, test by sending a bet for the minimum amount. If you get nothing back, then your wallet is not compatible. Note that some bets may require one confirmation before the win/loss value is sent back."

@FelipeMicaroniLalli I answered all your questions already in my answer. My second sentence explains how to do this correctly. As for why SatoshiDice is successful -- it's because they were first and they did enough things right to succeed. As I explained in detail, this is one of the things they've done wrong and it's caused a lot of pain. I can't force you to learn from their mistakes, but I can strongly advise you to.

I have written a program in Python3 that allows you to search for any address on bitcoin core whether it belongs to your wallet or not.
Here is the github link:
https://github.com/ORP967/Bitcoin_Core_RPC_par_address
Let me know what you think or if you have any improvements you might have.
(Damn, a lot of programmers in this post)


text:
How is the endian conversion done?
This answer seems simple, but I'm finding mixed answers. This question describes the conversion from little-endian to big-endian hex strings (or vice-versa) as switching the order of bytes in every slice of four bytes, where here it's described as just a string reversal. Both seem correct in their contexts, so what's really going on?

In general, converting between big and little endian values depends on exactly how you're storing those values, so both of your examples could be correct in different implementations. To this end, techniques are likely to vary even within the same application since it's more dependent on how your input data is formatted.
It's also dependent on how your particular use case defines endianness - there's no one-size-fits-all definition - endianness can refer to the order of 8-bit bytes within a 16, 32 or 64 bit word or it could refer to the order of individual bits or even the order of entire words within a larger context. If you're encoding the 16-bit word "07F3" for example and your definition of endian refers to bytes within a word then big-endian would be "07F3" and little-endian would be "F307" - working with a 4-bit byte you would end up with "07F3" and "3F70" and working with individual bits big-endian would be "0111 1111 0011" (07F3) and little-endian would be "1100 1111 1110" (0CFE).
One excellent example, however, is the EncodeBase58() function in Bitcoin's base58.h which uses a char vector and C++'s built-in reverse_copy function to reverse the elements' order in the vector:
// Convert big endian data to little endian
// Extra zero at the end make sure bignum will interpret as a positive number
std::vector<unsigned char> vchTmp(pend-pbegin+1, 0);
reverse_copy(pbegin, pend, vchTmp.begin());

Now I'm not 100% sure but I believe that what's being passed in to the encode functions is a UTF-8 encoded string representation of the value, so in your own words it would seem that Bitcoin's endianness conversion - at least where Base58 conversion is concerned - is a simple string reversal as long as the input is UTF-8 encoded.

So essentially endianness is a string reversal (when we're talking about string representations of hex numbers), but for some values (like the getwork target) there's only a single number, and for others (like the block header data) there is a sequence so to change endianness one must reverse the string representing each individual number while the sequence of numbers overall is preserved.

Well there's always just the one number, it just depends how you're expressing it and how you're breaking it into the chunks (bits, bytes, words of varying size) that define endianness.

Ah, I believe my previous comment was incorrect. As you point out, since we have 8-bit bytes the pattern is reversing a string in character pairs.

Character pairs if your input string is in hex, yes. If you're using UTF-8, Base 64 or some other encoding method your methods will vary. It makes more sense if you always imagine your data in binary and then reverse the order of n-bit chunks, that way using different bases is less likely to throw you.

For example, in base 64 each character is 6 bits, so you'd be breaking your data into one-and-a-third character chunks and reversing their order - it just wouldn't work without switching bases or working exclusively at the bit-level.

No problem, welcome to StackExchange!


text:
What is the extraNonce?
This question helps identify the various components of the getwork "data" field, but I'm curious where the extraNonce comes from. My hunch is it's the first four bytes of the second half of the data, because I believe this is still part of the Merkle root (and yet, being in the second half of the data, it won't be part of the midstate). Is this correct? And if so, how does one increment the extraNonce, and what does it mean to do so?
Example getwork data:
00000001a10bacc7e639d1c69a01014bc5db6f2604b3477a3f273a4e019a232700000000a5942372cc60477c8a276e59c8f1a3f58654ea2f6c4402bf1b18e48455b5b8f64f10868b1c07475200000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000
Is the extraNonce (in little-endian, I know), 55b5b8f6?

extraNonce gets put into the input of the generation transaction. getwork clients can't see transactions, so they can't update extraNonce. Some miners instead modify nTime slightly to give them more nonce space.
extraNonce is used by bitcoind, but it's not part of the protocol. There is no extraNonce field in blocks or transactions.

Ah, interesting. And nTime is the same as the timestamp described here, correct?

Yes, nTime is a field inside the block header.

This really helped me understand it:

A solo miner increments Nonce until it overflows. Then it increments extraNonce and resets Nonce. extraNonce is located in the coinbase transaction, so changing it alters the Merkle root. extraNonce is reset based on the time.


text:
What are midstate and hash1 used for in mining?
The first answer here does a good job explaining how the SHA-256 function requires more than one input (an initial one is specified by to the SHA-256 specs). As far as I understand it, the "midstate" value is the initial hash of the first half of the data, used to later serve as an input into the double-hash of the second half of the data.
Is this correct?
And here is an explanation of what the "hash1" value actually is and means, but what is it used for?

What do you mean by "half" here? If b=SHA(a=SHA(data)), a = "initial hash" and b = "second half"? So, a is the midstate?

This defines midstate well; it's "the contents of the 'state' after having processed the first [SHA256] block." Thus, it's not a in b=SHA(a=SHA(data)) if data is longer than one SHA256 block (64 bytes). Isn't the Bitcoin block header 80 bytes?

1) Yes, it is correct.
2) It is deprecated. Generally, it is used to write the result of the mining over to be sent to the pool. This is to ensure the result is of correct length and adheres to some rules. In practice, it is always the same trailing string of numbers.

So the hash1 value itself is never actually used? It just serves as a formatting template?

@ConstableJoe Well, it's not used for any calculations, it is deprecated in general and eventually it will be left out of the getwork protocol.

Interesting. Seems pretty useless, unless I'm missing something.


text:
Losing bitcoins

Possible Duplicate:
What could be the consequences of many bitcoins being lost out of circulation if people lose their wallets?

So I am trying to comprehend this Bitcoins system so please bare with me if I get it wrong.
If I care at all about my bitcoin wallet I should back it up, otherwise, if I have coins in my wallet and then lose my wallet.dat then my coins are gone forever.
I also heard somewhere that after a while coins will no longer be able to be mined. If this is the case, and tons of people lose their wallet.dat (for whatever reason. eg. Virus, format, new PC, etc), would that cause coins to get more and more hard to find, which in turn would make coins be worth more, but would "mining start again"?
Sorry if this sounds stupid I'm still new at this.

Welcome to bitcoin.stackexchange.com! It is a good question you ask, and you're correct about the importance of not losing your wallet. I think you'll find the link I provided addresses the key part of your question.

A wallet holds the private keys necessary to spend bitcoins.  If you are running the Bitcoin.org client and lose access to your wallet.dat then a backup copy of the wallet is the only way you can be able to spend the funds.
If you have no backup or can't access the backup then the funds are gone.
People that prefer not to have the responsibility for keeping a backup of their wallet might like to use an EWallet, such as Coinbase and Paytunia, which are hosted (shared) EWallets, or Blockchain.info/wallet which is a hybrid wallet.
As far as mining to recover coins, there is no recovery ever for the funds from the lost wallet.  They are gone forever.

I also heard somewhere that after a while coins will no longer be able to be mined.

There is an upper limit of 21 million coins, after that no more coins will be mined but that will not be for many years yet. Also see this answer on
mining after all 21 million bitcoins have been mined for what will happen then.

If this is the case, and tons of people lose their wallet.dat (for whatever reason. eg. Virus, format, new PC, etc), would that cause coins to get more and more hard to find, which in turn would make coins be worth more, but would "mining start again"?

If people lose their wallets and the number of bitcoins in circulation is reduced this does not directly impact how "hard" it is to "find" (mine) coins, instead this is determined by the difficulty which is a parameter set by the network to try to maintain a block generation time of 10 minutes on average and is adjusted every 2016 blocks. Lost wallets may indeed cause bitcoins to be worth more as the supply is reduced and this could cause the hash rate to increase and thus increase the difficulty in that way. Bitcoins from lost wallet.dat files cannot be re-mined but are gone for good unless the wallet file can be recovered somehow.


text:
Does any open source software exist for an e-wallet service?
If I want to setup an e-wallet service, would I have to create it from scratch or is there any existing open source software that could be used?

It seems like the project was abandoned, but you might be able to recycle the code.

During the last days I started hacking together a little online-wallet
  and thought some of you might be interested.
It is based on the bitcoind RPC API for handling accounts and adds
  custom labels stored in database.
If you want to send coins to a labeled address, just start typing the
  label and it will autocomplete.
It is a Ruby/Rails application released under the MIT license, so you
  can setup your own online wallet or even run it locally and use it
  instead of the default client UI.
Note that this is just a very early development version which still
  needs a lot of work.
Project/Source: http://open.sourceagency.org/projects/webtc Demo
  (testnet): http://webtc.interesthings.de (There is a demo Account:
  foo@bar.baz / password, but feel free to create new accounts, the
  email doesn't have to exist)
Feedback, bug reports, patches and donations welcome

bitcointalk.org

Someone linked me to this project a while back: https://github.com/kangasbros/django-bitcoin

You can use the Wallet class to do different bitcoin-moving applications. Typical example would be a marketplace-style site, where there are multiple sellers and buyer. Or job freelance site, where escrow is needed. Or even an exchange could be done with this abstraction (a little extra classes would be needed however).
Note that while you move bitcoins between Wallet-objects, only bitcoin transactions needed are incoming and outgoing transactions. Transactions between the system "Wallet"-objects don't generate "real" bitcoin transactions. Every transaction (except incoming transactions) is logged to WalletTransaction object to ease accounting.

I haven't had a chance to play around with it myself yet, but it sounds like a decent starting point for building an e-wallet site using Python and Django.

Bitcoin Core JSON API wallet
This is a simple wallet based on the bitcoin-core api
https://github.com/makevoid/corb_wallet
The code is very small:
The routes are ~50 lines https://github.com/makevoid/corb_wallet/blob/master/corb_wallet.rb#L48
The main class is the Wallet class (~70 lines) https://github.com/makevoid/corb_wallet/blob/master/models/wallet.rb#L35  and it's using bitcoin-client, a tiny library that wraps bitcoin core JSON RPC API.
I think using the core wallet has numerous advantages

Clientside solution
Also another simple solution will be to create local keys with bitcore and use external apis like in these two repos/apps: https://github.com/makevoid/blockchain_pen_coffee - https://github.com/720kb/BitNFC
key generation both for node and js clientside: https://github.com/makevoid/blockchain_pen_coffee/blob/master/keychain.coffee#L16 and usage of blockchain info api to get balance and utxos https://github.com/makevoid/blockchain-info-api-basic/blob/master/index.coffee#L23
signign and broadcasting a transaction using blockcypher: https://github.com/makevoid/blockchain_pen_coffee/blob/master/bitcore_ext.coffee#L41

Of course these two solutions need development (especially the second), I linked them just to show you an idea on the possibilities stable and available right now with little code.
A good suggestion I think is starting with first the core client or a clientside js wallet library like bitcore and stable block explorer service for getting balance, utxos and sending the tx, if they don't require an api key, that's a plus :D. You have to get your hands into the code and play with the core client / js browser client to build something meaningful to you. Bitcoin is still uncharted land, and just fixing the UI/UX problems, even with a basic client, it's a big win. sorry for the long answer

try ecryptr, here's the github project:
https://github.com/devgeeks/Encryptr

https://encryptr.org
Encryptr is a zero-knowledge, cloud-based e-wallet / password manager
  powered by Crypton.
It started as an example project for seeing what Crypton could do in a
  Apache Cordova mobile app. I had a particular itch to scratch. I got
  tired of trying to remember my work password. It changes fairly often,
  is slightly complex and is generated – I can't choose it for myself.
I had tried a few password managers but hadn't loved any of them –
  particularly on Android. So, when I needed an idea of an app to make
  to try out Crypton, this seemed like an obvious choice. At its
  simplest, Crypton is basically a cloud based key/value store using end
  to end zero-knowledge encryption. None of the data stored on the
  server can be viewed by the server.
I wanted something to store hard to remember passwords, important
  numbers, etc across devices.
Encryptr keeps it simple. It has three types of data it can store.
  Passwords, Credit Card numbers and general key/value pairs. It can
  easily be expanded to include other default entry types.
It is currently working on Android, and the Desktop – thanks to NW.js
  – but there are no reasons why it could not by expanded to
  Blackberry10 and Windows Phone 8.
iOS is coming soon, just waiting on a way to either make it work with
  the new WKWebview or to push some of the hard crypto to native.

it sounds like this may be what you are looking for.


text:
What format is the time of a Bitcoin transaction stored in?
This may be a very simple question to answer, but I haven't been able to quickly find it.  Regardless, if you were to deconstruct a transaction in the blockchain, and pull out the time value of the transaction, what format is the time stamp in?
In other words, if you were to pull out the draw time value, how can I convert it to a meaningful value?

Does the time need to be known right away, or just historical data (i.e., not including transactions from the most recent six blocks).  Also, what granularity.  Does knowing the block's timestamp solve the problem or do you need real-time as they arrive?  Either way, these values are not immutable -- is that a requirement?

Well, what I'd like to do is monitor the time difference between received transactions for a specific address.  In other words, I'd like to see how often transactions are sent to a specific address.  The data needs to be specific to the network, not necessarily the time the user posted the payment within their client.

There are several things you could mean by the time of the transaction:

When the transaction is created
When the transaction is known about by 90% of the network
When the transaction is first included into a block
When the block is known to 90% of the network

We can't know 1, because it could have been generated offline, and there's no time field. You can assume that 1 is 30 seconds or so before 2, but again, you can't know.
We can figure out 2, because the time that we receive the transaction is going to be pretty much the same as when 90% of the network does. For historical data, blockchain.info has an API.
We can figure out 3, because there's a time field in the block. However, that can be off by up to an hour, and the network won't care. Still, there's not much reason to lie about it.
Figuring out 4 is pretty much the same as 2.

Regarding point 2 and point 4, blockchain.info doesn't record the time when they received the broadcast right? (meaning they only record the timestamp of the transaction created, which can be off by hours)

@Pacerier I'm unsure what you mean. I just said that transactions don't have a timestamp.

If you are literally referring to the "time" or "blocktime" property of a transaction within the blockchain, then this timestamp is in Unix format.
And if by "convert it to a meaningful value", you mean a human-readable format, you can use a unix command line (e.g. Terminal on OSX) to do a quick conversion:
Linux:
$ date -d @1395103695

Mac OSX:
$ date -j -f "%s" 1395103695

...which would return the following:
Mon Mar 17 14:48:15 HST 2014

But that timestamp being off by hours isn't really useful right?

That's not really OP's question, i.e. what format is the timestamp in within a transaction in the blockchain. I edited my answer because I'm inferring that what he meant by "meaningful" is "human-readable".
The usefulness of this data is subjective.

Transactions do not have a time per se. They do have a lock_time which is currently not used anyway.
Blocks do have timestamps, bytes 69-72 after trimming the protocol headers and checksums. Some may say that a transactions time is the time of the block that included it.
Another interpretation (the one used by blockchain.info) is simply the first time the transaction was received by the peer.

I think that would work.  Actually, I have an idea for a project, but I need to know the time a transaction showed up in the chain (or was received by a peer, as you suggest.)  Is the time stamp on the peer unreliable?

If you need something immutable not even the timestamp for the block is useful because a block reorg can still occur even once a transaction is in a block.

@StephenGornick, That's confusing, do you mind elaborating on it? Do you mean that the current timestamp for block 200k http://api.blockcypher.com/v1/btc/main/blocks/200000 which is 2012-09-22T10:45:59Z can be modified in the future?

Only if a fork below block 200k is created and it overtakes the current chain. The timestamp in the block is immutable but the transaction may appear in another block with a different timestamp.

@cdecker Is it an arbitrary process which block transactions wind up in after a reorg, or would you expect it to be a block created roughly before or after the original block?

The naturally occurring block forks do not have any coordination, so it is expected that each miner will just pick whatever suits their policy. So during a reorg this kind of time assignment may end up with arbitrary new timestamps.

authors: Тихон Иванов


text:
Where can I find graphs the values of alternative crypto currencies?
Hashrates and value in BTC. Is there one site that can show them all, perhaps even on the same chart?

at http://www.ltc-charts.com you can see long term charts for litecoin

Don't forget http://www.cryptocoincharts.info/ which has charts for LTC, PPC, DVC, NMC, IXC, LQC, and SC in a nice clean interface.

Today, if you've found this question, you'll probably know that CoinMarketCap and CoinCap.io are popular sites for tracking the BTC or USD value of cryptocurrencies. But there are way too many altcoins to display them on the same chart.


text:
Where can I find a graph of Bitcoin value vs USD for over 60 days?
Bitcoin Charts seems to only offer graphs of up to 60 days.

This is a straight dupe of http://bitcoin.stackexchange.com/questions/748/where-can-i-get-raw-data-series-of-bitcoin-prices .  Although this one came first, that one is a marginally better question, so I suggest merging this one into that.

@eMansipater - this is not a dup. In that later question I asked for raw data. Here I asked for a graph.

Bitcoin Charts currently have charts of up to a year in length, as well as "all data" charts.
Example 360 days:
http://bitcoincharts.com/charts/mtgoxUSD#rg360zvztgSzm1g10zm2g25

I actually found that page once, just forgot that it's there (it's easy to miss it). Thanks!

You can see further back in Bitcoin Charts
http://bitcoincharts.com/charts/mtgoxUSD#vztgSzm1g10zm2g25

try www.btcdb.net or www.bitcoindashboard.com for detailed informations...

https://bitcoinhelp.net/know/more/price-chart-history
Has a chart containing:

average daily BTC/USD prices starting from 2009
annotated historical events
optional logarithmic scale

http://bitcoinity.org/markets?theme=light
this is a great site too, but i believe it only goes to 30 days
this is a live graph though

TRy this chart , also look at litecoin, the next bitcoin, @ $3. now with $55 M in the market cap. http://coinmarketcap.com/


text:
Why isn't bitcoind listening on its rpc port?
I run
sudo netstat --ip -lpa | grep bitcoin

After starting the bitcoin daemon and all I get is the 8333 port and the connections with other peers.
But when I do the same but with | grep namecoin, I get the rpc port and everything else.
I'm not being able to make poolserverj to work because of that.
Since it's not listening, poolserverj gives me a 404 response on the rpc port.
My bitcoin.conf:
server=1
rpcuser=xxx
rpcpassword=xxx
rpcport=8332
rpcallowip=*
gen=0

Hmm, maybe you should look for bitcoind - the Bitcoin server?

I'm using the headless version, and grep filters bitcoind with or without the "d".

I commented "rpcallowip=*" and now it's working. Does anyone know why?

Have you been able to reproduce this problem with any recent versions? Looking through the code, I can't seem to find a problem in the code where the wildcard is tested.


text:
Is there a list of available APIs for Bitcoin exchanges?
So far I have seen some Perl modules; Finance:MtGox and Webservice:MtGox for interacting with Mt.Gox, a Ruby gem for Mt.Gox and a Python based command line client for again, Mt.Gox.
I'm wondering if there are any other language APIs for other exchanges?
I'd especially like to find a Java API for more than one exchange.

@barrymac, why don't you make an answer to this question listing the ones you already know with a short description of each. People might add to you answer and we'll soon get a great list without relying on a link to somewhere else.

@Harpyon Well I might end up doing that, not sure the quality will be amazing though. The authentication mechanism is complicated and confuses me a bit. Also there's an issue with the SSL certificate that makes things annoying as well, you have to add an exclusion to a local trust store and add this to the JDK.

@D.H. I'll add what I know to the question with some links

@Harpyon, page not found... 404

There is now the XChange library
This is a pure Java library that has been released under the MIT license. It currently supports Mt Gox, but there are simple hooks to allow other exchanges such as Intersango and CryptoXChange to be supported.
It is currently used by the MultiBit client.

I have rolled my own mtgox api implementation in java. it is based on google-Gson and raw URL requests. i plan on releasing it eventually but the code is not yet on release quality level. if you have any specific questions, just ask in comments

I don't know of a currently existing Java API for Mt Gox - most folks will probably roll their own until Mt Gox issues their own demonstration client in Java.
However, in the interests of helping you make some progress in this area here is a short tutorial that may be of some use.
How to build a Java API for Mt Gox
You could just throw one together using the web API specification provided by Mt Gox.
Although the examples are written in PHP, the nature of the API is a bunch of simple HTTP requests which typically use JSON to transfer the payload.
For example the getDepth request
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN

will return a block of JSON that looks something like this:

{"asks":[[13.32937,46.25473014],
....
"bids": [[11.09752,1],[11.18583,259.5],
[12.64579,3]]}

which can be mapped to a Java object as follows
package org.example.mtgox;

import java.util.List;

public class Depth {
    private List<Asks> asks;
    private List<Bids> bids;

    public List<Asks> getAsks(){
        return this.asks;
    }
    public void setAsks(List<Asks> asks){
        this.asks = asks;
    }
    public List<Bids> getBids(){
        return this.bids;
    }
    public void setBids(List<Bids> bids){
        this.bids = bids;
    }
}

Add a sprinkle of JAXB annotations (@XmlRootElement and so on), plug it into the RESTEasy framework and it'll handle all the translation for you. Note that JAXB annotations allow rendering to XML, JSON and YAML - they're just markers. Barely a line of code to be written.
Incidentally, if you have a JSON input and you want a bare Java POJO generated from it, you can use the very handy JSONGen web service.
Shameless plug
If you want this developed more, then let me know and I'll see what I can do to help.

Thank you for your very informative post but actually I use groovy which has very convenient json facilities: 'getMtGoxSslClient().get(path: "api/0/data/ticker.php") { resp, json ->
println "BUY: " + json.ticker.buy
println "SELL: " + json.ticker.sell
}'

@barrymac Groovy is ideal for this kind of work. I only offered JAXB since you mentioned Java. Good luck with your project.


text:
Why is the phrase "Received with" used instead of "Received to"?
Even though I'm not a native English speaker, I feel that "received to" (some address) is more understandable or more naturally sounding to an average user than "received with". Is there any specific reason why "with" is consistently used in Bitcoin software?
As an analogy, if I own several e-mail addresses, I would naturally say I received an e-mail message "to" an address, not "with" it. The "with" variant seems to me to be a wallet's (ie. software's) point of view, not the user's; as in "I caught the ball with my left hand" which would be analog to "I, the wallet software, received the funds with this address". This might feel natural for a wallet programmer, but not the user.
I'm working on translating some Bitcoin software to Slovenian and would like to clear up some things like this before I make an incorrect or unclear expression get into widespread use in my language.

Normally you would use "to" to indicate the destination and "with" to indicate the mechanism. "I drove to New York with my car." In this case, all the funds went to the same place. The difference is the mechanism by which they are retrieved.

@David: I think it's the exactly the point made by the OP. If you look at how bitcoin currently works, (any forgetting about English grammar) bitcoins are rather received to (or maybe at) an address, than received with an address (the address is not just the mechanism, but the recipient).

See also this answer on whether the address should be considered a recipient or an internal mechanism.

This question appears to be off-topic because it is about the usage of English language. It should be asked on English.stackexchange.com instead.

I don't think "received to" is a correct phrase in itself. You can say that "a transfer was made to my address", "I received money with my address" but not "I received money to my address". Then again, you probably should ask this question on English SE.


text:
Help! I sent coins to my bitcoin wallet before it was properly synced!
I sent coins to my Bitcoin wallet not after installing it, but before it had fully synced! Then I closed and reopened it after sending the coins.
It had generated a bitcoin address to send to, but is that address "officially mine" prior to the program actually having updated and being "officially on the network"?

If you generated it, it's yours, so long as you don't lose the wallet file that holds the corresponding key.

As others have said it's no issue at all. If you want to look, go to http://blockchain.info and put the address in there so see what's happened on that address.

Yes it is, worry not.
The client can generate valid addresses without ever being connected to the internet.
When the blockchain finishes downloading, you should see the incoming transaction.

The sync of you wallet do not cause any trouble for retriving bitcoins. If somebody send you some bitcoins to your address and the transaction have been accepted you will receive you bitcoins when your client syncs.

The bitcoin client creates both a valid address and private key once it is launched. When it becomes fully synced your transaction will show up (or more specifically synced to at least the block that the bitcoin tx was initiated).
Your wallet can be left offline indefinitely, the private key that was generated will always hold that bitcoin until the wallet.dat is synced and the bitcoin is then spent.
Your btc balance is perfectly safe.

You have access to the private key to you shouldn't worry; you will recieve the bitcoin.


text:
How do I get started in finance & market analysis?
I'am currently new to bitcoin & doesn't any finance or market background, currently I got huge interest to how this currency system will affect our life, as I spend more and more time reading about bitcoin, then I feel I need more knowledge about how finance world work, and how to do market analysis.
Can you give me a point where I should start learning about finance especially the one is connected to this bitcoin things?

Are you asking to learn what types of information will help you in trading (speculating) on bitcoin or are you asking about factors relating to the currency's societal impact in general?

It's been ~1 month since this question was asked but I'm happy to announce that the Economics StackExchange site is now in public beta and might be a much better place for questions like this one :)

@DavidPerry unfortunately, it is now dead :/

Yes, but from their ashes arose Personal Finance & Money

Market analysis usually consist of Fundamental Analysis and Technical Analysis.
I recommend http://www.babypips.com to get started with the the Technical Analysis.
Fundamentals consist of understanding how the economy is effected by news and business. Social psychology to specific events and can vary depending on what market your looking into.


text:
Bitcoin client fails and reports some database recovery error
I am looking for somebody to help me fix my Bitcoin client, it is corrupt, reads :
"A fatal error occured. Bitcoin can no longer continue safely and will quit.
EXCEPTION: 22DbRunRecoveryException
DbEnv::open: DB_RUNRECOVERY: Fatal error, run database recovery
bitcoin in Runaway exception "

Have tried and tried to no avail to fix the damned thing and am at the point that I would like to pay someone to fix it for me.
How can I solve this issue?

If the problem is with the blockchain, the problem can be fixed easily.  If the problem is with wallet.dat the problem can range from trivial to impossible.
Even if your wallet.dat is corrupted, if you have a backup up wallet.dat, it likely holds all the private keys necessary to recover the funds.

Here's history on this: http://bitcoin.stackexchange.com/a/4703/153 It could just be the blockchain that is hosed. The user is not technical and thus why steps that would likely have resolved this haven't already been performed.

Would a solution be for someone to import your wallet.dat into BlockChain.info/wallet, and then you can access it and transact there?
That's an hour or less of work from someone, the problem is just that you'ld want someone trustworthy.

Your best best is probably to ask for help in the IRC channel, as Stephen Gornick mentioned here: http://bitcoin.stackexchange.com/a/4703/516 but the trustworthyness issue is important to consider


text:
Receiving dollars directly into bitcoin wallet?
Is there a way that I can set up my account to have my customers pay for services rendered in dollars directly into my bitcoin account via an online electronic funds transfer from their bank account?

BitPay appears to have an all-in-one solution that allows you to set up a store checkout in a lot of different currencies that will be handled through the use of Bitcoins. As I don't have a hands-on experience with that, I can't vouch for how the system works.
Another convenient way of setting up a payment system would be to use BitInstant which allows a user to quickly convert cash into Bitcoins through a variety of ways. It does not appear to be as automated as BitPay though, and you would have to handle your own payments.
Lastly, you can encourage your users to get their Bitcoins through more traditional means, such as the use of Bitcoin Exchanges. This option also requires you to handle the payments by yourself.

I checked out BitPay and I believe the setup that they provide is payments in bitcoin. I would prefer to accept payment in dollars into my bitcoin account and have my account convert to bitcoin. I want to encourage direct online payment for my customers seemingly as they would make any payment online. Customers unfamiliar with bitcoin would probably be scared away otherwise. My customers are usually one time customers and will likely be unfamiliar with bitcoin.

You can accept payments through OKPay.  The funds received can be used to purchase bitcoins at several exchanges which accept OKPay transfers (including Mt. Gox, and  others).

https://www.okpay.com/en/services/accept-payments

In the U.S., most consumers don't have "bill payment" where they can push an ACH transaction to any arbitrary bank account number.  There are several intermediaries which offer a bill payment option for businesses such as utilities and other businesses in which the funds are "pulled" from the customer's bank account.
Smaller businesses can accept the "customer push" payments capability by accepting PayPal, but the problem is those PayPal funds aren't easily moved to Bitcoin exchanges.  As a result, Dwolla becomes a good alternative -- as Dwolla funds received can be easily moved to Bitcoin exchanges.


text:
Why do I get `bitcoind: command not found` in Ubuntu?
I have built the bitcoin source on my Ubuntu desktop, and have installed the proper libraries via apt-get and building some.
When I do:
cd src
bitcoind -daemon

I get the error:
bitcoind: command not found

and when I do ./bitcoin I get:
bash: ./bitcoin: No such file or directory

What am I doing wrong?

Go to the directory with the bitcoind binary.
Make sure it's executable:
chmod +x bitcoind
Now run it:
./bitcoind -daemon

Also, if you want to just run bitcoind (without ./bitcoind), add it to your executable path:

As Andrew mentioned, first be sure to chmod +x bitcoind in your src directory.
Still in the src directory, run pwd to get the full path (for example /home/alex/src)
Add it to your .profile with echo "export PATH=$PATH:/home/alex/src" >> ~/.profile

Now you can execute bitcoind from anywhere in your system when logged with your user.

I put this line in my /home/chris/.bashrc file:
alias bc='/home/chris/src/bitcoin/src/bitcoind'

Then (after starting a new terminal) I can type just bc instead of bitcoind.  There's no need to edit your PATH variable if you use an alias like this.
You'll need to change the /home/chris/src/bitcoin/src/bitcoind bit to match the correct location of the bitcoind executable on your system.
It's also OK to do this:
alias bitcoind='/home/chris/src/bitcoin/src/bitcoind'

if you want to type bitcoind out in full to run it.  It may look like a recursive definition, but it's fine.

Note that aliases only work at an interactive prompt and do not work inside shell scripts.


text:
How does the wallet work, online and offline?
I've been reading about bitcoins and I've come across a few questions:

How does the wallet actually work? From what I can gather, I use the wallet as a centralized service to store recieved coins, and to send coins. If recieved coins are stored physically in the .dat file, what are the safeguards that prevent users from duplicating the .dat file and getting more coins?
Do I need to have the wallet client on to receive transactions? In other words, if i don't leave the wallet client active on my computer, will i be able to receive transactions the next time i open the wallet?

Cheers.

Short, and somewhat oversimplified, answer: Your wallet contains the credentials you need to spend received coins. It is not involved at all in the process of receiving coins nor would duplicates allow the same coins to be spent more than once.

Although wallets indeed contain your "coins", the ability to spend them is tracked by the network. Every fully validating node keeps a list of available coins on the network. They do not know who has which, only which (Bitcoin, not IP) address (or addresses) they are associated to. In case you try to spend the same coin twice - for example because you copied your wallet to another computer, and then tried to send a transaction from each - you may temporarily confuse the network. Some nodes may first see the one transactions and some others will see the others first. However, the strength of the system is that this disagreement cannot exist for long and only one of them will be accepted after some time.
The essential thing in your wallet is not the transactions, but the keys. Each address has an associated public and private key. These private keys never leave your wallet file and are necessary to spend the coins assigned to your addresses.
Because the transactions are tracked by the network, you indeed don't need to be online to receive transactions. The next time you connect, your client will ask the network for up-to-date information. During the synchronization that follows, your incoming transaction will be fetched, and the client will detect this as an incoming payment.

How is a bitcoin wallet - not a full node - able to "listen" to only those transactions that are relevant to it (i.e. Bitcoin addresses that this wallet 'owns')? Given that, there is no central system here, how are transactions filtered by what a particular wallet needs?

Either by using an indexing service for your wallet (e.g. Electrum) which is a full node, or by using BIP37 bloom filtering (e.g. Bitcoin Wallet for Android). Both options have terrible privacy.

What is an option with better privacy?


text:
Fundamentals of a Bitcoin Lottery
I'm relatively new to Bitcoin but love the idea and will soon be accepting bitcoin in my own companies. (We provide online training/e-learning.)
But, just for fun I've set up what I would like to call a Bitcoin Lottery. Its a simple website and simple rules/terms.

People pay bitcoin into the address provided on the site. (No names, no email, no forms to fill in.)
Each dBTC (0.1 BTC) counts as a vote.
The winner is chosen by a random number generator, obviously the more votes you have (the larger your initial payment/vote made e.g. 1 BTC = 10 Votes) the more likely you are to win. (If you paid 10 dBTC you would have 9 more chances to win than someone who only paid 1 dBTC.)
Winnings (negative a 0.01% management fee and any payment transaction costs) are paid to the bitcoin address that paid the winning vote/payment.

My main objective is not to make money, just to setup a simple lottery for fun.
My questions are:

Is my approach to this lottery a good idea, such as using each dBTC as a vote or should the vote amount/value be changed?
Would there be any technical difficulties when trying to send payment (winnings) back to the address that paid for the vote. (See the website http://winbitcoin.net for further details.) I would assume large transaction fees would be required as the total amount (winnings) would be made up of lots of smaller initial payments. (I think that's how fees work anyway.)
I understand that most of you are not lawyers, but aside from tax issues are there any other legal ramifications?
The fee I would be taking (the 0.01%) would properly not even be enough to cover hosting cost, this does not bother me ATM. Would a management/hosting fee be seen to be unacceptable, should there be no fee or a smaller one?
Should there be a minimum vote (e.g. the 1 dBTC) and a maximum vote, say 5 BTC?
The website has only just gone live, so may be a bit bare but I will be personally paying a few votes later on tomorrow :D

This question doesn't appear to be fit for StackExchange format, it would be better suited for Bitcoin forums, as it solicits user's opinions for some of its aspects.

I thought I'd risk 0.1 BTC. The transaction's had 7 confirmations, but the "total" on the website still stands at zero. Scam?

No, Its just updated manually, have updated it now.

Not very correct, a lottery consists on a pot, which has a reserve and a commission. Everything else is payed to players.

Whether or not a particular way to run a lottery is a good idea or not depends on a few aspects - whether it is fair, balanced, earns enough money, and whether the users think it is fun and rewarding. Generally, this is a question of game design, not Bitcoin. Probably it would be better asked on GameDev SE. What you described sounds cohesive, although you might want to adjust the fees depending on the costs you will be facing running the operation.
There are no issues with paying back an address that paid for the vote, as long as someone doesn't try to mine some Bitcoins directly onto your address, in that case sending the coins back would destroy them. This scenario is very unlikely.
You have to take into account the fees charged by the Bitcoin network - usually 0.01BTC per kilobyte. As your winnings might consist of potentially large amount of small Transactions in the future, this might take a toll on the profits. You should try simulating some heavier traffic and see how high the fees get for you.
From a legal problems - it's gambling, which means you should get a gambling license. I don't think it would really be worth the trouble "just for the heck of it". Alternatively, you can operate it without a license and face possible legal consequences in the future.

However, in the Bitcoin Qt it does not display where the payment is from? Can I use block explorer to find out the from address?

@hozza You can probably get the information from an API call - https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list , or search the Block Explorer with your address to find out the details - http://blockexplorer.com/a/4BTKGyZdcE . You really ought to look into automation through JSON RPC calls, otherwise the service won't be too popular, or will require too much of your time.

I think I read a warning somewhere that some online wallet services can't receive bitcoins back to the address they came from too. This might be an additional issue with paying back to the address that paid for the "vote".

almost no online wallet services will be able to credit coins to your account if they're simply sent back to the address they came from, since online wallets usually have a single large wallet holding all their customers' funds.  An exception is http://blockchain.info/wallet and perhaps a couple of others.


text:
How can I get more than 1 BTC on testnet?
The only way I know of to get testnet coins is through faucets such as the following.

https://testnet-faucet.com/btc-testnet/
https://testnet-faucet.mempool.co/
https://kuttler.eu/en/bitcoin/btc/faucet/
https://coinfaucet.eu/en/btc-testnet/

I found these faucets with a search. They seem to be actively maintained but only give 0.01 tBTC at most. Sometimes they are down or not working for me.
I would like to get at least 1 tBTC to test an application which is expecting more around 0.8 tBTC. How can I get more tBTC? I would be OK with paying for some tBTC. 1 tBTC would take a long time to collect using faucets, and I feel I am abusing their service.

There are no exchanges or services which sell testnet which I know of.
Instead of purchasing directly, mining hardware can be borrowed or rented to directly mine testnet coins. CPU mining is no longer a real possibility for generating over 1 tBTC.
The steps for mining testnet coins would be the following.

Setup Bitcoin testnet full node
Setup pool interface for mining testnet with a SHA256 miner (such as CoiniumServ or P2Pool)
Rent or borrow a SHA256 mining device to generate the coins
Get a testnet address for collecting mining rewards

Ironically, this will probably cost you time, effort and MONEY, but you should be able to get as much tBTC as is needed. Hopefully, there will be an open market for testnet BTC someday.
I also created step-by-step details on how I mined testnet coins which might be helpful.

re: "Hopefully, there will be an open market for testnet BTC someday.": testnet coins are an interesting thing: they are useful because they are worthless. If they were worth something, they would be useless. I don't think there will ever be a market for them in the way you are suggesting.

In fact, there have been times in the past where they got scarce, and traded for some (very) small amount of BTC. The test network was reset then, because this made them much less useful for testing.