text:
How to configure a bitcoind instance solely designed to contribute to the network?
I'd like to run a headless bitcoind instance on a server, in order to contribute to the network. Are there any specific configuration options that are recommended for that purpose?
My intention was primarily to make the network more secure by providing one more "good" node, though since I'm not familiar with some of the maybe more subtle aspects of the protocol, I'd welcome advice on other ways a single node would or could contribute.
I was not necessarily planning to run a miner.

Other than to make an attack more difficult, does this benefit the network at all?

I think you need to more clearly define what you mean by "contribute to the network". Do you want to 1.) mine, thereby contributing to the processing of transactions, even if you ultimately won't partake of much reward (unless your headless server has a decent Radeon graphics card), or 2.) simply act as a relay node?

I updated the question.

Generally speaking if you want to contribute you have two options:
Become a blockchain peer
The Bitcoin network requires the full chain to be available for download.  If not enough peers allow the full chain to be downloaded, this is a risk to the network.  This isn't CPU intensive but puts a small load on your network IO as a configurable number of peers download the data.
Namely you can run bitcoind  and allow inbound access to port 8333.  This will allow people to download the blockchain.  If you see options to run as a "server"  know this runs something different on port 8332 and is considered "sensitive" and should be secured.
I like to visually check on on the process so here is the command I run:

bitcoind -debug   -logtimestamps   -printtodebugger -printtoconsole

If your computer can handle it, edit the bitcoin.conf file (location is platform specific) to allow more people to simultaneously connect.  Edit maxconnections= to whatever you think is best.
Mine
There isn't much use in mining unless you have a FPGA, or ASIC for Bitcoin.  These rigs are more specialized and competitive.   Take a look at www.butterflylabs.com for an ASIC miner that can plug into your USB port

Under no circumstance should you ever enable the built-in miner, except for reference or testing purposes. It is not maintained, not optimized, does not support pools, GPUs or FPGAs. It solely runs on your CPU, and even for just that there is better software available.

@PieterWuille I use it on the Test network, and asked several questions regarding the same here.  Is there a better app for bitcoin test network mining?


text:
Which public extended key should I use?
I'm trying to make sense of the information shown here and how the extended public keys work.
The web wallet I'm using only supports this derivation path m/44'/242'/0'/i', so if I understood correctly:
(1) It doesn't matter what the index for the coin is, the extended private and public keys should be the same for all coins, that's why the same seed words can be used for all coins in the HD wallet.
(2) Since the derivation path used on the web wallet has hardened derivation in some indices, the extended public key won't be able to generate the same addresses available on the web wallet.
Imagine I want to share a key with someone that would allow them to generate the same addresses available for my seed words on the web wallet, but without allowing them to send any transactions. Is that posible? Which derivation path and extended public key should I use? Say for instance for this random 24-word nemonic phrase:
guitar letter tuna oppose
mushroom affair sock adjust
couch plunge angry ladder
evolve dial only maximum
stereo drama final public
become manual pelican glue

Hardened derivation means that you need to have the private key in order to generate the derived public keys. When you share the private key, you also enable the other party to spend, though. If you want others to be able to derive the public keychain, you cannot use hardened derivation.

Imagine I want to share a key with someone that would allow them to generate the same addresses available for my seed words on the web wallet, but without allowing them to send any transactions.

I'm pretty sure what you suggest is not possible.
The only single datum of information from which you can produce all the addresses is the one that also allows you to spend money.

source: Stack Exchange

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

sort: votes


text:
Multibit - Failed to create a Selector
I installed MultiBit a few weeks ago and today it's not loading anymore. It displays the following Error in the logs:

    The Blockchain "C:\Users\USER\AppData\Roaming\MultiBit\multibit.spvchain" could not be loaded. The Error was "org.jboss.netty.channel.ChannelException Failed to create a selector.".

I already tried deleting that file and then let multibit recreate it, but it doesn't help.
What am I doing wrong?

Can you see if you are using an older version of Java ? If you do 'java -version' on the command line you should see a version number something like : 1.7.0_40-b43. If it is significantly older than that e.g. 1.6.x then it would be worth updating it and trying again.

It says
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

It sounds like there is a problem in the locally stored block store file.
You should be able to solve this by doing the following:
Find where MultiBit is storing your user data - this is shown on the very first line in the 'Message' tab when you start up MultiBit. (It is also explained in the help in 'Troubleshooting'.)
Shut down MultiBit
Go to your MultiBit user data directory - worked out above - and delete the file multibit.spvchain
Start up MultiBit again
MultiBit then syncs from a month or two ago and you should be running ok at that point.

I already tried it

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


text:
How can I convert Bitcoins for withdrawal to PLN
For years we've been paying exorbitant fees just to transfer our own hard-earned money from one country to another.  I'm in Poland at the moment and find I need to transfer funds from my US checking account to a local one (mBank) regularly to pay family bills etc.
Citibank for instance quietly dings me over 2.5% lower exchange rate than the current central bank rates, and about an additional 3% for "foreign transfer fee" against my account.  No credit card--That's just using my ATM/debit card at a "local" Citibank S.A. teller.  I would prefer a bank-to-bank xfer (not an expensive wire xfer) rather than have to drive to the city anyway, only during that one ATM's operating hours etc.
  Paypal is not much better.
Can Bitcoin be used as an intermediary?
USD --> BTC --> PLN

I like the idea of going through two exchanges ACH'd to my bank accounts on each side, but do their transaction fees and currency conversion rates make it worth the while?
Also, apparently last year 2011 there was still one online service able transfer PLN to/from your Bitcoin address, now they are shut down.  Anyone know others methods to cash out of BTC in PL?

MtGox took that exchange over, and they seem to also own their bank account (in BZWBK I think), so it might be an option, although an unconfirmed one.

Intersango trades BTC/PLN and offers free domestic withdrawal as PLN.

https://intersango.com/fees.php
https://intersango.com/orderbook.php?currency_pair_id=4

ACH & Dwolla support, via local USA account (@JPMorgan Chase). On Polish side: advertise free xfers but from London-based account (@Bank Zacodni).  mBank.PL fees are likely.

Also their Bid/Ask tables for USD and PLN show very large spreads, on order of 10%, and low volume. ==> Illiquid. Maybe this is due in part to nature of BTC

Not free trading anymore. Recent fee changes: 0.65% of all trades.

https://www.facebook.com/events/194390124098344/199472600256763/?comment_id=199525860251437

The answer is yes, if:
1) You can find local sources to convert to and from Bitcoins;
2) The total cost of those two conversions is competitive; and
3) The risk, delay, inconvenience and other such factors are favorable or at least manageable.
I think in many cases, point 3 may be the killer.

This is not an answer to your question, but an alternate way.
Where I live I can get an ATM card for free (no yearly fee) but with a withdraw fee if
abroad ($5?). I tranfer this card and its code to the relative that needs money (I
brought it with me when I visited last time); this is most probably not approved/legal
from the bank's view.
Now the relative can get ~$200 (maximum withdrawal amount per withdrawal) for ~$5, a
"fee" of 2.5%.

For a short period around 2006-07 I was able to have my fam in PL use my one and only permitted Citibank ATM card withdraw PLN from Citibank S.A tellers completely free, and at mid-market rates better than at kantors(xchange kiosks everywhere). Eventually they started charging 2%, then 3.x%, then plus other junk fees, etc. Good suggestion but our trouble is in finding dispensers of USD not PLN--just doesn't happen around Kielce.

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


text:
What were IP transactions supposed to be useful for?
Besides sending BitCoins using wallet addresses, there used to be another way, through IP transactions as described in the wiki.
The disadvantages were obvious (man-in-middle attacks etc).
However, were there any benefits (to the individual or to the whole system) in using IP transactions?

You can donate to TOR exit nodes for example ;).

First, it needs mentioning that this functionality has already been removed from the original Bitcoin client.
Here is the GitHub pull request removing this functionality that has been accepted 2 years ago. The wiki page you refer to seems outdated.

The only known use for IP transactions I could find is the one mentioned in the pull request by gmaxwell:

Aww. The removal of this would mean we can't run a lottery for nodes running the most recent version of bitcoin as an incentive to make people upgrade. :)

Another use I can come up with myself would be that you could use the DNS system to create a human-readable address to your IP and use that as your payment address. F.e. I could use bitcoin.stevenroose.be and put the IP address of the computer running my Bitcoin client in the DNS table for that record. I could then tell people to send bitcoins to that address. However, this method would require a PC to be permanently running and connected to the network in order to be able to receive bitcoins.

@Pacerier I'm sorry, I read your question wrong. Edited my answer.

IP transactions have been disabled for a long time, and since 0.8 even removed entirely from the source code. The reason was mostly security.
However, there is now work on a payment protocol, which is a much more advanced evolution of IP transactions, with built-in (but optional) authentication support.

It's not safe, so you should not use it.
But you are asking about a possible applications...
You could, for instance, integrate IP payments with a bit torrent client, so the people who send you the most of the data would get an incentive for the service they provide you with.


text:
How do I export my private keys from my Bitcoin-Qt client?
Trying to use this posted method:
To export a private key from your Satoshi bitcoin-qt client:
launch your bitcoin client as usual and wait for it to load the blockchain and start up
click on 'help' in the menu bar (top right)
click on 'debug window'
select the 'console' tab
type: walletpassphrase "your walletpassphrase here" 600
type: dumpprivkey [your bitcoin address here]
this will return the private key, you can copy it now; ensure you clear your clipboard/history afterwards
type: walletlock

I do not understand what "your walletpassphrase here" means.  I do not have a wallet pass phrase to the best of my knowledge.
Also, I am a bit of an amateur at this and I still don't understand the "your public key here"..... is that the address that corresponds to your wallet? [Update: Yes, the bitcoin address.]
Trying to export the private key to another wallet because the bitcoin wallet has taken 2 days to sync and is still not done.
Any help would be very appreciated.

You shouldn't be touching keys. This is something that only someone debugging the wallet software should do, and you risk compromising your security and/or losing your bitcoins if you try to mess with them!

I believe that listreceivedbyaddress 0 true does not list the change addresses that are created as part of the normal client operation.
Starting from bitcoin 0.7, you should use bitcoind listaddressgroupings to get all the addresses, and then follow up as usual with dumpprivkey.

If you never encrypted your wallet, then you don't need to do the "walletpassphrase" command.  That's only needed to unlock the wallet if it is protected with passphrase encryption.
As far as the public key for dumpprivkey, that is asking what Bitcoin address you want the private key for.
To get the list of Bitcoin addresses in your wallet, you can use:
listreceivedbyaddress 0 true

This is not good enough, as I found today. I believe this does not list internal change addresses that bitcoind creates when sending outgoing transactions. Starting from bitcoind 0.7, you can use listaddressgroupings, which lists all addresses.

After you use the console command to export your private key you'll also need to execute another console command to import it.  Both commands are listed below.
Command to export your private key:
dumpprivkey YourBitCoinPublicAddress
Command to import your private key:
importprivkey YourBitCoinPrivateKey
When I was trying to figure this out I found a list of all Bitcoin console commands.  It's below for your reference.  All of the console commands can be executed by opening up your Bitcoin wallet software, click on help, then Console.
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

dumpprivkey takes as an argument the public address and returns private key for this address - if you own it in this wallet.
So you can get private key for each given public address in this particular wallet.
If you want to get more private keys from this wallet just dump the wallet with command dumpwallet filename.ext. You will get private keys and corresponding public addresses for the whole wallet.
Surely DO NOT share any of the private keys with anybody!

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


text:
Auto formatting data into sendmany command
Apologies for the newb question.
But what's the best way to convert data on spreadsheet (lists of addresses and corresponding amounts to be sent), into a format suitable to be entered as a sendmany command into bitcoin console with the minimum amount of steps?  Ideally would handle any amount of addresses and amounts.
Thanks in advance if anyone can help out at all!
ie
from
1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ     0.01
1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz     0.5

to this
sendmany "" "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.5}"

You can export the spreadsheet as a CSV file, then parse it using your favorite programming language into a dictionary. Convert the dictionary to JSON, and that will give you the second argument to the sendmany command.
I'd do this in Python using the built-in csv and json packages.
I'm not aware of any solutions that will do this if you don't know how to program, though.


text:
bitcoind calls walletnotify before it's ready to process API calls
I have a walletnotify configured with bitcoind.
When I start bitcoind this scipt is being called which in turn does bitcoind requests.
However, in the startup phase, bitcoind calls the walletnotify script too early, before is is actually ready to process regular RPC API requests.
In response to the request, bitcoind delivers  HTTP/1.1 500 Internal Server Error.
bitcoind version: bitcoin-0.11.0 linux-32
Help appreciated, or someone does a fix in bitcoind engine?


text:
Running out of memory, how can I reduce the size of wallet.dat?
My wallet.dat is 260MB big. I am using 32bit bitcoind (bitcoin-0.10.2), linux.
Bitcoind is having memory problems:
 ["errors"]=>
  string(89) "EXCEPTION: St9bad_alloc
std::bad_alloc
bitcoin in ProcessMessages()

Current memory allocation:
  2.9 GB virt, 2.3 GB virt.
How can I resolve the memory problem? Can I delete old unused addresses?
I did not find an API call to remove old addresses.
Probably bitcoin-0.11.0 does not resolve the problem either, it has already nearly same values: 2.45 GB Virt, 2.1 GB Res.

Why's your wallet.dat so big? Are you automatically generating addresses?

No i try to reduce the amount of newly generated addresses meanwhile. But this strategy does not help me because it is already too big. I want to reduce it, please help how can i do it?

Is there a light weight implementation which can load the wallet.dat from the bitcoind?

Are you certain that the size of wallet.dat is the cause of the problem?  If you stop bitcoind, move wallet.dat out of the .bitcoin directory, and start bitcoind again, does it use much less memory? By the way, you can temporarily get it working (although perhaps slowly) by adding swap.

There is no built-in way to delete addresses as far as I know - probably this was considered too dangerous.  Roughly how many of the addresses in the wallet do you need to save?

Hi there,SWAP does not help, the limit is under 32bit processes 4GB ram minus few MBs. Yes wallet.dat is the problem, without wallet.dat the process is using less than1 GB virt. As it sounds i need to create a new wallet.dat and import from the old one. And by this discarding unused addresses. But the transfer progress will be error prone. Sounds like huge problem, dam.

Now after a restart with bitcoin-0.11.0 only 900M virt is used. Is it possible that someone attacked my wallet? I have read up with in memory transactions or something ... .  Actually i saw many wallet conflicts warning

Is your wallet.dat is so big because of many privkeys/addresses or because of large number of transactions with them? These are two different problems. Each of them has own solution.

dont know whats taking more memory, addresses or transactions. Addresses are about 150k addresses, the rest must be transactions. currently process is taking 1150MB virt, so it must be temporary data which has filled up the memory. because the 4GB virt limit was reached before restarting bitcoind

Did not have the problem anymore with bitcoind version bitcoin-0.11.2. Maybe it has been resolved

Bitcoind uses a lot of virtual memory, due to having multiple threads, and maintaining several node-wide and per-peer caches of data (UTXO cache, mempool, relay cache, network buffers, known invs list, ...).
Until recently, many of these were effectively unbounded, depending on network conditions. The upcoming release of Bitcoin Core 0.12 has far better internal memory accounting, UTXO set limiting, mempool limiting, and more compact internal representations.

Core v0.23 on debian fully synced,pruned uses 4.2GB virtual mem and 250MB real mem, that's a huge overhead. progress=1.000000 cache=65.1MiB(438170txo)

The bitcoin version 0.11.1 (linux 32 bit)  seems to deal better with the memory, so i amnot having the problem anymore

A bitcoind restart helps. The memory consumption grows over time, after a restart it will start growing again but you have some weeks of operation to go. memory growth rate depends on what is going on the bitcoin network.


text:
Get available exchange rates of Ripple's built-in exchange
I'm not hundred percent sure I got the whole principle of Ripple right. But as far as I could understand it is possible to deposit a currency into my ripple account/wallet via a gateway (e.g. USD via snapswap.com) and then send that currency to another wallet/ripple account and get it exchanged automatically.
For example I want to deposit 1 USD via snapswap.com into wallet1 and then send 1 USD worth of EUR to wallet2. This way, the owner of wallet2 receives my payment in EUR.
My first question would be:

Did I get this right, that it is possible to exchange a currency within the ripple network? Or is it that you have to convert your currency before you deposit into your wallet? In my example convert USD to EUR then deposit into wallet1 and send EUR to wallet2.
Is there a way I can see the exchange rates the ripple network can offer my for any currency pair? e.g USD / EUR.
I want to know if there is a way to get the exchange rate at which my USD will be converted to EUR, before I send the USD / EUR to wallet2. Or, do I have to send my money haphazardly?

Did I get this right, that it is possible to exchange a currency within the ripple network? Or is it that you have to convert your currency before you deposit into your wallet? In my example convert USD to EUR then deposit into wallet1 and send EUR to wallet2.

Yes, you got it right. Ripple contains order books for any pair of assets.

Is there a way I can see the exchange rates the ripple network can offer my for any currency pair? e.g USD / EUR.

The best way is to attempt the conversion in the client. If you try to view the exchange rates, you will see only a small subset of the available liquidity.

I want to know if there is a way to get the exchange rate at which my USD will be converted to EUR, before I send the USD / EUR to wallet2. Or, do I have to send my money haphazardly?

You can estimate the exchange rate by viewing order books in the client or on Ripple charts. But there are a number of reasons why the rate you actually get may not be the rate you see. For example, the best rate may be by exchanging USD for XRP and then buying the EUR with the XRP. The conversion function uses pathfinding.
Also, note that there's really no such thing as USD or EUR on the Ripple network. There are assets denominated in USD or EUR, and there may be more than one of each. The actual exchange rate you get may depend on the precise asset combination you are trying to exchange, not just which currencies it's denominated in.
You would expect an asset issued by a major exchange to be available for very close to face value and you might expect to get near face value for it. But there can be small variations. Providing assets widely valued near face value is essentially the purpose of a gateway.

Thank you for your quick answer David. So to sum it up, you're saying that it isnt really possible to see the ex-rate of e.g. USD/EUR because Ripple doesn't  nessesarily the direct path USD->EUR but could also take USD-XRP-EUR or others ? So I could try it with my client and see the aproximated prices. But if I want an exact exchange rate I need to convert my currency before I deposit into my wallet. Did I get that right ? Sorry my english isnt the best.

@user3187049 Yes. You can look at the direct offers between the exact two assets, but Ripple's convert capability can use much more than that. Look here

The link you gave me is for the exchange rates of some gateways right? Me thought now is: even if Ripple exchanges one pair of currency on the best possible path for the client there has to be kind of an order book for all pairs of assets e.g usd eur or at least eur/xrp and usd/xrp. So everytime ripple tries to exchange usd into eur a demand for eur is created. Now I asked myself if I can see these order books to satisfy this demand for eur with the eur I have in my wallet and get the usd that were bid therefore.

I want to use this to do some arbitrage between the internal exchange and an external exchange.
But I'm not sure if this is possible without converting my pair for the first time in the Gateway instead of converting it within ripple.

@user3187049 You can see the order books in the client.


text:
Bitcoin, detecting deposits to the node.js server (code review)
I'm trying to detect deposits that user will made. I explained it with comment lines in below.
Can you are there any flaw in it?
var _ = require('underscore')

var check = function(client, site) {
    // check last 10 transactions
    bitcoin_client.cmd('listtransactions', '*', 10, function(e, transactions) {

            if (!transactions) return;
            var TRANSACTION = transactions.transactions;

            for (var i = 0; i < TRANSACTION.length; i++) {
                depositDetector(i)()
            };

            function depositDetector(i) {
                return function() {
                    //check if it's received
                    if (TRANSACTION[i].category == "receive" && TRANSACTION[i].amount >= 0.00000100) {

                        var txid = TRANSACTION[i].txid
                        var address = TRANSACTION[i].address
                        var amount = TRANSACTION[i].amount
                        var confs = TRANSACTION[i].confirmations

                        // find it in deposits database

                        deposit.find({
                            'txid': txid
                        }).exec(function(e, _deposit) {
                                // if there is deposit with that txid's
                                //save their confirmations
                                if (_deposit.length > 0) {
                                    _.each(_deposit, function(a) {
                                        a.confs = confs;
                                        a.save() //confirmations updated
                                    })

                                } else { // the txid is new, find user with it's address
                                    //and update user with that transaction amount.

                                    user.findOneAndUpdate({
                                        'btc_address': address
                                    }, {
                                        $inc: {
                                            'btc_balance': amount
                                        }
                                    }).exec(function(e, _user) {

                                            // !e && save deposit to database / finished

                                        }
                                    })

                            }
                        })

                }
            }
        }
    })

}


text:
Electrum 2.0: non-BIP39/32 standardisation complicates matters immensely. Why?
Electrum 2.0 has been causing me some frustration, insofar as it seems to be a non-standard implementation of BIP32/BIP39 (HD wallets, mnemonic seed, respectively). The wallet in question is a 2of2 multisig wallet (all P2SH), with the 2nd extended public key being created in pybitcointools using
bip32_privtopub( bip32_master_key( sha256("a password") ) ),
then imported into Electrum.
Given the 13 word seed, which itself is non standard since the last word is a checksum, it's proven impossible to export the xpriv key from Electrum.
How is a mnemonic seed converted to a BIP32 standard extended private key (given the client itself won't allow it)? : EDIT1: with great difficulty, see my answer below
(REFOCUSED) QUESTION: *why does Electrum:

stray from BIP0039?
make exporting the master BIP32 private key impossible?
return partially signed P2SH hex Txs which are malformed?

There is an alternative way to extract the master extended private key (xprv): in the Electrum console, simply type this:
wallet.get_master_private_key('x/', gui.password_dialog())

Or for the master private key of a wallet created with Electrum 1.x, it's:
wallet.get_seed(gui.password_dialog())

Warning
Don't ever type your password or a private key into the console. In other words, don't do this:
wallet.get_seed('my-password')

Everything you type into the console is temporarily stored inside your wallet file unencrypted to make the command history feature (accessed via the up-arrow) work.

Where on earth did you find that?! Nice work!

Thanks! Someone on Bitcointalk was asking how to do this today, and I thought I'd dig around the Electrum source a bit to see if I could figure out a better way to do this before responding. Afterwards, it made sense to update this answer and get rid of the not-so-safe method that was here before.

wallet.get_master_private_key('x/', None) with no password FWIW, not ""

Thomas Voegtlin , the developer of Electrum explains the reasoning in the first 10 minutes of this interview. I think he also posted same thing to Bitcoin dev mailing list some time ago.
https://letstalkbitcoin.com/blog/post/epicenter-bitcoin-69-thomas-voegtlin-electrum-spv-wallets-and-bitcoin-aliases
His main point against BIP39 is that it doesn't include a version number, and the requirement of the word list dictionary in order to implement it.

Note: July 2017, Electrum v2.8.3... the command is now:
getmasterprivate()

The password dialog box will automagically pop up ;)

Hi HCP, welcome to Bitcoin.SE, and thanks for the update! We usually try to fully address the question in each answer, so, if you could add a little more explanation that would be great. If you just want to update a small part of an existing answer, you can also suggest an edit on it.

I just found this over at /r/Bitcoin:, so apparently there's an exe to do this, but I'm not exactly game, since downloading the link got flagged by chrome.
It appears Electrum uses: m/0/0 for wallet addresses and m/1/0 for change addresses.
EDIT: A pull request has been submitted for code which extracts the root seed from the Electrum 2.0 seed phrase:
def electrumv2_extract_seed(words, password=''):
    """Takes Electrum v2.0 13 word mnemonic string and returns seed. Only works on English for now"""
    # clean-up unicode characters
    mnemonic = words[:]
    try:
        mnemonic = unicodedata.normalize('NFC', unicode(' '.join(words.lower().strip().split()))).encode('utf-8') # a string of 13 words
    except Exception as e:
        raise Exception(str(e))
    rootseed = pbkdf2.PBKDF2(str(mnemonic), str('electrum' + password), 2048,  macmodule=hmac, digestmodule=hashlib.sha512).read(64)
    return rootseed

def electrumv2_mnemonic_to_mprivkey(words, password=''):
    return bip32_master_key(electrumv2_extract_seed(words, password=''))

This is for use with pybitcointools as from bitcoin import * in Python 2.7


text:
Can we use a Paper Private Key that has been loaded in the Bitcoin client?
Okay, I want to start offering Bitcoin as a payment option on my e-commerce site. For now, I just want to keep it simply as an option for those overseas customers who don't have credit cards/PayPal so I don't anticipate a high number of transactions. I have gone to Bitaddress.org to generate a bulk wallet, I have loaded the private keys (together with the related public address) on a USB drive and on an old non-networked computer. I plan to email a new Bitcoin address to each customer that wants to pay by Bitcoin. I have loaded a list of these addresses into bitcoinmonitor.net so once a customer pays I get an email notification after 4 confirmations and then I can ship out the product.
2 Questions:

How can I install Bitaddress.org on my non-networked computer so I can generate future paper keys without even being online, for added security? I know it's possible, but if anyone can help with a step by step would be great.
I do have the regular Bitcoin client. Eventually I may want to consolidate all these coins into one wallet but still be secure. So I figured I could then import all these private keys into the wallet that is part of the Bitcoin client (using these steps https://en.bitcoin.it/wiki/How_to_import_private_keys_v7%2B). The question is does the private key somehow change upon import? To put it another way, if the computer which runs the Bitcoin client explodes, and I did not backup the wallet.dat file, am I still safe, because the private keys that are kept on my USB or even just written down can still be used? or did the action of importing the address somehow change the private key? If it is safe, I suppose there may still be a little loss of bitcoins if any "change" transactions created new addresses? Any help is appreciated (including any problems you see with my plan). I can't program (even html), but I am very excited about Bitcoin!

1.) The web page at BitAddress.org can be loaded from a file on a thumb drive or other storage.   Most browsers let you save the web page using a View Source (right click maybe), and then Save File to a thumb drive.
Then from the offline computer you open the file from the browser and the BitAddress page will load.
2.) The private keys don't expire or invalidate after they've been imported into the client. You correctly identified the problem with that is how if you spent any of the incoming funds, the client creates a new address for "change" and thus the wallet may show a balance that includes funds not in any of the addresses from the imported private keys.  So wallet backups are still important.

Random numbers are used for all sorts of things besides games.  They can be used in integration (finding areas and volumes), gambling simulations, determining lottery results, testing how something behaves under a variety of conditions. Then there is cryptography when you don't want anyone to guess what they were.
In other words, other people need higher quality than you do.
see http://mindprod.com/jgloss/truerandom.html
http://mindprod.com/jgloss/pseudorandom.html

Why do you need to use bitaddresss.org you could simply use a tool that generate key from your offline computer? The tool I think would fit is pyWallet, you just need to start ./pywallet.py --web (you need python installed) and access:
http://localhost:8989

But if anyone would be able to tell us a better graphical offline wallet manager it would be nice.


text:
Why are fiat Currencies inflationary and Bitcoin deflationary?
Why are all fiat currencies inflationary, and lose value with time? Could governments make them deflationary? What are the advantages of inflationary currency compared with deflationary currency?
Why was Bitcoin chosen to be deflationary (limited number of total coins)?

There are many causes for inflation, but the two most often agreed upon, according to Investopedia, are these:

Demand-Pull Inflation - This theory can be summarized as "too much
  money chasing too few goods". In other words, if demand is growing
  faster than supply, prices will increase. This usually occurs in
  growing economies.
Cost-Push Inflation - When companies' costs go up, they need to
  increase prices to maintain their profit margins. Increased costs can
  include things such as wages, taxes, or increased costs of imports.

Fiat currency inflation absent these forces can be driven by the creation of money through speculative fractional reserve bank lending practices as well as simple "printing of money" by the central bank responsible for a government's currency. It is in the interest of the government's ability to spend that it be able to freely create money out of nothing, which is the veritable definition of fiat, Latin for "let it be".
Advantages of inflation include:

Steady rise in prices
Steady rise in value of non-liquid assets, e.g. not cash
Supposedly an indicator of growth

Disadvantages of inflation include:

Cost of goods increases because one unit of money does not have as much purchasing power as it did previously
Decrease in the value of stored liquid assets, e.g. cash in a non interest-bearing account
Potential for hyperinflation

Bitcoin's deflationary quality is based on the assertion that a currency must have scarcity in order to be valuable. By limiting what amount can enter the system, it ensures that no individual can increase the supply and inflate the value relative to physical goods.

Fiat currencies are inflationary by design, so that people don't hoard currency. The more your money loses value every year, the less likely you are to keep it sitting in a bank. This availability of money in the market encourages the growth of the economy. When money is easy to borrow, entrepreneurs and businesses can use it to hire/build/invest, and pull forward developments that would otherwise have taken much longer.
This comes with the drawback that an increase of availability of money in the market causes an increase in prices and risky behavior, which as we know from history, can be very bad.
The US government tries to keep the inflationary nature of fiat currencies in check by regulating the interest rate from the root source of all money, the federal reserve bank. You can think of them as an infinite source of money which can be borrowed at a cost: the interest rate. When they increase interest rate, it increases the cost of tapping into that money, which slows down borrowing, hiring, investing, etc. If done too severely, it can result in a deflationary spiral.
As for why bitcoin was designed to have a fixed supply, I do not know. However, I can speculate two reasons. The first reason I can think of is simplicity. Since bitcoin is designed to be decentralized, it's not obvious who would play the role of the federal reserve. So, maybe Satoshi shrugged and said, let's just keep the supply fixed to start. The second reason is to give early adopters an incentive to start mining, akin to mining gold (Satoshi makes this analogy himself in his original paper).
What's interesting to consider is what if you made a cryptocurrency whose supply wasn't fixed, but rather expanded and contracted like fiat currencies. This was proposed in this paper, which is quite well-written, whether or not you agree with it. I am not an expert so I'll keep my opinion out of this post.


text:
How do transactions leave the memory pool?
How does my bitcoin core client know when to drop a transaction from the memory pool?
Is it as simple as a specific period of time?

As of Bitcoin Core 0.14.0, these are the ways a transaction can leave the mempool:

The transaction was included in a block.
The transaction or one of its unconfirmed ancestors conflicts with a transaction that was included in a block.
The transaction was replaced by a newer version (see BIP 125).
The transaction was at the bottom of the mempool (when sorted by fee per size), the mempool had reached its size limit (see the -maxmempool option), and a new higher-fee transaction was accepted, evicting the bottom.
The transaction expired by timeout (by default 14 days after entering).

Also, transactions that have left the mempool can always enter them again. For example, when they're part of the local wallet and get rebroadcast, or when they're received again over the network. Eviction does not imply a transaction is cancelled.
Since Bitcoin Core 0.14.0, the mempool is saved to disk, so it persists across restarts. In earlier versions a restart would also result in a wiped mempool.

How can one change the timeout?

Using -mempoolexpiry=N with N in hours.

I think the default timeout for transactions has been increased to 14 days, right?

@Murch It seems like from 0.14, it's 14 days, according to this reddit comment.

@murch
Will evicted (or deleted) tx by timeout enter into mempool again?

@zono: Yes, if they are rebroadcast and exceed the minRelayTxFee that you require for transactions.

There is no fixed expiration time for each node, but the default setting is 72 hours.
https://bitcoin.stackexchange.com/a/43165/24926

In my particular case (unconfirmed not broadcasted transaction in memory pool of bitcoin core 0.14.1) the only way to remove that transaction was to delete mempool.dat after wallet close.
So deleting mempool.dat effectively forces transactions to leave memory pool.


text:
Bitcoin cash transaction
I have sent 0.05 Bitcoin Cash from my local wallet to Cex.io . what happened is that it also reducted my Bitcoin amount with -0.05 BTC. What can I do to get back my bitcoin amount?
I use Bitcoin Core- for BTC and Bitcoin ABC for BCH
Status of transaction in Bitcoin Core transaction is like this:
Status: 4/unconfirmed

can you provive more info? addressed, txid, screenshots? because replaying (duplicating) transactions in BTC/BCC networks can not happen

Transaction ID: 581694dcf694c55b51218b4b7850f13071038250761a53beaf47ed4e5f5f44d2

this id exists only in bcc-network, funds on your address in btc-network were not moved. something is wrong with your local wallet btc-software - it shows you incorrect info

Bitcoin Cash transactions are Bitcoin Cash transactions while Bitcoin transactions are Bitcoin transactions, they're different. Your Bitcoin Core shows that transaction probably because Bitcoin ABC and Bitcoin Core uses the same datadir. Your 0.05 BTC is still there, it's just your confused Core client. All you need is to rescan Bitcoin Core (making Bitcoin Core reset its transaction history cache and re-searching for transactions). You can rescan as explained by BookLover's #9 reply on https://bitcointalk.org/index.php?topic=171390.msg1820287#msg1820287 (Please use the shortcut once, or you'll rescan many times and waste time)
Next time, add -datadir=C:\meh\BitcoinABCdir to BitcoinABC's shortcut, as described by Booklover's reply, you just read. (Use this shortcut permanently)

rescan didn't helpped

and you are right my ABC and bitcoin core use same dir

Are you sure that you rescanned Core?

before starting ABC client I made a backup of bitcoin folder. now I tried to change the bitcoin directory for Bitcoin Core - and now everything is ok. Shows me correct balance.

I used this command "C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir=E:\Bitcoin


text:
How to claim bitcoin cash for Bitcoin Wallet backup created before 1st August2017?
I use this bitcoin wallet for android for my bitcoins..

I had created backup well before 1st August 2017 from Safety>>Backup My Wallet..
The backup is encrypted with name
bitcoin-wallet-backup-2017-xx-xx
How can I claim Bitcoin Cash for these bitcoins?
I have read about decrypting wallet using openssl but output is random symbols since the wallet is in protobuf format..
Can you explain to me the procedure for claiming bitcoin cash in detailed steps?
I use Ubuntu 14.04 as my OS on laptop if it is needed for decryption process..
Also now If I move these bitcoins to another wallet, say Electruk them Can I use the other simplified process? Or I have to use that baclup Bitcoin Wallet for android?


text:
What Income Could I Expect as an OTC BitCoin Trader
How long is a piece of string?
Given "typical" UK market conditions, if I wanted to trade BitCoins as an OTC trader (via LocalBitCoins, IRC etc) - what income could I expect? £10/day? £100/day? £1000/day?
Just looking for a finger in the air guesstimate.

After the withdrawal of Mt. Gox and Intersango from having a domestic bank transfer method for those in the UK, there has been a widening need for local trading.
There are two exchanges that sell bitcoins and take Barclay's Pingit for payment, Blockchain.info/wallet and a new one, BitcoinFridge.co.uk, so any local trader is competing with those methods.
But for face-to-face cash trading, that is just like any retail operation where the key to success is location, location, location.
If you look on LocalBitcoins for London, there are a couple traders showing a history of completing hundreds of transactions, and the vast majority of the remaining traders with just a handful of completed trades.  Without knowing the timeframe for that and average purchase amount it is tough to compute earnings (profit).  It appears that there isn't much more liquidity above a 7% deviation from the market price, so that will be a limiting factor.
But there is an increasing level of local trading occurring, and buyers gravitate towards sellers who are established.  So starting sooner rather than later gets to that "established" level before the latecomers.
Also, there may be an opportunity to serve as a broker to other traders.  For instance, casual traders may have orders too big to accommodate themselves, but could fill the order with an affordable local source of bitcoins that are sold in larger amounts for maybe just a few percent premium over spot.  That's possibly where the biggest opportunity lies (albeit it would also be where the largest capital requirement, for inventory, is necessary as well.)


text:
Where can I register a domain and pay with bitcoins?
Where can I register a domain name and pay with bitcoins?
(The question is about usual domain names, not .bit maintained by the namecoin network.)

I've closed this because it is a Shopping List question: These type of questions can never have a definitive answer, answers outdate quickly, and as shown yesterday, they tend to attract spam. Questions like this work better on other platforms where content visibility is nearer the time of posting, while Stackexchange tries to form a question and answer collection to last.

Note that all services need to be checked by you somehow to decide whether you can trust them!
There is a list of such services at https://en.bitcoin.it/wiki/Trade#Domain_Name_and_DNS_Hosting; for example:

http://www.domains4bitcoins.com (com, net, org, co, co.uk, in, biz, us, eu, mobi, asia, name, tel, co.in, tv, me, info, ws, bz, cc, org.uk, me.uk, net.in, org.in, ind.in, firm.in, gen.in, mn, us.com, eu.com, uk.com, uk.net, gb.com, gb.net, de.com, cn.com, qc.com, kr.com, ae.org, br.com, hu.com, jpn.com, no.com, ru.com, sa.com, se.com, se.net, uy.com, za.com, gr.com, co.nz, net.nz, org.nz, com.co, net.co, nom.co, ca, de, es, com.au, net.au, xxx)
http://bitdomain.biz (biz, com, com, org, info, us, eu, in, mobi, asia, name, tel, tv, me, ws, bz, cc, mn, ca, de, es, com.au, net.au, xxx)
http://www.cinfu.com/domains/ (com, net, org, biz, info, eu, in, us, de, ru, es, asia, bz, ca, cc, co, mn, mobi, name, me, tel, tv, xxx, *.uk, ws, la, tw, cn, ac, io, sh, nu, be, tc, vg, ms, gs, jp, at, am and more 2nd level domain)
http://www.exoware.net/domainregistration.xhtml (com, eu, me, org, me.uk, de, es, co.uk, net, name, info, org.uk, cc, tel, ca, biz, tv, co)
https://www.kalyhost.com/domain.html (many different top-level domains
https://clients.microtronix-tech.com/domainchecker.php (not so many top-level domains)
https://secure.orangewebsite.com/cart.php?a=add&domain=register (not so many top-level domains)
http://www.privacyshark.com/ (anonymous, but not clear which top-level domains are offred)
http://www.frankdomains.com/btc (all top-level domains and all European TLDs e.g. .com, .xxx, .travel, .at (Austria) through to .com.ua (Ukraine) and all countries inbetween Also all New gTLDs as they come online)
https://www.namecheap.com/support/payment-options/bitcoin.aspx (Namecheap: Many TLD's)
...

More offers:

https://www.domenburg.com (Instant registration after 1 btc confirmation, 500+ TLDs: ru, com, net, org, co, pro, in, biz, us, eu, mobi, asia, name, tel, co.in, tv, me, info, ws, bz, cc, ca, de, es, ...)

The only three ICANN accredited registrars who accept bitcoin presently are No-IP, easyDNS and Namecheap.
https://www.noip.com/bitcoin
http://blog2.easydns.org/2013/04/16/we-now-accept-bitcoin-as-a-payment-method/
https://www.namecheap.com/support/payment-options/bitcoin.aspx

could you provide some source for your affirmation: "The only three ICANN accredited registrars who accept bitcoin presently are "?

Frank Domains offers domain registration via Bitcoin payments. They have a Bitcoin version of their entire site.
As well as anonymity, they also provide extra domain security in the form of Domainsafe, a Bank-style login security by means of physical key fob.
Frank Domains also provide one of the fastest domain search engines that i have come across, which can provide all the results in Bitcoin amounts.

I just found a new provider that accept bitcoins, http://www.bitronictech.net/
They accept bitcoin for domain registration and all of their other services.
They have an article about their Bitcoin Gateway here: http://www.bitronictech.net/announcements/25/Buy-Domain-Names-with-Bitcoins.html

I always use http://www.domains4bitcoins.com they take Bitcoin and have free privacy protection and DNS.
(com     net     org
 co  co.uk   in
 biz     us  eu
 mobi    asia    name
 tel     co.in   tv
 me  info    ws
 bz  cc  org.uk
 me.uk   net.in  org.in
 ind.in  firm.in gen.in
 mn  us.com  eu.com
 uk.com  uk.net  gb.com
 gb.net  de.com  cn.com
 qc.com  kr.com  ae.org
 br.com  hu.com  jpn.com
 no.com  ru.com  sa.com
 se.com  se.net  uy.com
 za.com  gr.com  co.nz
 net.nz  org.nz  com.co
 net.co  nom.co  ca
 de  es  com.au
 net.au  xxx)


text:
How can I accept bitcoins on my website?
I have an online store and would like to begin accepting bitcoins.  How can I go about doing this?

There are many particular services/solutions mentioned here.  Does anyone want to synthesize a bunch of them into a guide for how to implement?  That would be ideal since I would prefer not to "choose" one service over others.  So the ideal answer should start "It will depend on your level of technological expertise and your existing software stack:" then break it down starting with 'slap on an address' and ending up at code-your-own.

As of 2020 (and it's been for some years now), the most straightforward way is by using https://btcpayserver.org/ .

There are a number of ways one can go about accepting Bitcoin on a web interface. Keep in mind as you review these options that Bitcoin is still a young technology and many of these options aren't what you'd call "friendly" just yet. That said you do have quite a few options depending on your level of expertise and technical requirements:

Use a service like:

BitcoinPayFlow
BitPay

Use an existing shopping cart interface

There are existing plugins for Ubercart, Magento and many other popular e-commerce platforms. If you are looking to modify an existing site that happens to run on one of these platforms, this may be your best bet. If you've yet to start a site and don't want to write code yourself this may still be your best bet since you can choose your platform prior to implementation.

Roll your own using existing libraries

This is your best bet if you're using a platform that isn't currently supported or if you have difficult integration requirements that cannot be satisfied by existing e-commerce platforms like Magento or Ubercart.
Languages:

ASP.NET/C#
PHP
Python
Many others

Roll your own using the JSON API directly

This is only necessary if you are not using one of the half-dozen or so languages that already have pre-written libraries for interfacing with bitcoind. The list of languages may be short, but all of the major industry standards have been covered, so it's unlikely you will have to go this far.

You can use services like BitcoinPayFlow or Bit-Pay.
I'm working on a payment module to integrate BitcoinPayFlow with OpenCart, watch the project here - it should be ready within a couple weeks.
Edit: Bit-Pay just released an OpenCart payment module. See here.

I would advise against a solution that depends on another site staying afloat. If yours is more then a casual website it will be worth the effort to have a bitcoin solution that runs on your own server.

I agree with lathomas64.  I think it's a bad idea to recommend third party solutions as the accepted answer.  We've seen a very high failure rate with third party solutions, and bitcoind gives you the functionality you need.

I both agree and disagree. Both solutions (JSON RPC and third party payment processors) have their place. The reason I suggested BitcoinPayFlow and Bit-Pay is because they are easy to setup as they don't require much technical knowledge. BitcoinPayFlow is nice because it forwards all payments as soon as they've been confirmed so they don't often have much of a balance.

You should definitely checkout https://bitcoinnotify.com/ service. They work noticably different than the existing solutions:

You provide a list of btcaddresses (of your own wallet!) to them
They monitor all transactions in the network
If they observe a transaction to one of your adresses you get a POST from their site with address, amount, timestamp, number of confirmations, ...
You can specify how many confirmations are needed before you get the notification. Also multiple notifications are possible, e.g. at 1 and at 6 confirmations

To implement this you need to keep track on your side which order is linked to which btc-address. When a payment is confirmed you can use the address again for the next order
Advantages:

No external wallet involved - All payments go DIRECTLY to your own wallet, so there is no way they can run with your money or get hacked or robbed etc.
You can keep your wallet at any dedicated, highly secured separate system, no need to have it on or near your website
If you want to take the risk of not waiting for confirmations you get the notification within seconds after the transaction has been issued from the customer (at least that's my personal experience)

I hope that soon similar services appear, so you could subscribe at multiple sites for notification. So there is no single point of failure anymore.

You should note the risks also, e.g. that bitcoinnotify colludes with one of your customers (or becomes one of your customers) and fraudulently notifies you to ship something that hasn't actually been paid for.  Hopefully that would be quickly reported if it happened, and folks that use them could switch.  But there is also always the risk of "he said - she said", unfortunately.

Take a look at the bitcoind json api.
You will have to run the bitcoind services on a computer accessible by your website.  The computer you run the service on should be very secure since it holds your wallet.  Development is underway to allow you to have the wallet file located elsewhere.
For added security you can keep a copy of your server wallet file on your computer and regularly transfer funds to a more secure account.
There are also people who provide this service.  However this is not as secure, and you should  carefully review the options before trusting one of these services.  Nevertheless these can be an easy alternative if you can accept the risks involved.

There are a number of shopping cart interfaces currently available, though a fair number of them relied on the now-defunct MyBitcoin API. It is also fairly easy to integrate your own code with the JSON API as there are libraries available in most common languages, such as ASP.NET/C#, PHP, Python and many others. VPS or dedicated hosting is recommended since the bitcoin client can then reside on the server itself, but as bitcoin's JSON API supports SSL as of version 0.3.14 it is reasonably secure for the bitcoin client to reside on another system and allow your web application to connect to it remotely.

You can also have a look at blockonomics merchant service. It allows you to accept bitcoin directly into your wallet and is the only service right now that handles gap limit problems itself.


text:
Bitcoin Cash accidentally sent to Bitcoin address. Can I get them back?
I managed my Bitcoins Cash in a Electrum Cash wallet on my PC.
From there, I accidentally sent them to another internet based wallet, but didn't notice that this wallet is for Bitcoin and not Bitcoin Cash.
In the Bitcoin Cash blockchain I can see that the transaction actually took place and that the adress now owns the Bitcoin Cash. The problem is, that this address is a Bitcoin Cash address, and I cannot get access to it.
Is there a way to reclaim this Bitcoin Cash address? I own the address on Bitcoin, but not on Bitcoin Cash.

This question was closed as a duplicate of the reverse situation "BTC sent to BCH address". While https://bitcoin.stackexchange.com/questions/57419/what-would-happen-if-you-send-bitcoin-btc-to-a-bitcoin-cash-bch-aka-bcc-add is highly related and informative, there is an asymmetry to this problem, and I don't think the linked question fully answers the question here, so I have decided to remove the duplicate link.

In my case I sent the Bitcoin Cash to an address created by a Mobile Bitcoin (!) wallet from btc.com.
The support from btc.com told me the solution:

B) You have sent BCC to your BTC wallet:
  1. Use your BTC recovery PDF at https://bcc-recovery.btc.com/ (click on 'forgot password' to use your backup PDF)
  2. Recover the coins to an address from your BCC wallet

There was not even the need to click on "forgot password". I just logged in there with my username and password of the mobile Bitcoin (!) wallet and then it started to scan some addresses - and actually found the address I had send the bitcoin cash to. It then allowed me to specify another bitcoin cash adress where to send the money to.
So, I am lucky now, I have back the bitcoin cash the I thought I would never see again

Bitcoin and Bitcoin Cash use the same address format. This means that if you take the key from your Bitcoin Core client, and import it to your Bitcoin Cash client, the Bitcoin Cash client will be able to spend that money.
However, if someone else operates the Bitcoin Core client, you need to convince them to send you the money.

This is only true if the recipient address is not of the segwit format.

And if it is Segwit?

@Josh Segwit transactions are anyone-can-spend on the Bitcoin Cash blockchain. However, it's unlikely that someone would accidentally create a segwit transaction on the Bitcoin Cash blockchain.

Hmm anyone-can-spend?

@NickODell: Well, the problem isn't that someone would create a segwit transaction, but rather that someone accidentally sent Bitcoin Cash to a wrapped segwit address which looks indistinguishable from any other P2SH address to the sender.

authors: Алексей Михалёв


text:
Can my exchange recover BCH sent to a BTC address that existed pre-fork?
I have a wallet on Luno and another on Poloniex. Both pre-exist the Bitcoin (BTC) to Bitcoin Cash (BCH) fork. After the fork, Poloniex created another wallet for me containing the same number of BCH as I had BTC at the time of the fork. All good so far.
Now I wished to transfer the BTC from Poloniex back to Luno, but I mistakenly sent from my BCH Poloniex wallet instead of my BTC wallet.
Both Poloniex and Luno claim that the BCH that I sent to the BTC wallet on Luno is "lost".
However, from my (very limited) understanding of the blockchain and the fork, would the BTC address on Luno not have been duplicated to the BCH blockchain at the time of the fork, and therefore be a valid BCH address? If so, how would I go about claiming that address - or can Luno do this since they still control that same address on the BTC blockchain and have the private keys, and would/might/(should??) be able to lay claim to the coin in the BCH blockchain?

In principle, Luno can claim these coins, but you cannot.
There is no distinction between BTC and BCH addresses.  They each use addresses generated from private keys in exactly the same way.  Money sent to an address, on either chain, can be spent by whoever holds the corresponding private key, and by nobody else.
So Luno created an address (call it 123abc) which means that they hold the corresponding private key (call it 567fgh).  It's immaterial whether they created the address with the intention of using it for BTC or BCH (or both), or whether they created it before or after the fork, or whether it has been used before or after the fork (on either chain).
You sent BCH coins to 123abc (i.e. with a BCH transaction on the BCH chain), and so Luno is capable of using their private key to spend those BCH coins (again on the BCH chain), if they want to.  Of course, they can also choose not to spend them, if they prefer not to, or find it too much trouble to adapt their software to do it.  And even if they do choose to use them, you have no way (other than legal action or something similar) to force them to send those coins back to you, or to give you any sort of credit in exchange.
Unless of course they deleted the private key.  If so, then the coins would indeed be lost, but the same would be true of any BTC coins sent to that address.


text:
Is there a BTC Address generator that will check first blockchain if unused?
I'm looking for a working implementation of a Bitcoin address generator that would accept string or integer then it will check the blockchain if the address is unused before it will print the keypairs.
Any repositories with similar function is highly appreciated.
Thank you.

I doubt that it exists, because such a check is completely unnecessary if your random number generator is good (and if it's not then you should not be using it anyway).  Concern about address collision is a very common misconception about Bitcoin.  See https://bitcoin.stackexchange.com/questions/8804/is-each-bitcoin-address-unique.

No wallet software checks to see if they are 'used'- for you to have a collision in addresses would be astronomically unlikely (impossible for this sort of scenario), or indicative that you're not safely creating entropy for your keys.


text:
Encrypting wallet manually instead of using hardware wallet
i am new to this community and like to know why one should prefer a hardware wallet instead of using encryption algorithm like AES-256 along with PKDF2 to secure crypto wallets ?
i currently hold btc in trezor wallet and planning to use AES to manually encrypt private keys by myself.
I have been playing around with the crypto wallet encryptor,
https://github.com/sufiyanghori1/crypto-wallet-encryptor
which seems to be pretty effective.
it takes private key and a custom password as an input and encrypt it using AES-256.
i have read on various forums people using it but not sure if its any better than actual hardware wallet ?

The benefit of hardware deterministic wallets is that your keys are permanently kept offline and secret, as long as you don't leak your seed words. To spend bitcoin, the transaction signing is performed on the device, keeping your keys safe.
If you encrypt the keys yourself (I'm assuming you're talking about bitcoin private keys, not an HD wallet seed), it depends how you store them. I can see three risks:

If you're planning on storing them online and encrypt them all with the same passphrase, then you're reducing the security of your keys to the single passphrase. If you leak your passphrase, anybody with access to your data can decrypt and use your keys. If you don't store them online (including on a system with access to the internet) however, this is less of a risk.
Signing transactions. In order to sign transactions, you're going to have to decrypt your key and run it through some software. If you do this online, it's very risky. If you do it offline, you're still at risk of keyloggers and other malicious software that could be present on your machine. This also applies to when you generate your keys in the first instance.
Loss. If you lose your encrypted data or your passphrase, your bitcoin is lost. With an HD wallet, if you lose the wallet you can recover with the seed words. If you lose the seed words you can still use the wallet to transfer to an alternative address.

If you do decide to use the passphrase method, note that there is already a standard for protecting a private key with a passphrase (example implementation - check the paper wallet section), so it's not necessary to encrypt it separately yourself.

Generating keys on a computer that has never (and will never) connect to the internet is much more secure than generating keys on a computer that has (or will) connect to the internet.
Hardware wallets do not connect to the internet, ever. They interface with a computer, but through extremely restricted channels that ensure the part of the device that generates your keys remains isolated.
If you generate keys on a computer that is (or has been, or will be) connected to the internet, then you run the risk of some malware stealing your keys. This can be accomplished many ways, and the sort of encryption you put on the wallet becomes irrelevant. It doesn't matter how strong the encryption is, if a keylogger gets the password up front.
You can encrypt your hardware wallet's seed phrase if you'd like. That way if someone finds your seed phrase, they will not be able to steal your bitcoin unless they also have the password. But it also means you will have to store that password somewhere secure!

If you wish, you can also encrypt your Electrum wallet seed with a third-party encryption software.  Just make sure you don't lose the password!

No need to spend for a hardware wallet. You can do practically the same with Electrum. It's a stand-alone app that you can run on a USB stick or thumb drive. Just be sure to get the latest version. (Version 3.0.5) (they've patched some problems of the old version). Electrum is free and you can copy it on any ordinary USB drive and run it from there.
Electrum also generates wallet addresses using a single seed (group of words), so you can just print out the seed and keep it in your safe, or write it in a place where you know people won't just stumble across it accidentally. From the seed, you can regenerate your existing wallet addresses... and never lose your bitcoins.

Hardware wallets are preferred to hot wallets and cold storage, as they cannot connect to the Internet, and do not require key input into a computer in order to sign transactions. The second point is important, but also partially wrong. The hardware wallet itself is a computer with very specific set tasks, mainly, key pair/seed generation and transaction signing. The keys are never supposed to leave the device and never were outside of the device, to begin with. You cannot input keys manually into a hardware wallet. They have their own random number generator hardware, which feeds into the CSPRNG, then the key/seed generator. This means, incidentally, that you do not need a "hardware wallet" to have a hardware wallet. An air-gapped computer put inside a dark room, with all the source code verified by hand, in a Faraday cage, and a whole lot of other security measures is also a hardware wallet. It's just much simpler to have a dedicated device engineered specifically for that purpose.
Online computers run the risk of the plaintext private key (or even the encrypted private key) being salvaged by malware. Once outside of a sandboxed and enclaved environment, always outside a sandboxed and enclaved environment.
The only attacks on hardware wallets require direct interfacing, proximity, or some zero-day that utilizes an infected user's computer to send commands to the wallet (e.g. load a custom firmware that makes key extraction possible). Direct interfacing requires that the hardware wallet is stolen, but will not necessarily output any keys/seeds, since ECDSA is resistant to chosen ciphertext attacks for the most part. This would also require a zero-day to directly extract the keys. The proximity exploit would require access to the environment surrounding the key in order to influence the random generation, making the result more predictable and easier to attack (even this is a stretch, as they should have RF shielding). Given how limited these attacks are, unless a hardware wallet contains fortune, it's generally not worth an attacker's time to attack a hardware wallet from far away. It's much simpler for them to attack exchange wallets or hot wallets of normal users.
Note that none of these methods are secure against brute force. There is no way to stop brute force, it's just extremely inefficient. However, it has worked before.. Brute force aside, an exchange wallet is the least secure, a hot wallet is still not secure, a hardware wallet is secure, and a cold storage wallet is impossible to attack electronically altogether.


text:
Coinbase balance 0.00089623 BTC help to get it out!
I have these satoshis won in Faucets, and I did not know that the commission was so high, it's worth more than all my work, help please !!!

From memory it may be free (or cheaper) to send the bitcoins to another user's Coinbase.com account, so one option may be to get a friend to withdraw them for you when they withdraw their own balance. It's a lot of bother though for what's currently worth only about $5.
An alternative option (a better one, in my view) is to leave them there and hope that they increase in value or that the fees decrease, and instead spend your time on more productive activities.

I can't wait!!!!, I need it,I do n ot care if I lose some satoshis, someone who wants to receive them


text:
Bitcoin transaction 0/3 confirmation. How do i check on this?
Bitcoin transaction received Nov. 10 and is still 0/3 confirmation.  How do i check on this?

If you want to view the details of the transaction, you can search for it (using the transaction id or sending or receiving address) on a block explorer website such as blockchain.info.
Once you have an understanding of the fee paid, in satoshi's per byte, you can see where that fits in the backlog of transactions, using a site that analyses unconfirmed transactions and their fees, like Johoe's Mempool Statistics
Further details on what to do are available on the canonical question about unconfirmed transactions.


text:
the bitcoind daemon doesn't respond to commands
For some reason, the daemon doesn't accept commands neither RPC, nor command-line.
I'm running the prebuild 64 version of the bitcoind. It already downloaded all blocks etc and as is happyly running in the background, however it doesn't allow any commands to be sent. For example:
./bitcoind getinfo
error: couldn't connect to server

I tried with a config file having only the rpc user and pass, then I extended it with different params, and of course have restarted the daemon each time. Still - no luck.
The debug.log is not telling anything either. It just dumps the normal intensive communication, like…
 2013-12-07 22:01:40 received getdata for: tx
 593f4528895f75bcd3df12fb09eedb7e5e6659a7a8a999d7e127eb131afde417)

but no trace from my attempts to call a simple command.
I tried to google the problem without luck.

In bitcoin.conf, make sure you have the following lines:
rpcuser=your-userid
rpcpassword=your-password
server=1

Hi. My current confi file looks like this:
rpcuser=xxxxxxxxxxxxxx   rpcpassword=yyyyyyyyyyyyyyy   rpcallowip=127.0.0.1   rpcport=8332   rpcthreads=10   server=1
I started only with the first two lines, and then trying to fix it, added the remaining onese. But without luck.

That should work.  The only thing I can think of is your bitcoin.conf is not in the correct directory.  It should be in the bitcoin data directory (this directory contains wallet.dat as well as the blocks and chainstate subdirectories).

It uses this config file for sure. If I rename the file and restart the daemon, it throws an error. E.g.      mv bitcoin.conf xxx.bitcoin.conf      kill #######      ./bitcoind -daemon      Bitcoin server starting      Error: To use the "-daemon" option, you must set a pcpassword in the configuration file:    /home/thebitco/.bitcoin/bitcoin.conf    It is recommended you use the following random password:    ....

Sorry for the bad formatting of the above, I still haven't learned how to put new lines and format code.

Have you tried issuing netstat to see if bitcoind is listening for connections on port 8332?  If it is, then I don't have any other suggestions.

See here. It's listening to 8333, not 8332. Is it a problem?
netstat --ip -lpa | grep bitcoin
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp        0      0 *:8333                      :                         LISTEN      1020484/./bitcoind

8333 is the port used to listen for incoming connections from peer nodes.  8332 is the port used to listen for RPC connections.  So that explains why you can't issue commands.  A possible cause is bitcoind isn't authorized to listen on port 8332.  Does your firewall or operating system restrict who can listen on particular ports?

While I'm checking the 8332 port issue with my hosting provider, I pointed the daemon against testnet, to check 18332 port (it's listening), but still no luck with sending commands to the daemon :(
netstat -lp | grep bitcoin
tcp        0      0 localhost:18332             :                         LISTEN      448674/./bitcoind
tcp        0      0 *:18333                     :                         LISTEN      448674/./bitcoind
tcp        0      0 *:18333                     :                         LISTEN      448674/./bitcoind

Does it need an opened port to accept commands from the prompt actually?

Yes, the RPC commands are issued using the HTTP protocol over port 8332.  Try removing the rpcallowip, rpcport and rpcthreads lines in bitcoin.conf.  I have been successful using just rpcuser, rpcpassword and server (I'm on Windows 7 though).

the daemon is now listening on 8332, but no luck accepting a command.
i changed the .conf file to contain only rpcuser, rpcpassword, and server=1.
Anyway. Thanks for your time trying to help me!

authors: Владимир Жуков


text:
What Happens if Hive Web Shuts Down?
I've been hearing a lot of good things about Hive Web as a wallet. Apparently it's pretty secure, open source, and only requires that you keep a 12-word phrase safe. That said, what if they ever decided to shut down Hive Web suddenly? Would all your BTC go down with it, or could you simply spin up an instance of their open-source web server to regain access to your wallet?

You could most certainly spin up your own server :) Included in the Github repo is a Vagrantfile that uses Ansible to deploy and provision an instance of hive-js. This can be handy not only for creating a local test instance, but also for deploying to more public environments such as DigitalOcean or AWS.
Alternatively, because Hive Web implements BIP32/BIP39, other wallets implementing the same standard should allow for compatible 12-word seed phrases to be moved between clients. In addition to being a high priority item for Hive OSX, it seems that most if not all Bitcoin wallet developers are striving to implement these same standards.
If all else fails, you could use something like http://bip32.org/ to manually recover your master extended key and sweep the funds elsewhere.

Hive closed and I have been looking for a way to retrieve my wallet. I used iOS app called Bread Wallet http://breadwallet.com

Download the app
Enter your 12-word phrase
Wait 10-15 minutes as it does the magic
See your wallet

At this point do whatever you like with your BTC. Convert to another wallet or just user Bread Wallet.


text:
Can I estimate time to confirm based on the number of existing transactions awaiting confirmation?
Blockchain.info says that right now (1/14/2018) there are approximately 42,000 transactions awaiting confirmation.  It also says that the average size of a block is 1,700.  If the target is 10 minutes per block, that suggests that there are roughly 4 hours of transactions yet to be confirmed.  If a transaction carries with it an "average fee", is it reasonable to assume that it will take approximately 4 hours for the first confirmation, and an hour more for 6 confirmations, given these numbers?  Is there any reasonable way to estimate how that time would change given a change in the fee (other than just accepting some website's recommended fee)?

For anyone interested in estimating fees, I found a good article that discusses some of the issues:  The Challenges of Bitcoin Transaction Fee Estimation.

This is an impossible question to answer, because there will likely be new transactions added to the mempool continuously.

If more transactions get confirmed than are added, the mempool will shrink in size, and lower fee txs will confirm.
If less transactions get confirmed than are added, the mempool will grow in size, and it is likely that higher fee txs will confirm.

As a user, the total number of transactions shouldn't be of concern to you, instead you should look at what the fee rates of currently confirming transactions are, and plan accordingly. If your tx needs to be confirmed ASAP, you should set a fee slightly higher than what you are currently seeing. If you can afford to wait, you can set the fee lower, and hope that the mempool will shrink in size (but this is fundamentally unpredictable, it depends on the actions of all other useres).
Ultimately, you'll really only care about the number of txs paying a higher rate than you are willing to. Those txs are the ones that will affect how long your tx takes to confirm.


text:
How to change the wallet on the fly with bitcoin-qt
A friend and I want to create a simple webservice for ourselves, that can do transactions from our wallets. We want to keep our wallets separate. So how can we exchange the wallet that bitcoin-qt uses without restarting the application? Is that possible? Or is there another bitcoin client with a JSON-RPC or similar that we can use for that?
EDIT:
The plan is that we have a simple webinterface (PHP-based) where we enter the receiver, the amount, the username (will correspond to the name of the wallet file) and the wallet password. The script would then send the data to bitcoin-qt (or whatever we use) which will then execute the transaction. Also, it should be possible to view the amount of BTC that each wallet has (After entering the password of course).
We have a dedicated server, everything will run on that.

Is this incoming only? Will the monies be sent based on whose product it is? Because them few ways. Do you have root access? Is it a dedi, Vps, i hope it's not a shared hosting plan. If you are going to host a "hot wallet" on your production server be very careful with security (if it's nix go with mod_security and mod_evasive be very through in your coding you could lose it all on a hot wallet. And most VPS (linode is one) will get compromised by hackers or worse. Now, if you are accessing a remote Wallet, it's possible to do a remote call. Or use a deterministic key seed. I need more info..

Added some more information, hope it's enough. What is a VPS?

Thanks, that does help me out. I must go for a dinner, but I will respond in 6 hours. A VPS=Virtual Private Server.(a vm). Thanks for understanding and for adding more info

First thing: encrypt that Dedicated server's entire hard drive.
Secondly: encrypt that wallet.dat file
Thirdly: use EVERY possible method of attack defense you can. Use googleauth for 2 step log in. disable root access. If you must run SSH, run it under a random port. NOT port 22. use tripwire mod_sec/mod_evasive, if you think it might be good... add it. use UFW firewall. Use insane settings. If you only plan to sell to one country: block ALL IP's that are not within that country
Disable ALL error notifications and disable any information that may allow the attacker to gain any information about what the server is run on (no "this server run on apache centos" etc). I do assume you do know this, but im just giving fair warning.
Host as few applications beyond the bare minimum. (so no minecraft servers).
I personally recommend not keeping funds in a hot wallet because ~/.bitcoin/wallet.dat is the most searched for thing by hackers
Now... How can you have two different wallets on the same machine? well. there's a few ways to do it... If you want to keep generating infinite new addresses (using infinite seeds) all the time and have a good contingency plan in place for your wallet.dat file (like hourly back up etc), you could run 2 instances of bitcoind. (commandline version is what you want for this) Two instances can be run by changing the listening ports on one of the two bitcoind instances and running each instance on its own user account. you can then (depending on which user you are paying to) have php connect to the respective bitcoin client and request an address for payment.
Another idea i would propose could be using one bitcoin client and having accounts. If you are okay sharing one wallet and one daemon, but need your own account for accounting balances, its a breeze
Side note
there are a few projects that actually are pretty good. I started writing a basic bitcoin escrow system based off of my own coding and using  "The Bitcoin Shopping Cart Interface package" and "The Bitcoin Shopping Cart Interface package"
http://sourceforge.net/projects/bitscrow/
I use to have a much more advance version i built for FreiCoin but the wonderful people over at FDCServers destroyed my development server on me (thanks guys). So I am pretty far behind again. However you should at least have an idea of maybe a general direction to start
This version requires no  bitcoind at all which is pretty unique. But if you want a wallet, then you may need to integrate that yourself.
you could also consider installing drupal and modifying the source to have a two different plug ins going to the two different daemons.
there are many options.
you can even start from scratch, good documentation is available here.
https://en.bitcoin.it/wiki/PHP_developer_intro
Please let me know if this was useful or not, and let me know if there is further clarification needed. If you want to truly have your own page it's a lot of work...
Also, check out https://github.com/Bit-Wasp/BitWasp
I have been playing around with it and its been pretty cool so far.
thanks for giving me the information i needed to try and respond as best i can

Thanks for your answer. So there is no bitcoin client that runs as one process and listens to just one port but can handle 2 wallets?


text:
Are private keys published to the blockchain after spending coins from a wallet?
Always I spend coins the final balance of the address that is used for transaction will go to zero. The remaining coins comes back as a change to a new address. Will this indicate that the private key of the spending address is published now to the block chain for validation? Is it a risk to use this address furthermore for receiving and storing coins?

Amm ... paragraphs, please.

The answer is no. Your private key is never transmitted to the network for any reason.  You may wonder how the network can validate that a transaction is "yours".
This is possible because Bitcoin uses Public Key Cryptography (also know as asymetric cryptopgraphy).

Your addresses consist of a pair of keys which are mathematically linked.  It is easy to determine the public key from the private key but impossible to determine the private key from the public key.  It is more accurate to say it is computationally infeasible to determine the private key from the public key unless there is some cryptographic flaw.
Your public key is included in the transaction (along with destination and amount).  The entire transaction is then signed with your private key.  The signature is unique based on your private key and the contents of the transaction.  Someone can't re-use a signature because it is only valid for a unique transaction.
When the network detects a transaction it will verify it by comparing the signature and public key to the transaction.  While an attacker knows the public key he would need to know the private key to generate a valid signature.
Forgery/counterfiting is prevented because it is computationally infeasible (millions of years) to determine the correct signature without the private key.  It is not possible for an attacker to change part of the transaction (like changing amount in fiat check fraud) as that would require  different signature to be valid. The network can safely assume that if the signature is valid it must have been signed by the owner (presuambly with owners consent) and thus the transaction is valid.
This is why you must keep your wallet.dat secure.  If someone gains access to your private keys they can sign transactions as you.  Once an attacker can sign any transaction as you the best transaction is to transfer of all funds into account they control.

Absolutely not. 1A corresponding private key used to sign spending transaction, in another words encrypt message, and everyone can verify it's authenticity by using 1A public key to decrypt the message. Private key never leaves wallet unless explicitly extracted.

OK Thanks for quickly answer. I understand that all my key pairs are save and I can use it again and again.


text:
Bitcoin wallet not updating balance
My bitcoind wallet does not update the balance, I tried with two different wallet. It shows the correct balance on BlockChain.info.
I have tried the bitcoind -rescan solution given  in :Transaction confirmed by network but never showed up in bitcoin-qt
However, the balance still shows as 0.
Machine : Ubuntu Linux
Bitcoin Version : 80600
Any Suggestions?

Is your blockchain download complete? -rescaning while the blockchain is still being downloaded will not achieve anything.

Well I was using the server for a month with no issues.  It used to rarely go down, so that last time that it went down I started it again, but there was no Balance in the wallet.

Which server do you mean? And... are you sure you didn't accidentally delete your wallet.dat or something?


text:
How do you derive the public key from you random 256-bits integer?
Once I've flipped a fair coin 256 times and have the random 256 bits integer that I'm going to use as my private key, how is the public key derived?
I've read:
Given a private key, how do you get a public address
And:
https://en.bitcoin.it/wiki/Address
But I don't find the answer to my question. I understand ECDSA curves are used but I don't understand which part is the public key and what's the relation between the (unique?) public key and the addresses which you give out.
If you convert the private key to a public key by performing a multiplication with the curve's base point, then it begs the question: what is the curve's base point?
Is the curve's base point part of the private key?
Which would mean that what is called the "private key" isn't really just a "private key" but more of a keypair from which you can, at any time, derive the public key?

The curve's base point is a well-known constant. Since Bitcoin uses SECp256k1, the base point is:
04 (uncompressed point)
79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9
59F2815B 16F81798 (first coordinate)
483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448
A6855419 9C47D08F FB10D4B8 (second coordinate)
(See page 15 of my link.)
The private key is an integer from which you can derive the public key and produce signatures that can be verified with the public key.

All bitcoin addresses share a common base point known as a generator, G = (0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798, 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8) on the elliptic curve defined as y^2 = x^3 + 0 * x + a, over the field defined by P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f.
I'm afraid that's all pretty technical, but if you know modulo math it isn't extremely complex, and the values can be found if you search for sepc256k1 in Standards for Efficient Cryptography recommended elliptic curve domain parameters.
The elliptic curve over the field has the property that when you add a point to itself. Bitcoin uses this fact to calculate the public key by adding the generator point to itself a large number of times.  Your private key is simply the number of times to add the point to itself.
If your private key happened to be 1, your public key would be identical to G.  That is obviously no good because that is a very well known point, but simply changing your private key to 2 will yield the public key (0xc6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5, 0x1ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a) which is extremely different from the generator. Normally a huge private key is used, making it computationally unfeasible to try to backtrack from the public key to the private key.
The public key is "simply" private_key * G, on the elliptic curve over the field.  I write "simply" because it's a bit involved, but the math itself isn't very complicated.  It's only addition, subtraction, multiplication and division with remainders.  The really difficult part is that the numbers involved are so incredibly large that it's more or less impossible for the human brain to comprehend what they mean, and some of the definitions of calculations over elliptic curves differ from what you're used to, which can be confusing.


text:
cgminer doesn't detect GPU in ssh session
I have AMD Radeon HD 6450 card and Ubuntu is my OS. If I log in normally and start cgminer it works properly and detect my graphic card. Now my monitor is turned off and I connect to my computer by ssh. In this scenario cgminer does not detect my graphic card:
[2013-12-22 13:35:09] Started cgminer 3.7.2
 [2013-12-22 13:35:09] clDevicesNum returned error, no GPUs usable
 [2013-12-22 13:35:09] No devices detected!
 [2013-12-22 13:35:09] Waiting for USB hotplug devices or press q to quit
 [2013-12-22 13:35:09] Probing for an alive pool
 [2013-12-22 13:35:09] Pool 0 difficulty changed to 256
 [2013-12-22 13:35:10] Network diff set to 3.23K

I suspect that the card is idle because monitor is turned off. To solve this I enabled X11 forwarding in my ssh session but It did not help.
sudo aticonfig --lsa
* 0. 01:00.0 AMD Radeon HD 6450

* - Default adapter

What can be cause of that situation? Is possible that card is idle? How to check that and how to force card to starts?
EDIT
My cgminer start script:
#!/bin/sh
export DISPLAY=:0
export GPU_MAX_ALLOC_PERCENT=100
export GPU_USE_SYNC_OBJECTS=1
cd /mypath/cgminer-3.7.2-x86_64-built
./cgminer [parameters]

EDIT
sudo aticonfig --adapter=all --odgt
No protocol specified
No protocol specified
ERROR - X needs to be running to perform AMD Overdrive(TM) commands

The reason for this is that the X-Server that is handling the GPUs is not available in the SSH session. Try prefixing all commands with DISPLAY=:0. This tells cgminer which X-Server instance to use. The cgminer command then simply becomes:
DISPLAY=:0 ./cgminer -u ...

You can also fix this for the current session with the following
export DISPLAY=:0

this defines the variable in a bash shell (see your shell's documentation for details if you're using another shell). Putting this into your .bashrc file might be a good idea if you intend to use it only over SSH .

I have export DISPLAY=:0 in my script which starts cgminer. I added my start script to my question.

Make sure you have a X session launched.
Either have it auto-login or manually walk over and login in.  Then try your mining script again.  This messed with me for a couple hours.

How to start X session? I spent many hours on this and I don't know how to start X session. If you mean X11 forwarding in ssh session then X11 forwarding does not solve issue.

You may get better help from this guide (talked about cgm 3.7.2, etc).
http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html

Blog is now offline an can be found in the archives: https://web.archive.org/web/20190624023359/http://silverlinux.blogspot.com/2013/10/minimal-headless-opencl-cgminer-on.html


text:
Why was the Oct 2015 Transaction Malleability event possible in spite of BIP62/66?
The recent re-emergence of transaction malleability has been responsible for a large number of Txs which are being double spent (October 2015).
/r/Bitcoin has posted some C++ code which @amaclin has taken responsibility for.
I understand that, based on this source code, the transaction malleability "exploit" is simply tweaking the DER signatures for certain Txs (ie non P2SH Txs) and rebroadcasting the Tx (disclaimer: I don't know C++ so these are educated guesses).
BIP62 deals with numerous issues, amongst these is the requirement for canonical DER signatures: I was under the impression canonical DER signatures was implemented in BIP66.

Can someone clarify what @amaclin's code is doing?
Why is this exploit possible if BIP66 was implemented several weeks ago?

@amaclin Care to comment? :)

Sorry. I missed this post. My email is in profile. feel free to contact me

Canonical DER signature implemented in BIP 66 fixes issue #1 of BIP 62 ( Non-DER encoded ECDSA signatures )
Amacilin's code exploits issue #5 in BIP 62 ( Inherent ECSDA signature malleability ),  and is explained here : https://github.com/bitcoin/bitcoin/commit/a81cd96805ce6b65cca3a40ebbd3b2eb428abb7b
This issue was fixed by requiring signatures to have low-S encoding in pull request 6769 : https://github.com/bitcoin/bitcoin/pull/6769 . Note that this fix only prevents mutated transactions from being relayed (transactions without low-S encoding can still be mined into blocks).

From BIP62: Inherent ECDSA signature malleability ECDSA signatures themselves are already malleable: taking the negative of the number S inside (modulo the curve order) does not invalidate it.. Wow, that is a huge problem

it was a problem, but its fixed by requiring low-s right?

The short answer is that BIP66 was not intended to even address malleability. It was intended to stop having the network indirectly depend on OpenSSL's arbitrary ASN.1 parser implementation. It just happened to technically coincide with a part of BIP62.


text:
"Sipa" definition? (old terminology, circa 2011-12)
Vanitygen refers to "Sipa" format here:

Currently, it is difficult to import the private key into bitcoin.
Sipa's showwallet branch has a new command called "importprivkey" that
  accepts the base-58 encoded private key.  Vanitygen has been tested to
  work with that version of bitcoin.

I remember this term being thrown around when I was relatively new to Bitcoin, probably around the same time as the Vanitygen quote was made. There's a conflicting references to sipa format, it seems, for example, Multibit uses Sipa in place of WIF, whereas the aforementioned quote makes no sense in that context. BitcoinTalk seems to suggest Sipa = Base58 WIF
What, exactly, does the term Sipa refer to? (EDIT: And where did the term come from?)

Pretty sure it refers to this guy: https://github.com/sipa http://bitcoin.stackexchange.com/users/208/pieter-wuille As for why some people call WIF SIPA format, I don't know.

I believe it refers to me, yes :)

@PieterWuille: But you still haven't given us your definition :)

Sipa is the alias of Pieter Wuille, a Bitcoin Core developer. It just happens that he had a feature branch for the rpc command importprivkey, and people just referred to it as the "sipa" format. It's just something that has hung around in vanitygen and a few places on the Bitcointalk forum, it's not in common use anywhere else. The format being talked about is just base58check encoding with a version prefix differentiating compressed and uncompressed point usage.
This format is today most commonly known as WIF (Wallet Import Format), and also the format used in the MultiBit classic export.

You may want to more directly clarify that WIF, "sipa", and MultiBit Classic key export format are all the same (with WIF being the most common name).


text:
Is it legal to embed a miner in another open source program for benifit of the programmer?
So say I am writing an open source program, or any program really, and I embed a Bitcoin miner in the code, so that when people run my program, they would be earning Bitcoins for me.
Would this be legal?
Would I get sued for doing this?
The reason why this is important is because I love free and open source software, the only problem being that this doesn't pay the bills. I fully intend to at least inform the users of my program that there is a Bitcoin miner embedded in the program, if not also make a non-miner version available.

Part of me wants to slap you in the face for this idea, the other part of me want's to come over and shake your hand for the idea. AND for asking versus just doing it. I guess if you would program your own miner you could... I believe all miners available are GPL. But then there's the morals. Plus the fact that most countries are watching bitcoins closely. And if you have a large number of bot miners, some pools ban you for the botnet... So I'm not going to give an official answer. Morality and legality are now always one and the same.
Is it worth possibly having the scorn of BTC against you?

Well, lets look at the outcomes for the user:

your user burns hundreds of times their normal power usage mining, thousands of dollars of their money goes into their power bill
your user potentially ruins their hardware (Mac hardware will die, there's no question of that)
your users computer becomes sluggish and unresponsive
their virus protection removes the miner, as they're almost always marked as malware

The outcomes for you:

you make a couple of cents a day
you look like a complete dirtbag to your users

Doesn't seem worthwhile to me. Just ask them for donations if you really think your software deserves financing.

If you are informing users about this in a user agreement, then this is legal (but I am not a layer). Another thing is that most of the users are not reading what is written in the agreement and just assume that everything is ok. Read this as an example. So if later they figure out that they were screwed up they most probably will be really mad.
Another thing is that you will gain absolutely nothing, except of bad reputation. Most probably no one would use your software because there will be tons of other apps which are doing completely the same without using 98% of CPU or GPU.
When I told that you will get absolutely nothing - this is because with a current hash rate, there is no point of mining with CPU or GPU.
If you think that your software would be so cool, that millions of user would use it - just ask for donation and you will get much more from people who would be happy to give you money.

Link down..............

Sounds pretty shady to me. There have been some malware schemes that do this, though usually users are not being informed on what's going on.
If you do decide to do this, make sure you clearly tell people what you are doing. Don't bury this in the bottom of some user agreement or something.
You'd probably protect your reputation by offering a program without the embedded Bitcoin miner. But why would any user choose to download the Bitcoin embedded miner?
In general, taking over the GPU and processes of another user for your own benefit seems ethically questionable.
Now something that might improve your reputation would be to offer to donate the mined Bitcoins to a charity of your choice. This way, people who download the program will know that you are just trying to help out.
As long as you inform the user of what you are doing, however, and they agree to it, there shouldn't be any legal implications.

The problem is that it would be a very inefficient way for users to pay you; sort of a very indirect way of paying your electricity bill. With a lot of bandwidth consumed to manage your bot farm.
Micro-transactions would work better.