How do I convert Public Key x value to y in Python and verify? I have been using the BTC Address utility which enables me to type in something like:

020F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9

Then clicking a button the program can spit out the Y value or tell me if that X value isn't valid (IE: doesn't have a valid Y value).

As an example, the result of this one would be Valid and would expand to produce the following:

040F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9F064F1FDE4BC07D4F48C5114680AD1ADAF5F6EAA2166F7E4B4887703A681B548

Anyone know the code to do one, or both those functions in Python? (whether the code is for hexadecimal or decimal; it doesn't matter)

First, you need to understand what the two formats actually are. The first is the compressed SEC format and the second is the uncompressed SEC format. The difference between the two is that the compressed format only includes the X value and the parity of the Y value while the uncompressed format includes both the X and Y values.

The 02 at the beginning of the compressed value indicates that the Y value should be even. 03 would indicate the odd value. The 04 at the beginning of the uncompressed value indicates that both the X and Y values follow. This is why 0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9 is the same for both values.

To get the Y value, is actually not that difficult. You do need to know a little bit about Elliptical Curve Cryptography. Specifically, bitcoin uses SECP256K1 whose curve is represented by y^2 = x^3 + 7. This is done modulo P, which in our case is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F. So, plugging in X = 0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9 to the left side of the formula, you get:

(x^3 + 7) mod p = EBD56984BA6A88F5D40BB496D9A7C70AC3D8DDF5F7C287E8AABEC904E3D41DB5

The python code for this is pretty simple:

$ python
>>> p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
>>> x = 0x0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9
>>> "%X" % ((x**3 + 7) % p)
'EBD56984BA6A88F5D40BB496D9A7C70AC3D8DDF5F7C287E8AABEC904E3D41DB5'

Now you have to take the square root in order to get Y, which should yield two values, one even and one odd (due to p being odd). This is a much more involved calculation, which you can read about here: http://eli.thegreenplace.net/2009/03/07/computing-modular-square-roots-in-python

This is implemented in a library called pycoin: https://github.com/richardkiss/pycoin

You can compute it like this:

>>> import pycoin
>>> from pycoin.ecdsa.numbertheory import modular_sqrt
$ python
>>> p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
>>> x = 0x0F031CA83F3FB372BD6C2430119E0B947CF059D19CDEA98F4CEFFEF620C584F9
>>> y_squared = (x**3 + 7) % p
>>> modular_sqrt(y_squared, p)
7058650705029786666096901756991264635816989543710944821299269679858359092967
>>> y = modular_sqrt(y_squared, p)
>>> "%X" % y
'F9B0E021B43F82B0B73AEEB97F52E5250A09155E99081B4B7788FB597E46E7'

This happens to be the odd value (it ends in 7), so you need to compute the other possible y value which is simply p - y

>>> "%X" % (p-y)
`F064F1FDE4BC07D4F48C5114680AD1ADAF5F6EAA2166F7E4B4887703A681B548`

This is the even number which is the last 64 characters of the hex that starts with 04.

Note that the address is computed off either of the compressed or uncompressed SEC formats. This computation is a SHA256 hash followed by a RIPEMD160 hash. This is not reversible, so you can't get the SEC format from the address, though you can go the other way.


How do I configure the Bitcoin client for SSL on Windows? Specifically I would like to connect to bitcoind from an outside system but I'm concerned about security. I've seen where others have said that SSL support is built into the Bitcoin client but how do I configure it and what front-ends are SSL-capable? Could I simply connect with PuTTY?

You can not connect with PuTTY as bitcoind only listens to RPC-JSON commands.

Anything that can send over the HTTP(S) protocol is fine. See the JSON-RPC class for PHP.

Assuming that you want bitcoind to accept remote RPC-JSON calls, you would need to setup your bitcoin.conf file like so:

rpcuser     = randomUsername
rpcpassword = strongRandomPassword
rpcallowip  = ipOfAllowedHost
rpcssl      = 1

Then, navigate to your data directory .bitcoin and generate a self-signed certificate. Do not enter a password when it prompts you for one.

openssl genrsa -out server.pem 2048
openssl req -new -x509 -nodes -sha1 -days 3650 -key server.pem > server.cert

Restart bitcoind and test the SSL functionality. You should see the certificate details, pressing enter twice will return a HTTP/1.0 401 Authorization Required.

openssl s_client -connect localhost:8332

That's it, bitcoind will now accept RPC-JSON commands through through HTTPS.


Is it possible to / should one use a Lightning Network client? When looking at all of the examples with the Lightning Network, they involve "Alice" and "Bob". Alice is usually sending some kind of payment to Bob (or vice-versa). The thing is, "Alice" and "Bob" are Lightning Network daemons. From my understanding, these LN daemons require "BTCD" in order to work properly (or work at all).

Payment Channels also seem to require the use of the "Public ID" of a Lightning Network node in order to be created.

FROM: https://themerkle.com/what-is-the-lightning-network-daemon/

  LND requires BTCD as its direct connection to the Bitcoin blockchain.
  The daemon has to receive on-chain event information in some way, and
  using BTCD is the most viable solution right now.

I have also seen that BTCD needs to be synched(?) properly (which could take > 12 hours to do).

So, with that, how excactly is one to run a LN Node on their Smartphone (especially since a BTCD node - which is not pruned - is needed for the LN Node to function in the first place)?

Is some other kind of client software supposed to be used? If so, what is it?

TIA

If you want full functionality and have a trustless setup, you need to run your own Bitcoin node to watch the blockchain, and run an Lightning implementation (LND, c-lightning or Eclair) on top.

LND uses either BTCD or Bitcoin Core (since v0.4?)
c-lightning uses Bitcoin Core
Eclair uses Bitcoin Core

But you cannot run a full node on your mobile phone, therefore the mobile Lightning node/wallet needs to connect to a remote Bitcoin node. This could probably be achieved using current SPV, but this is bad for privacy & I am not aware of a mobile app that does this. In the future, a different method (Neutrino) will be used for this purpose, which is being tested on testnet.

You can already use the Eclair Lightning wallet on your (Android 5+) phone. Not sure how they connect to their remote Bitcoin node. This app also supports opening a channel to a random node.

For the full LND node, no config is needed, as this node has an "autopilot" feature that opens and closes channels automatically.


What are those bitcoin mining hardware doing 24/7? What are those hardware doing? Which open-source or closed source software to use on those? I want to buy one of those hardware for my learning and programming.

Any advise?

Latest technology of Antminer or rather do your research for the new ones.


Can I reuse blockchain/index files with multiple wallets? With the bitcoin-qt client, I'd like to have multiple wallets use a single set of blockchain data files.

Why? Downloading a fresh copy of the blockchain can take days, and each copy of the blockchain seems to be ~ 5GB large.  This feels somewhat wasteful if coins are spread about multiple wallets.

Note: I do not want to run multiple instances of bitcoin-qt simultaneously as I'm sure this would result in a bad time.

I was hoping this could be accomplished using the -datadirs option and symlinking blkindex.dat and blk000X.dat files to a central location.  But it seems like I'd have to create new symlinks in each datadir everytime a new blk000X.dat gets created :(

You can swap wallets around and synchronise them up with the same block chain data files - you would just need to replace the wallet.dat files in the Bitcoin's data directory. The client would only synchronise once with the network and later be able to synchronise your wallet files independently. Keeping up with which wallet is synchronised and which isn't might be a bit of a hassle though. I don't know of a client that can operate multiple wallet.dat files simultaneously.


I have some amount of bitcoin, how can i convert them to cash? I also want to know how one can know his bitcoin wallet, i only see the bitcoin slip

You can sell them on Localbitcoins , the idea is to find a local buyer and meet him face-to-face.


How do I keep my transaction from my CC to Bitcoin anonymous I am trying to move some of my money from my Credit Card and turn it into Bitcoin. I just want to know if that transaction can be kept anonymous. Will my CC company receive and info of money being taken out. If they do will they know my location. IF so how can I keep it anonymous.

Not likely, your bank will see whom the funds are sent to and the amount you are spending. After all they do need to send that money to the exchange that you are using to buy and sell on. Also many exchanges have to abide by know-your-customer and anti-money-laundering statutes that apply in the exchange's and your jurisdictions.  In the US buying from an individual with cash is the best way to anonimize your transaction.


The getbalance command shows an empty balance I sent bitcoins to an address and blockcypher says the transaction is done but as I try to learn the balance using  bitcoin-cli -testnet getbalance <address>, the address hasn't received yet. So why can't the address receive bitcoins even now?

I really don't know why I can't get bitcoins.

Obviously, as blockcypher says I sent some bitcoins to the address from other my address and blockcypher says that the transactions were confirmed.

You can query the balance only of address you own.

  I sent bitcoins to an address and blockcypher says the transaction has
  done but as I try to know the balance using bitcoin-cli -testnet getbalance the address, the address hasn't received yet.So why
  couldn't the address receive bitcoins or couldn't I send ?

The getbalance RPC method(and related bitcoin-cli command) accept two arguments, first is a string and it isn't an address, it's an account name, second is a confirmation coint To get the balance of whole wallet use:

bitcoin-cli -testnet getbalance

Or use getreceivedbyaddress:

bitcoin-cli -testnet getreceivedbyaddress 'the address' 0


How does a node send a chain? I understand that in selfish mining a malicious node can "send its entire hidden chain". Exactly how is this done? I know that usually a single block is broadcast-ed right after it is mined, but how does it relay an entire chain?
I am looking at the original bitcoin protocol https://en.bitcoin.it/wiki/Protocol_documentation#inv
It seems that inv can broadcast many objects. So would a malicious node send an entire chain via one call to inv or many?

I understand that in selfish mining a malicious node can "send its entire hidden chain". Exactly how is this done? I know that usually a single block is broadcast-ed right after it is mined, but how does it relay an entire chain?

Forks appear naturally, when two miners produce competing blocks approximately simultaneously. Such forks may have arbitrary length (thankfully, with exponentially decreasing probability under reasonable assumptions), which may need to be resolved. Doing so involves having a mechanism of synchronizing chains where the receiver is missing multiple blocks. So there isn't anything special here, it's just the normal protocol for relaying blocks that is used.
What that protocol is depends on the software used.

The basic approach involves sending an inv for the new tip. The receiver will then fetch the block using getdata, notice it is missing its parent, and ask for that parent using another getdata and so forth, until it reaches a parent that the receiver already has.

Since Bitcoin Core 0.10, nodes will respond to an inv with a getheaders, to retrieve all block headers between a point the receiver already has and the announced tip. The request contains a list of recent block hashes the receiver has to avoid duplicating things. Only when the receiver has all the headers, and has validated them, it will start asking for the full blocks that are missing along the way. This permits fetching blocks from multiple peers in parallel.

Since the adding support for BIP130 ("sendheaders") in Bitcoin Core 0.12, announcements of new blocks themselves are done by immediately sending the headers, avoiding an inv + getheaders step.

Since adding support for BIP152 ("compact blocks") in Bitcoin Core 0.13, blocks can also be announced (in negotiated cases) without any inv or headers message at all, instead sending a compact block directly (which uses an encoding that avoids transactions the receiver is assumed to already have). In case there are missing transactions, or parent blocks, those are requested using the normal means (getdata or getheaders).

Note that all mechanisms are still available for all nodes on the network. The more modern ones are generally superior, but older or simpler software implementations can still use the inv/getdata approach if desired.


Why keys generated in Bitcoin Core mismatch that from online generators despite using the same seed? I have the following problem in Bitcoin Core. With this command:

echo carpet begin bacon master draft fortune food cherry cage axis vault clown | \
bx mnemonic-to-seed | \
bx hd-new -v 70615956 | \
bx hd-to-ec -c bx-testnet.cfg | \
sed 's/$/01/' | \
bx base58check-encode -v 239

What I am doing is from the mnemonic carpet begin bacon master draft fortune food cherry cage axis vault clown, I am generating an hdseed for Bitcoin Core in regtest. Results:

cNQQqyR81GZXU3Pa1pK1gQQp6jgni5HyLYM99nL2JpzVRmdCyrFE

Then I use the command:

bitcoin-cli -regtest sethdseed true cNQQqyR81GZXU3Pa1pK1gQQp6jgni5HyLYM99nL2JpzVRmdCyrFE

Where I change the hdseed for which I just got you and Bitcoin Core generates a key pool. When I put that same mnemonic on the page BIP39 it gives me as root key the same that gives me the command up to this part:

echo carpet begin bacon master draft fortune food cherry cage axis vault clown | \
bx mnemonic-to-seed | \
bx hd-new -v 70615956

which is: tprv8ZgxMBicQKsPd5cY6ZZzsRzkcfDANp2y3jFtYNQZsp953sXiFNP9ZFod1fAhkgtCJZGvTcLJVdhFCj7VDNu68nuP4m2QGLcd4JpkteG8Ccc

However, the derivations of private keys generated by Bitcoin Core do not coincide with those of BIP39, nor does the BIP32 root key of BIP39 coincide with the private masterkey of Bitcoin Core, while the hdseed if it matches the one that happens in the command. Both the derivations, hdseed and the Bitcoin Core master key are obtained with the command bitcoin-cli -regtest dumpwallet test_wallet

I get two big unknowns:

Is the way in which I am generating the hdseed from the mnemonic correct?
Bitcoin Core generates its private master key from hdseed? And if so, is that operation reversible?

But in general I want to know why they are giving different!!!

Thanks in advance.

I want to know why the two tools are giving different results

Bitcoin Core uses hardened derivation to derive child private keys from the master private key. You can check the embedded link for more details, but in summary it means that the software uses parent private keys within the hash function to generate child private keys. This compares to non-hardened derivation which uses parent public keys in the hash function. Since Bitcoin Core uses hardened derivation while the online tool that you mentioned uses non-hardened derivation (and also different paths), there is a natural mismatch in the keys generated by the two of them.

Bitcoin Core generates private keys using the hierarchical deterministic key generation using the path m/0'/0'/k' where k is the kth key generated from the master private key. Most wallets use the path m/44'/0'/0'/0/k for generating the kth receiving key.

  Bitcoin Core generates its private master key from hdseed? And if so, is that operation reversible?

HD seed is used to generate the master private key using a hash function. So the operation is only one way and cannot work the other way.

  Is the way in which I am generating the hdseed from the mnemonic correct?

It looks to be correct but on other aspect, the mnemonic that you provided in the question is not valid (I'm unsure if it was intentional) as the checksum does not match up with the entropy.


I bought bitcoin years ago and now the website that I bought from is unavailable! I bought bitcoin years ago and now the website that I bought from is unavailable!
I only have a key that I don't even know whether it's a public key or a private key or some useless key generated by the website. Plus I'm not sure that the website bought actual bitcoin or other cryptos for me.
How can I know if I have it on the blockchain?

You can try to import the wallet using the key you have (assuming it is a private key) through wallet software such as bluewallet.io, which supports importing of wallets via private keys.
Otherwise, if that key is not your private key, you are a little screwed, sorry.


Does miner with CPFP look through all the possible combinations of descendants to find the one with the highest fee? When there is a transaction with more descendants, does CPFP policy look through all possible combination of descendants to consider "together", to find which one has the best fee?

For example, when there is a dependency graph, looking like this

there are 6 possibilities to consider for A - {A}, {A, B}, {A, B, C}, {A,C}, {A,C,D}, {A,B,C,D}. Does CPFP miner look through all of them?

In this graph, there will be 25 such combinations, if I count correctly. Would bitcoin core look through all of them?

If we run the getrawmempool true RPC, we can look at the data Bitcoin Core has for each of its mempool transactions.  Here's an example:

"3a0af489e500322159db85ad95174ffa3dd9924dbd0b68b041364a8c8eac03cc": {                                                                                "size": 226,                                                                                "fee": 0.00001130,                                                                                "modifiedfee": 0.00001130,                                                                                "time": 1507465582,
    "height": 488876,
    "descendantcount": 24,
    "descendantsize": 5412,
    "descendantfees": 27120,
    "ancestorcount": 2,
    "ancestorsize": 451,
    "ancestorfees": 2260,
    "depends": [
      "3da9c837b8560eadea2f8c48a050e9dd3f4d7637b5209bdf98c19175906529bb"
    ]
  },

Notice the ancestorsize and ancestorfees fields.  These represent the total byte size and fees for this transaction and all of its ancestors. It's then simple to divide the fee by the bytes and produce a sorted list to find which transaction pays the best feerate (fee per byte), including its ancestors.

Then the remaining transactions can have have their ancestor feerate recalculated by removing from consideration whichever transactions were added to the block proposal above, have those new feerates sorted, and find the new best feerate transaction including its ancestors.  Repeat this step until the block proposal has less remaining space than any of the transactions in the mempool.

Calculating these ancestor sizes and fees is pretty fast: you don't need to calculate the values for every ancestor, you just grab the values from your immediate ancestors (which already have all of their ancestors factored in) and then add the current transaction's values to that.

Also, to keep things fast, Bitcoin Core only looks at transaction chains of depth 25 or less.

For more information, this is the patch that added CPFP to Bitcoin Core.  It's relatively short and quite well commented.


How can Bitcoin Cash be blocks ahead of Bitcoin SV After the Bitcoin Cash & Bitcoin SV fork, Bitcoin Cash is happy to be "ahead" of Bitcoin SV, but how is this possible? aren't blocks supposed to be mined constantly every 10 min?

Solutions to the proof of work are found randomly (by guessing until you find a valid block hash). So, the difficulty is adjusted in order to set an average block time of 10 minutes, but that is not always how it happens in practice.

Also, when the total network hashpower grows before the difficulty is recalculated (which happens every 2 weeks on Bitcoin), blocks can (and are) solved at a faster rate than every 10 minutes. The same applies in reverse, less hashpower will cause block times to increase above 10 minutes (until the next difficulty retargeting).


2014 Educational Content on Bitcoin it's been a long time. I'm updating my udemy course on Bitcoin and I'm curious what educational content has been released since September of 2013 on Bitcoin. Specifically have you guys encountered an aggregated list or has someone taken up the mantle of BEP since I left?

Besides your course, there's Khan Academy's, Stanford's cryptography course, and a rather superficial course on lynda, amongst more scattered material.


Bitcoin not received since 3days now Two different bitcoin payment was sent I sent into one Wallet Address requested, But only one came into my wallet successfully. But I am yet to receive the second one, and when I try to look it up on blockchain explorer. The only information that comes up, is the bitcoin that came in successfully, But nothing can be found about the second transaction.

You should call their support. They did not make the payment that receipt says that they made.


What is the maximum size of a transaction? I see from the source code (script.cpp) that there is an upper limit in the script size. It there any other limit to avoid a single transaction preventing other transactions of smaller sizes to get into a block?

How is this kind of attack prevented?

I've read in CTransaction::AcceptToMemoryPool the line:

if .... ::GetSerializeSize(*this, SER_NETWORK) < 100)
    return error("...");

Does this line means that the maximum transaction size is 100 bytes?

The maximum transaction size is the size of the block. Source.

// Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)
if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)
    return state.DoS(100, false, REJECT_INVALID, "bad-txns-oversize");

Transactions larger than 100 kilobytes (including witness at a 75% discount rate) are non-standard. Source 1. Source 2.

static const unsigned int MAX_STANDARD_TX_WEIGHT = 400000;
...
if (sz >= MAX_STANDARD_TX_WEIGHT)
{
    LogPrint(BCLog::MEMPOOL, "ignoring large orphan tx (size: %u, hash: %s)\n", sz, hash.ToString());
    return false;
}


Does Apple allow mining from app? I have been looking into the feasibility of creating an app that mines cryptos. I have been searching iTunes for similar apps but none have come up where the miner is part of the app. Does anyone know if Apple allows mining from app? i.e would an app that does mining have even the slightest chance at being approved?

It seems unlikely that they'd allow that. App Store Review Guideline 2.4.2 provides:

  Design your app to use power efficiently. Apps should not rapidly drain battery, generate excessive heat, or put unnecessary strain on device resources.

Also, Guideline 3 seems relevant:

  If you want to unlock features or functionality within your app, (by way of example: subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use in-app purchase. Apps may use in-app purchase currencies to enable customers to “tip” digital content providers in the app. Apps and their metadata may not include buttons, external links, or other calls to action that direct customers to purchasing mechanisms other than in-app purchase.

(i.e. Apple must get a cut of all purchases.)

Or Guideline 3.2.2 (ii):

  Monetizing built-in capabilities provided by the hardware or operating system, such as Push Notifications, the camera, or the gyroscope; or Apple services, such as Apple Music access or iCloud storage.


Explorer showing different balance then my Blockchain wallet My Blockchain wallet address on the explorer, shows a low balance (under .001) but when I log into the wallet I can see what should be there about .25 BTC. My Electrum wallet is also doing the same. When I look at the explorer I see "unspent" transactions together with actual transactions.

It seems there are what seems like sub-addresses or something that are holding the rest of the coins. At first I thought coins were missing but I did a transfer to another account and it went through fine even though it was for more btc than what the exporer showed I had.... Confused to say the least,.. Thanks in advance for any insight.

You don't have just one address.  It is normal for a wallet to hold your coins distributed across many different addresses.  This is for privacy, since it makes it harder for the public to determine your total coin holdings.  For instance, whenever you ask someone to pay you, you would usually generate a brand new address that you have never used before and ask them to pay that address.  That's what the "receive" function on most wallets would do.

It is possible for a transaction to draw coins from more than one address.  Your wallet does this automatically when you make a transaction that is larger than the balance of any single address.

Your wallets may have a way to show all your addresses which currently contain coins; you could look those up in a block explorer and the total should come out right (assuming all your incoming and outgoing transactions have confirmed).


can I run bitcoin core with public key only I'm looking a way for secure setup of web site that accepts bitcoin payments. Ideally I'd like to create wallet off-site and be able to deploy bitcoin core online with public key only that I believe should be enough to generate new addresses and watch for incoming payments

can I run bitcoin core with public key only

That would be a watch-only wallet - usually achieved by importing an externally derived address.

  deploy bitcoin core online with public key only that I believe should be enough to generate new addresses

In principle you can derive addresses from a public key but, as far as I know, Bitcoin core doesn't provide any way to import a public key and derive addresses from it. But I haven't tried.

See

How to import an extended public key into bitcoin core 0.16
https://bitcoincore.org/en/doc/0.16.0/rpc/wallet/importpubkey/

You could always generate addresses from a public key externally and then use the Bitcoin core API to import those addresses. There are many Bitcoin libraries for popular programming languages.

How bitcoin addresses are generated?
https://godoc.org/github.com/btcsuite/btcutil#NewAddressPubKey


Is it possible to set up electrum server for other alternative currencies Here i am asking this question for knowing that the electrum wallet can support other currencies like peercoin novacoin etc.

If you know something about this then please revert me and also please give any reference for how to do that ..

Thanks in advance..

In theory, sure. All of these coins are just code at the end of the day, and the electrum server could be modified to handle whatever currencies they wanted to.

In practice however, adding additional coin support to a server is a big deal, and unless you are trying to solve a problem to which there is no other good solution, probably not worth the effort.


Is it true that sending from an address exposes the public key of a bitcoin address? I just recently learned that your public key + private key is hashed together to form your bitcoin address. Is this true?

Can someone please confirm if the following is true:

If a bitcoin address never sent funds out, you would need to guess the public + private key of the bitcoin address.
If a bitcoin address had an outgoing transaction, the public key is now out in the open and you would only need to guess the private key.
Single address Paper wallets that had an out going transaction has a risk of its funds being stolen since the public key is now in the open.
Is there a site that lists all the bitcoin addresses with their public key exposed that also still has large sums of bitcoin in it?

This is mostly not correct.

First of all, the address is a hash of the public key only.

Also, if one has a private key, the corresponding public key can be computed directly.  So the most straightforward brute-force attack looks something like this:

Pick a number to use as a private key (an integer between 0 and 2^256, roughly)
Compute the corresponding public key
Compute the RIPEMD-160 hash of the public key
See if it matches the target address (or any other address containing coins)
Repeat

Knowing the public key in advance isn't relevant for this attack.  In fact, since the private key is 256 bits and the hash is only 160 bits, it is overwhelmingly likely that if the attack succeeds, it will be by finding a private key which produces a public key that is different from the original public key but has the same hash.  (Of course, it is overwhelmingly unlikely that this will actually succeed before the end of the universe.)

The whole point of public key cryptography is that it remains secure even when the public key is made public, and ECDSA is believed to be a secure algorithm in this respect.  There are no known attacks in which knowing the public key makes it feasible to recover the private key or otherwise produce valid signatures.  So it's not accurate to say that addresses with an exposed public key are "at risk" of having the coins stolen.  This is not a real risk, as far as is known.

There are theoretical attacks based on quantum computing that might make it much easier to determine a private key from the corresponding public key.  See What effects would a scalable Quantum Computer have on Bitcoin?  If those attacks (and the requisite quantum computing technology) should eventually become possible in practice, then there would be a real increased risk to addresses with an exposed public key.  That is not the case today and as far as I know, it is not likely anytime soon.

I don't know of any compiled list of funded addresses with exposed public keys.

See also Is that safe to expose public key to the mainnet


Is there a way to publicly raise Bitcoin funds? What services are available to publicly raise Bitcoin funds?

I'm considering setting up a Bitcoin fund that would accept BTC donations. If the fund doesn't reach a certain value after a time, I'd like it to refund the BTC. Also, I'd like to give donors the option of withdrawing their donations once a week. It needs to be safe from hackers (eg. the BTC are stored on MtGox with Yubikey protection), and transparent.

Obviously I don't want to use a regular bitcoin wallet address as the public wouldn't trust it.

Does anything like this exist?

There is plans to implement conditional transactions which would do some of the things you indicated.   That hasn't been implemented yet.

To do what you want would require creating website from end.

For example you could display current balance & goal as well as the number of donators.  When someone donates you could have them provide a "return address" (in case it is different) that can't be changed and a return password (which you encrypt).

While you said you want to use Mt. Gox I don't see how that would increase trust and it would make automating deposits and returns much more difficult.

In short it can be done but there is no easy automated way to do it within the Bitcoin protocol so you will have to custom build a lot of the functionality.


How do I start mining? I have only known about Bitcoin for maybe a month now.

I don't know what I need to start mining, but I had these two programs that were said to be needed for the Bitcoins. I deleted these programs and thought maybe I shouldn't mess with all this, but I just can't do that.

Please, any help on starting the process of mining and the way everything works would be much appreciated.

To be honest, you came in a little too late. Mining is now done by ASIC's (Application Specific Integrated Circuit). These are chips (like the ones Intel and AMD make) that are only capable of hashing SHA-256. These chips are very limited (they can't run any other software), but can do what they were made to do extremely fast.

An Intel 'universal' CPU can do somwhere around 1.2 million SHA-256 calculations (it is also running an Operating System in most cases), whereas an ASIC chip can calculate these hashes at around 4 billion a second, per chip. That's 4000 times as much. Also, when these chips are made to connect over Serial or USB, you could hook up 100 of these on one computer or Raspberry pi. It is quite difficult to scale up CPU's the same way.

Your best bet at mining would be to buy an ASIC miner and do a lot of research (preferably in opposite order; research first...). It is really easy to buy a miner right now and not make ROI (Return On Investment) because of the rising difficulty in Bitcoin. The rise of difficulty is stagnating a bit, but it is still rising. So please do some more reseach and know what you're getting yourself into.

Source: I have been mining myself for over a year now. I started out with graphics card mining and actually lost 1700 euros (2040 bucks) on the equipment. I now own ASIC miners and make a bit of profit every month. It takes me about 10 hours a week for maintenance, financial administration, trading/selling of (alt-)coins and I am still 'in the red' for about 800 euros (960 bucks). I like it a lot, even though my wife is not so happy with the space the miners take, the electrical bill being 400 euros higher each month, our house sounding like a server center and me spending more time on mining than on something else. Also, in the summer it's like I live in the tropics, with the heat generated by the miners.


Cryptocompare API is not updated I have created an android app for maintaining the portfolio. I have used the coinmarketcap.com API. This API does not have the data at exchange level.

I have tried https://min-api.cryptocompare.com/ this does not have the exchanges like some of the exchanges like https://koinex.in (or) Zebpay.com and the some crypto pairs.These are just some of the missing exchanges.

Is there is any API which has all the exchanges in the crypto world ?

I wonder how other apps are fetching all the possible exchanges and the crypto currency pairs. Please advice.

These aggregating sites are just hooking up to every exchange API and querying the data and then dumping it in a database. You could do the same, it's a decent amount of work and costs money to run the server.

For example, Coinigy's API is hooked up with just about every exchange and pair, it is a paid service. I have no affiliation with them. This is only an example.


What happens to Dash wallet if PC is formatted? I am new to cryptocurrency. Let's say I setup a DASH wallet using this link https://www.dash.org/wallet/ on my Windows PC.

I encrypt my wallet using passphrase now after 1 year my PC's hard disk has corrupted. What happens to my DASH coins?

Would I loose them forever or can I recover them using the passphrase I entered while setting it up?

I haven't used Dash, but they say it's based on Bitcoin-QT (from Bitcoin Core).  Assuming they operate similarly, then in order to recover coins, you need both your wallet.dat file and your passphrase.  If you don't have them both, your coins would be lost.  So you should keep secure and reliable backups.

Some wallet clients can give you a "mnemonic phrase" (not the same as a passphrase) which can be used all by itself to recover your coins.  However, Bitcoin Core is not one of them, so I assume Dash doesn't support this either.


List of problematic blocks Is there a list of problematic blocks? I mean blocks in official blockchain that may cause carelessly written bitcoin client to stuck after receiving them? Can you provide a link for further reading about different type of such blocks and ways to cope with them?

Note: The most similar question I found is Is there a listing of strange or unusual scripts found in transactions?

Lets see, I can't provide you a list with reference, but off the top of my head:

There are blocks that have the same coinbase transactions as previous blocks (I have heard of two, seen one so far)
There are transactions in a block that send a lot of coins to an address of "0" (they were intended for MtGox, but someone made a mistake in their code)
There are transactions that have multiple opcodes for verifying signatures
There are a lot of transactions that put some data on the stack and get rid of it
There are transactions that use other verification methods than signatures (for example, passwords)

Those are to my knowledge the cases that could cause the most trouble for poorly implemented clients


How to calculate the transaction size? Is it possible to calculate the transaction size from the transaction id ?

No. That's not possible.

A transaction id is calculated from the raw transaction. More specifically the raw transaction is hashed twice with sha256: sha256(sha256(rawtransaction)).

That means, that the id is always 256 bits long (64 characters).
Because sha256 and hashing in general is a one-way-operation, it's not possible to calculate the size of the rawtransaction just from the transaction id.

if you need more information about a transaction, you have to fetch that from a client. In bitcoin core you can use gettransaction or getrawtransaction. (getrawtransaction only works if the transaction belongs to one of your addresses or you have txindex enabled in your wallet.)


Does a long time storage wallet need to be online? I have a offline computer that has never been connected to a network. I use this computer for long time storage of sensitive data, all data transfer to and from this computer is done by USB memory. I want to move most of my bitcoins to this computer, so will it work this way:

Install bitcoin wallet on the offline computer and generate public address.
Send bitcoin from my online wallet to the address of the offline wallet.
Download bitcoin blockchain on a online computer and move it to the offline computer by USB memory?

You don't need the 3rd step for long-term storage. You don't plan to spend your bitcoins any time soon when you're looking for long-term storage. If you download the blockchain now, it will long be outdated when you want to spend your money and you may as well only download it then. Or you choose a wallet which doesn't require you to download the entire blockchain.

Technically, the computer holding your private key doesn't have to be connected to the internet as a transaction can by signed by software running on that computer, then be transferred via a thumb drive to computer connected to the internet, and be broadcast from this second computer. This has the disadvantage that the blockchain has to be downloaded to the point where the transaction which was made to the long-term storage address has been confirmed. So you'll have to decide between [downloading the blockchain and being able to spend your money without the computer holding the private key being connected to the internet] and [not downloading the blockchain but having to transfer the private key to an online computer when finally spending the money].

Electrum can do this. I don't know whether other wallets can do it, too, because I only use Electrum.

Note that you don't even have to have any computer hold the private key. A private key is just a 256 bit number (default case; few restrictions on the range of values it can take, but almost all 256 bit numbers are valid private keys and that's really all there is to them, no magic involved). Numbers can be written down on paper.

Alternatively, you can use a brainwallet.

All 3 have things you can lose to lose your money:

Wallet on computer:

Malware can delete the wallet or encrypt it. (Can happen through infection via thumb drive.)
Your hard drive (+ backups) can break.
Some larger damage (e.g. house burning down) can break the entire computer, including the hard drive.

Paper wallet:

You can lose the piece of paper.
Damage can happen to your piece of paper. (The writing can fade, a fluid can be poured onto it, etc.)
A member of your family might find it and throw it away.
If you print it, a part of the private key may not be printed. This actually happened to someone who asked for help on this StackExchange site. They printed their private key in wallet import format but it didn't entirely fit on the page.
If you write it down by hand, you might make mistakes.

Brain wallet:

You can forget the passphrase.

Combination is possible:

If you have a private key on a computer, you can write it down. Again, the private key is just a number.
If you have a private key written down, you can make it a wallet on a computer.
If you have a brainwallet, you can write the private key down or make it a wallet on a computer.¹

¹ You can't go in the opposite direction without actually remembering the private key (which is absolutely not recommended). Remembering an Electrum seed (which looks like this: "constant forest adore false green weave stop guy fur freeze giggle clock") reliably may actually be possible but I still advise you to use the standard method of creating a brainwallet if you want to use one.


What can be done if Bitcoin is used for money laundering? If a criminal uses Bitcoin to launder his funds, can the bitcoin network stop him from using Bitcoin?
Can we close his account?

In reverse order.
Can we close a criminal's account?

No.
The owner of a bitcoin address can move all the money out of the address and then delete all copies of the key pair for the address. This would amount to closing the account, as the likelihood of someone having the same address in the future is infinitesimally small. However, moving bitcoin money out of an address requires either the owner's consent or legal pressure brought bear on the physical human being assumed to own the account. Criminals are adept at avoiding this sort of pressure.

Can we stop criminals using Bitcoin?

No.
This would require network consensus to collectively blacklist a bitcoin address. At current the community would be very unlikely to endorse such a protocol enhancement; as it could be used to tyrannise minority account holders.
If such a consensus was reached, locating criminal accounts would be difficult unless all residual mechanisms of bitcoin anonymity were also outlawed at the protocol level. Might as well rename the currency "1984".
But
Until bitcoin can be used in large volume to directly purchase food, shelter, safety and bling; criminals wanting to enjoy their ill-gotten gains have to change their bitcoins into a mundane currency like US dollars. Currency exchanges are already improving their recording and accountability to law enforcement officials. So the criminal will need to launder the money through plausible revenue sources before cashing out.

What can we do if Bitcoin is used for money laundering?

Not much
People or businesses could snub money that has come from a proven mixer or other aggregate wallets that don't comply to some auditing standard. But if bitcoin grows to any meaningful size, that is a lot of banking services or aggregate wallets to trace and enforce.
Considering how disposable each bitcoin address is, a botnet could simply create a million temporary accounts; feed the dirty money in at random; mix about like a mesh network of transactions following a plausible traffic pattern; and then spit out clean money.
In the long term, law enforcement will have powerful forensic tools to infer most cases of obvious money laundering. In turn, criminals with the connections and wealth will rent advanced money laundering methods as needed - like they already do in Vegas*.

* If you are suitably paranoid, you have to wonder how many bitcoin casinos have been established specifically to gestate money laundering operations.


RippleAPI how to issue IOUs using preparePayment I'm trying out the API, and I've set up one 'user' account, and one 'gateway' account. The only difference between the two is that the user has extended a trustline to the gateway account. I would now like to issue USD IOUs from the gateway to the user account.

I assume the functionality for this is built into api.preparePayment(). So far, I am able to transfer XRP using code found in the payment example of ripple-lib. The essence is:

const address = SENDER_ADDRESS;
const secret = SENDER_SECRET;

const payment = {
  source: {
    address: address,
    maxAmount: {
      value: '0.01',
      currency: 'XRP'
    }
  },
  destination: {
    address: RECEIVER_ADDRESS,
    amount: {
      value: '0.01',
      currency: 'XRP'
    }
  }
};

api.connect().then(() => {
  console.log('Connected...');

  return api.preparePayment(address, payment, instructions).then(prepared => {
    console.log('Payment transaction prepared...');
    const {signedTransaction} = api.sign(prepared.txJSON, secret);
    console.log('Payment transaction signed...');
    api.submit(signedTransaction);
  });

A few lines of code are missing but this is the basic structure. It works when I make either the Gateway or the user the sender, and the other the receiver. How should I modify it so that I can issue USD IOUs from the Gateway to the user?

My trustline object was:

var trustline = {
  "currency": "USD",
  "counterparty": GATEWAY_ADDRESS,
  "limit": "100",
  "qualityIn": 0.91,
  "qualityOut": 0.87,
  "ripplingDisabled": true,
  "frozen": false,
};

Okay I figured it out: first, I set up a trustline from USER_ADDR to GATEWAY_ADDR for 1000 EUR. I made sure that the qualityIn and qualityOut were set to 0, the default value:

var trustline = {
  "currency": "EUR",
  "counterparty": GATEWAY_ADDR,
  "limit": "1000",
  "ripplingDisabled": true,
  "frozen": false,
  "memos": [
    {
      "type": "test2",
      "format": "plain/text",
      "data": "texted data2"
    }
  ]
};

I signed and submitted this trustline.

I then used the following payment object to create an IOU for 50 EUR from the gateway to the user, indicating that the user had deposited 50 EUR with the gateway outside the Ripple system:

const payment = {
  source: {
    address: GATEWAY_ADDR,
    maxAmount: {
      currency: 'EUR',
      value: '50',
      counterparty: GATEWAY_ADDR
    }
  },
  destination: {
    address: USER_ADDR,
    amount: {
      currency: 'EUR',
      value: '50',
      counterparty: GATEWAY_ADDR
    }
  }
};

Earlier, this was not working due to qualityIn and qualityOut being to 0.91 and 0.87


Can someone explain how this person hacked bitcoin? I'm trying to fill a few gaps in my understanding how this transaction happened!

It all started with this article

In short, some vigilante/miner was able to scoop up all of the BCH sitting in segwit addresses (namely, the ones for which the public keys were revealed by the owners spending BTC from the same addresses.

See this Transaction that was created, miner
Bitcoin Cash Block Explorer

Step by Step Breakdown

Miner scoops public key of this address 3P9dyU9ga3aJorHAUqKBFCX2NdyuHEVgx1
(this is a P2SH P2WPKH address see this bitcoin block explorer )

Question: what is that public key? Do you see any keys?
("3" is a multisig address & requires 3 addresses, so there must be 3 public keys, right?)
The article didn't explain how and what raw transaction he created using only public keys.
This is the most frustrating part. The article claims that miner created a segwit node and mined on top of that.

How is that even possible? (Bcash doesnt have segwit activated. However even if he mined using his segwit node, his node will not allow him to create a valid transaction because segwit requires a witness or sign with private key of public key of address 3P9dyU9ga3aJorHAUqKBFCX2NdyuHEVgx1.)

However, this article claims

The miner just created a scriptsig (the article didn't explain what "apply a particular hash" means).
Now it's easy, the miner just has to assign a BCH output (address starting with 1)
it gets even more stupid. The article says after making that raw transaction he mined it ..... without broadcasting it. How does that work?

3.1 If you are not broadcasting it then whats the point? How will that transaction go through to the new address/wallet created by miner (in this case 1C4TafndKYFoGkeoHfQAWkZzEYLum31txf)?

3.2 If the miner is mining his own block and then not broadcasting it, wouldn't it get orphaned? So what is going on here?

Question: what is that public key? do you see any keys? ("3" is a multisig address & requires 3 address? so there must be 3 public keys right?)

No. An address beginning with a 3 is a P2SH address. This does not mean it is a multisig address or requires any number of keys to sign the transaction. Rather it just means that there is some script (it can be any script, not necessarily a multisig script) that needs to be included in the input that spends the P2SH output. That script will dictate the other items in the input.

For a P2SH nested Segwit output (P2SH-P2WPKH and P2SH-P2WSH), the script that the address refers to (known as the redeem script) is of the form OP_0 <20 byte hash> or OP_0 <32 byte hash>. When a segwit node sees this script in an output or as a redeem script, it knows that it should look in the newly defined witness are of a transaction to get the rest of the data it needs to verify the transaction.

However for a non-segwit node, they will mark the transaction as valid (but not standard) because for a non-segwit node, those redeem scripts don't specify that a signature is needed. This makes these outputs anyone-can-spend to non-segwit nodes.

Since Bitcoin Cash does not implement segwit, all of their nodes are non-segwit nodes. Thus in order to spend from the P2SH nested segwit outputs, you only need to provide the redeem script. However the redeem scripts are protected by a hash; given only a P2SH output, you cannot figure out the redeem script unless you already know it. Redeem scripts are revealed when the output is spent from.

What the miner did here was that they found as many redeem scripts as they could. The redeem scripts of the P2SH outputs used were all redeem scripts that had been revealed on the Bitcoin network because they had been used as an input in a transaction. So the miner took all of those revealed redeem scripts and checked to see which ones had corresponding outputs on the Bitcoin Cash network. Those that did could then be spent by the miner as the miner then knew the redeem script.

  it gets even more stupid ????????????????????? Article says after making that raw transaction he mined it ..... without broadcasting it ?????? what

A transaction does not need to be broadcast before it is mined. A miner can include whatever transactions he wants, and that includes transactions not broadcast to the public. Once the block is mined, the transaction will then be broadcast with the block.


Is it correct to assume that the price of cloud GH/S will vary proportionally with the difficulty change? For example, today on CEX.IO I can buy 1 GH/S for 0.08 BTC. From my understanding, a change in difficulty is imminent and will increase roughly by 20% (http://bitcoinwisdom.com/bitcoin/difficulty).

Will the price for GH/S decline by roughly 18.3% (1/1.2)?

The price of CEX.IO's GH/S asset is based on the total future expected payout of a Gh/s of mining hardware, factoring in management fees and the time value of money.  The current price already factors in future difficulty increases, as these are predictable and expected events.  The price should not move significantly when the difficulty adjusts, as the occurrence and magnitude of the adjustments are not a surprise to any informed participant in the market.


Bitcoin Blockchain Parser to get all block headers I am looking for on-line or off-line run Bitcoin Blockchain Parser to get all block headers only

All I need is

########## Block Header ##########
Version:         1
Previous Hash    00000000000000000000000000000000
Merkle Root    4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Time             1231006505
Difficulty       1d00ffff
Nonce            2083236893

No transactions data.

I share a small Python script that can parse off-line the data which is stored in blk*.dat files.

You can try it here.

If you want, you can turn-off the strings savings that you does not need.


Why this ugly looking formula to calculate 'target' from 'nBits' in block header: target = coefficient * 256**(exponent-3) Why this ugly looking formula to calculate 'target' from 'nBits' in block header:  target = coefficient * 256**(exponent-3).

Why not? :  target = coefficient * 256**(exponent). What is the need of subtracting 3. All we need is to be able to generate 256 bit long number and enough precision (which we already have with 3 bytes dedicated for coefficient)

Even better, why not? : target = coefficient * 2**(exponent)

TL;DR The formula comes from turning an algorithm into a mathematical formula. nBits encodes the target with the first bytes as the size of the final target, followed by the 3 most significant bytes of that target. This can be converted into that crazy formula.

The formula is the mathematical representation of the actual algorithm that was used for the compression. To understand why the formula is as it is, we need to first take a look at the original code that encodes a 256 bit target as a 4 byte nBits. This is from 0.1.5 in the bitcoin/bitcoin source tree, but is the same in 0.1.0:
unsigned int GetCompact() const
{
    unsigned int nSize = BN_bn2mpi(this, NULL);
    std::vector<unsigned char> vch(nSize);
    nSize -= 4;
    BN_bn2mpi(this, &vch[0]);
    unsigned int nCompact = nSize << 24;
    if (nSize >= 1) nCompact |= (vch[4] << 16);
    if (nSize >= 2) nCompact |= (vch[5] << 8);
    if (nSize >= 3) nCompact |= (vch[6] << 0);
    return nCompact;
}

Now the first thing to look at is this BN_bn2pi function. Early versions of Bitcoin used OpenSSL's Bignum module for these calculations. So we need to look at the OpenSSL's docs for this function. From the docs, we read:

BN_bn2mpi() and BN_mpi2bn() convert BIGNUMs from and to a format that consists of the number's length in bytes represented as a 4-byte big-endian number, and the number itself in big-endian format, where the most significant bit signals a negative number (the representation of numbers with the MSB set is prefixed with null byte).
BN_bn2mpi() stores the representation of a at to, where to must be large enough to hold the result. The size can be determined by calling BN_bn2mpi(a, NULL).

This means that BN_bn2mpi will place into a buffer the Bignum in the format
<4 byte size> | <variable length number>

Calling BN_bn2mpi with NULL as the buffer will return the number of bytes that that buffer will need to be. This is useful to know how many bytes to allocate for the buffer.
So let's go back to the GetCompact function. We see BN_bn2mpi(this, NULL);. This means that nSize is now the size that is needed to encode the Bignum. Because this encoding also includes the size of the number itself, we later see nSize -= 4; which sets nSize to be the size of the actual number itself.
BN_bn2mpi(this, &vch[0]); now encodes the Bignum into vch which was set to the size specified by the first BN_bn2mpi call. It is important to remember that the first 4 bytes are the length of the number, so the actual number itself begins at index 4 (vch[4]).
Finally, the compact number itself is constructed. nSize << 24 is just to set the rightmost byte of nSize to be the leftmost byte of nCompact. Then the function is setting the rest of the compact number. Each byte is just being shifted to it's final position in the 4 byte int and OR'd with nCompact to set it. The if statements are for the case that the target is so low that it is encoded in fewer bytes than the compact size itself.
Looking at this function, we learn that the compact encoding is really just one byte indicating the length of the target, and 3 bytes for the 3 most significant bytes in that target. If you looked at the SetCompact function which takes a compact nBits and converts it into a Bignum, you would see that it is just the inverse of GetCompact, so I won't explain it.
Now the question is, how do we get to the crazy looking formula? How did we go from this code that strictly is just byte manipulation to a mathematical formula?
In your example, based on the above algorithm, we know that the final number is going to be 0x00ffff0000000000000000000000000000000000000000000000000000. We want the first 3 bytes, which we got from the nBits, to be by themselves, so let's divide this number by that:
0x00ffff0000000000000000000000000000000000000000000000000000 / 0x00ffff = 0x010000000000000000000000000000000000000000000000000000

Now 0x010000000000000000000000000000000000000000000000000000 is 26 bytes long, which we can see is because we've removed the first 3 bytes. Now how do we get this number from the nBits? We can take the first byte, representing the length of the full thing, and subtract 3 from it. Then to get that number, because there are 256 possible values in a byte, we do
256**(0x1d-3)

We can expand this further because 256 = 2**8 and some people like things represented as a power of 2. So this can become 2**(8*0x1d-3). Thus
0x010000000000000000000000000000000000000000000000000000 = 2**(8*0x1d-3)

Therefore:
0x00ffff0000000000000000000000000000000000000000000000000000 = 0x010000000000000000000000000000000000000000000000000000 * 0x00ffff = 2**(8*0x1d-3) * 0x00ffff

The final result is 2**(8*0x1d-3) * 0x00ffff. And, of course, this generalizes.

A semi-related question then is why does the Bignum encoding have a leading 0x00 byte? An encoding that represents this maximum target with a little bit more precision would have been 0x1cffffff so we could avoid this extraneous 0x00 byte.
That leading 0x00 byte is all because the Bignum is signed and the target is a positive integer. The most significant bit indicates whether it is negative. If the target had been encoded 0xffff...., then decoding this would mean that the target is negative, which is wrong. So the encoding puts a leading 0x00 so that the number remains positive.


How can I exactly use both the rpc API of Bitcoin and the rpc API of Bitcoin cash on the same server or machine? I've looked for an exactly answer but I really couldn't find it.
So can someone let me know the why of doing what I'm asking correctly?

if you don't have Bitcoin-core and bitcoin cash already installed alongside, follow my answer in here to install Bitcoin-cash alongside Bitcoin-core.

It's so important creating a different username than bitcoin username because bitcoin and bitcoin cash use the same directory.

Now login to Bitcoin username and edit this file ~/.bitcoin/bitcoin.conf

so it becomes like that:

rpcuser=myusername
rpcpassword=myRPCpa$$word
daemon=1
server=1
rpcport=5345

in here we are using different RPC port to bitcoin core. to know more about bitcoin config see this website.

Now, do the same thing to Bitcoin-cash, and everything should work as it supposed to be.

if you have a firewall enabled, don't forget to allow chosen ports.


Does 20 XRP become unusable once deposited in a wallet? If I'm sending, say 50 XRP, first time to an exchange or wallet, will 20 XRP be locked forever and become unusable? Since 20 xrp are required to activate that account.

If it's a native wallet on the ledger, then 20 XRP will not be transferrable, though you can use it to pay transaction fees. Exchanges typically have you pay into their account, so there's no reserve that you need to pay. For reasons that nobody has ever figured out, Poloniex does make you pay the 20 XRP reserve.


Code example for Ardor bundler code snippet to filter transactions of a certain criteria to pay ZERO 0 ignis Fees? I'm looking to write a custom Ardor bundler to only bundle transactions that have the following properties:

Bundle transactions that are being sent to a specific account only.
Bundle transactions where the sender holds a specific type of asset or monetary system coin.
Bundle transactions only if that user hasn't sent more than 10 transactions in the past hour.

I couldn't find any code snippets of how to go about setting these custom Ardor bundlers.

Take a look at the bundler filter shipped with Ardor: src/java/nxt/addons/AccountPropertyBundler.java and PersonalBundler.java

You need to be familiar with internal Ardor interfaces in order to write your own bundler filter.  The bundler filter runs as part of the server and is loaded during server initialization.

You specify a custom bundler in nxt.properties by setting nxt.bundlingFilter.


Who runs www.bitcoin.org? The original client that can be downloaded from www.bitcoin.org is often referred to as the "official client". Similarly many regard www.bitcoin.org as the "official homepage" of the project. So, who runs it? Is it the core developers? Some Bitcoin association? Or just a private person?

Collecting some of the publicly available information that I found.

Martti Malmi (aka Sirius), a student of Aalto University in Finland, was one of the core developers early on in the project. Satoshi attributed some of the new features of version 0.2 to him here and he was the one making the first commits to the Sourceforge repository back in August 2009. He was removed from the list of project developers on bitcoin.org in June 2011.

As Andrew points out in his answer, both bitcoin.org and bitcointalk.org is owned by Martti. He is the administrator of the bitcointalk.org forums, still active there, and could most likely be contacted using the PM feature on the forums. Both Martti and Gavin Andresen (lead developer) have access to the bitcoin.org website.

Edit September 25th, 2011: The code for the bitcoin.org website is now hosted under the Bitcoin project on GitHub. This means that you can post issues/suggestions there or make a pull request if you wanna add or change something.


Do I need to move bitcoins stored in a paper wallet? In mid 2012 I used bitaddress.org offline to generate address/private key pairs. I purchased bitcoins and had coins sent to these addresses. Do I have to move these bitcoins to keep them in the active chain? (I've read about the May 15 deadline to update the client, but never use a client).

Uh. No.. leave them be. Unless you need  to spend them.


Who recomputes and announces the difficulty in Bitcoin? I know that the Bitcoin difficulty is recomputed every 2016 blocks (about two weeks).

But who is responsible for this job and how is the new value announced to all miners. Does every miners do the computation or is there a specific entity of the network do it?

All nodes and all clients have this logic hardcoded into them. So in that sense, everybody is responsible for understanding that every 2016 blocks the difficulty changes.

The calculation that is hardcoded into each client is described here: https://en.bitcoin.it/wiki/Difficulty#What_is_the_formula_for_difficulty.3F

So it's not a piece of information that is announced or broadcast. Since each node knows about every block that appears in the network, it can calculate on its own the difficulty, without the need of a third-party.


i have 0.10096 mbtc (0.00010096 BTC) in my btc wallet but when ever i try to send bitcoins it always says your balance is low to pay the fee kindly tell me how much fee is charged over 0.1 mbtc as i have this much amount and i want to send it but it always shows this balance is too low to pay charges.

The fees you may pay for a transaction do not depend on the amount to be transferred, but to the transaction size. Transaction size highly depends on the number of inputs and outputs, as well as the type of those.

For example, a normal Pay-to-PubKey-Hash (P2PKH) transaction with a simple input, lets say with the exact amount you referred to (0.00010096 BTC), will pay less fees than a transaction with the same amount but 2+ inputs.

Can it be that you have such amount of bitcoins spread in really small amount transactions?


What is the best way to differentiate users' balances in a shared wallet? first time posting around here. I have been thinking about an application that would highly depend on the use of bitcoin for the best user experience. A shared wallet for all users currently seems like the best option since we're talking about users making multiple micro transactions here (not actual transactions in the bitcoin network), with a database always keeping track of who is entitled to what amount of BTC inside the platform. Users would initially have to send BTC to a shared address, thus "funding" their account. But what would be the ideal way to confirm that a user has sent, say, 1 BTC to the shared address and then associating their account with this specific value in my database? I have been thinking about some solutions but would love to hear from all of you. Thanks in advance!

Creating individualized addresses for each user is the best course of action, it is what the vast majority of services do. Using a BIP 32/44/49/84 HD wallet, you can derive individualized deposit addresses for each user, in a way that is easy to manage through your backend.

Making a single deposit address not only makes it difficult to differentiate between user deposits, it is also bad for the privacy of your users, and your service. Why allow every user that learns your deposit address to know how many coins your service has received over time?

If you are storing user funds you should also be diligent with your backend coin management (ie, you should use proper cold storage methods, to reduce the risk of user funds being stolen). This means you’ll need a system of hot/cold wallets to manage not only deposits, but withdrawals as well. So just using one monolithic address will not be sufficient in this sense either, and this is perhaps even further reason to not build a system with just one deposit address.

If you really need to create just one deposit address, then you could have users sign a message using the private key of the address(es) they sent BTC into the wallet from. This would prove ownership of the deposit ina cryptographically secure way. However, the vast majority of user-friendly wallets do not provide a message-signing functionality, so it would significantly hurt UX and usability of your platform to require this. My guess is that many BTC users will likely not have any idea how to sign a message like this in the first place.


Why does blockchain.info report "Estimated Confirmation time" not as 10 minutes? Currently, it is a timer which counts down from 10 minutes starting when the transaction is first seen. When the timer reaches 0 minutes, it switches to "Unknown / Never."

It is my understanding that finding blocks (and confirming transactions) is a Poisson process, hence the correct value should be a constant "10 minutes" and then "Confirmed!"

Is my understanding wrong?

You're correct; the expected confirmation time from any given point in time is always around 10 minutes (it may be a little more or less when the network hash rate has changed since the last difficulty adjustment). This question looked at that exact issue.

Note that a retailer (or other transaction acceptor) doesn't necessarily need to wait for a block to be solved in order to accept a payment though. More info here:

How has the problem of waiting for confirmations been eradicated?
How do I safely accept bitcoins without waiting for confirmations?


Why is Protoc 3.0.0 breaking Make Install of Bitcoin source? I am trying to build bitcoin from source, and am running into some problems with protoc, when I run sudo make install on the source code I get a version error for protoc:

sudo make install
Making install in src
make[1]: Entering directory '/home/q/plusonecoin-master/src'
make[2]: Entering directory '/home/q/plusonecoin-master/src'
make[3]: Entering directory '/home/q/plusonecoin-master'
make[3]: Leaving directory '/home/q/plusonecoin-master'
make[3]: Entering directory '/home/q/plusonecoin-master/src/secp256k1'
make[3]: Leaving directory '/home/q/plusonecoin-master/src/secp256k1'
  CXX      qt/qt_plusonecoin_qt-bitcoin.o
In file included from qt/paymentrequestplus.h:10:0,
                 from qt/paymentserver.h:35,
                 from qt/bitcoin.cpp:24:
qt/paymentrequest.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
 #error This file was generated by a newer version of protoc which is
  ^
qt/paymentrequest.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
 #error incompatible with your Protocol Buffer headers.  Please update
  ^
qt/paymentrequest.pb.h:14:2: error: #error your headers.
 #error your headers.
  ^
qt/paymentrequest.pb.h:22:35: fatal error: google/protobuf/arena.h: No such file or directory
compilation terminated.
Makefile:8410: recipe for target 'qt/qt_plusonecoin_qt-bitcoin.o' failed
make[2]: *** [qt/qt_plusonecoin_qt-bitcoin.o] Error 1
make[2]: Leaving directory '/home/q/plusonecoin-master/src'
Makefile:9487: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/q/plusonecoin-master/src'
Makefile:682: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

I have tried building it with Protoc 2.4.1, 2.6.1, 3.0.0 and 3.2.0 but they all throw the same error. What is causing this error and how do I resolve this version issue?

Try running make clean. This error throws when you installed a different protobuf version.


Does Electrum use Bitcore Apis as it's backend? Does Electrum use Bitcore Apis as it's backend or not?

If not, then what is the purpose of developing Electrum when Bitcore Apis provides all the features Electrum has (like HD wallets and master seeding)?

Electrum uses the electrum-server backend (electrumx is a newer variant)

In fact, electrum actually predates bitcore by about 2 years.

As to why there are multiple implementations of similar APIs and softwares, the answer is really "Why node?". Even the bitcoin node software has multiple implementations (Bitcoin Core and btcd, for instance).

This is a very open source friendly space, and it is generally actively encouraged to have multiple approaches to a problem.


BitcoinCore cant load wallet I have retrieved an old wallet.dat file from my harddrive that crashed about 5 years ago.
I have downloaded the new version of bitcoincore and downloaded the blockchain. I have then copied the wallet.dat file (which is in 96 kb) into the directory where the wallet should be.
But when i try to open the wallet.dat i get this sign: "Warning: Skipping -wallet path that doesn't exist. Failed to load database path'E:\bitcoin\wallet1.dat'. Path does not exist.
It says E because i had to download the blockchain on a separate hdd.
What could the issue be? I have tried to make new wallets and open them from the same directory and that has not been a problem. Can i somehow open the wallet to retrieve the private keys??

tldr: specify a directory not a file and have that folder contain a wallet.dat not a wallet1.dat.

Your error message said

 Warning: Skipping -wallet path that doesn't exist.
 Failed to load database path'E:\bitcoin\wallet1.dat'. Path does not exist.

However the help for the program says

-wallet=<path>
Specify wallet path to load at startup. Can be used multiple times to load multiple wallets. Path is to a directory containing wallet data and log files. If the path is not absolute, it is interpreted relative to <walletdir>. This only loads existing wallets and does not create new ones. For backwards compatibility this also accepts names of existing top-level data files in <walletdir>.

(My emphasis).
An example configuration file says
# Specify where to find wallet, lockfile and logs. If not present, those files
# will be created as new.
# wallet=</path/to/dir>

Your E:\bitcoin\wallet1.dat is a file not a directory
I can reproduce something similar by copying a valid wallet.dat to wallet1.data in a separate folder with no other Bitcoin files in it
C:> bitcoin-qt -wallet=c:\Users\ZZZ\Documents\wallet1.dat

So I think you could

rename wallet1.dat to wallet.dat
specify E:\bitcoin\ not E:\bitcoin\wallet1.dat.


How does a wallet use unconfirmed outputs as inputs after unconfirmed transactions? I have 10 btc on address A.

Using raw transaction, I send 5btc from A to B and set the change address as A itself. Now because the transaction from A to B is not confirmed I can't spend the remaining 5 btc.

But I saw that the QT wallet can do this. Ex:

I have 10 btc on address A. I send 5btc to B. The wallet creates a new address C and sets it as the change address. Then I try using the 5 btc on the wallet and it works. It allows me to send from address C.

1) Is the wallet using unconfirmed outputs as inputs here?

2) If so, how is it doing this and how can I do it using raw transactions?

3) If not, what's going on here?

Is the wallet using unconfirmed outputs as inputs here?

Yes.

  If so, how is it doing this

Except for coinbase transactions, transactions are independent of blocks. A transaction spending an unconfirmed input looks exactly the same as a transaction spending a confirmed input.

It's safe for Bitcoin-Qt to spend unconfirmed change because it knows that the input is valid and will be confirmed at some point (though probably slowly). It would not be safe for Bitcoin-Qt to spend unconfirmed inputs that it did not itself create because they might never confirm, resulting in permanently tied-up funds. (Very old versions of Bitcoin made this mistake, but it was corrected after widespread issues.)

  how can I do it using raw transactions?

You can create the transaction with createrawtransaction normally, but you'll need to give signrawtransaction some extra info about the unconfirmed transaction in its second parameter.


Browser wallet BTC enabled The Metamask extension enables the user to send and receive funds (ETH, ERC20s) to external addresses, and thus it is very easy to integrate in current dapps thanks to web3 injection.
Are there any similar solutions that also allow trading of non-ethereum tokens? In particular, I would be interested in integrating a BTC-wallet into an existing dapp, already connected with Metamask, to allow the user to send/receive BTCs to the platform.
Thanks

Use LN node for registration/login and has a browser add-on/extension: https://lightningjoule.com/
LNURL can be used to make browser extension/add-on that allows you to transact, register/login etc. : https://github.com/fiatjaf/awesome-lnurl
Liquality atomic swaps tool has a browser extension : https://liquality.io/atomic-swap-wallet.html
Maybe other bitcoin projects and hardware wallets have their own browser extensions as well. You will have to check particular project for it and if it doesn't exist, it can always be created considering it's open source and people can contribute if they think something useful is missing.
Maybe there are other applications/wallets that have browser extensions although I don't consider using a browser extension secure for anything related to bitcoin. Standalone desktop/mobile apps should be considered more secure IMO.
You can also check below question which has an idea and few doubts/questions involved. Unfortunately no answers.
Can we use lnurl-auth to create a better password manager?


How can I split blockchain data over two hard drives? My node has two SSDs and the first one is filling up. The second one still has ~230GB available and I would like to move old blockchain data over there to free up an equivalent amount on the first drive.
How can I do that? The node is running on an old Win7 machine.

You can either move a whole folder to you other disk and link it back to your original location with soft links, or move the files and make hard links for all of them.
The windows command for doing this is mklink. It's like creating shortcuts to files in other locations/drives.
I've only tested creating soft links (I moved index folders from HDD to SDD for speed) and I can confirm it works. I think hard links should work as well.
In your case, moving the folders wouldn't solve your issue, since the data would still be on only one drive. So the solution would be to move the large files to your "empty" disk and make hard links for all those files.


How do I do the maths for starting a bitcoin mining startup in Kuwait? Kuwait has the world's cheapest electricity which makes it a good choice for bitcoin miners. I am talking to a businessman in Kuwait who is interested in helping me move to Kuwait from Pakistan and provide me with the required hardware if I am able to convince him it would make a good profit.

I am looking for the details of all the costs involved in starting a bitcoin mining startup and its costs in Kuwait.

Thanks

There are many bitcoin mining profitability calculators all over the web:

http://www.bitcoinx.com/profit/
https://mining-profit.com/calculator
http://www.coinwarz.com/calculators/bitcoin-mining-calculator

You would have to get your hands on some hardware, which can be quite expensive indeed. The only advantage you have is the recurring electricity cost, but note that the hardware is not cheap and often takes many months to make profitable. You'll need a good contact at BitMain or some other ASIC manufacturer so you can get your hands on the latest hardware early so you can mine them for the longest time.

Best of luck!


What Means the Final Option in Bump Fee / Increase Fee Electrum Wallet Option Hello I want to know what will happen if i put my transaction as Final can saves fee or no?

Selecting final will disable RBF for the transaction and you will not be increase the fee anymore.
Example: I did a transaction 7d1a7ecd1a68443c07f89f38180d3f3dc945edb2784ebfb7f7c113842d7d8509 with fee rate 1 sat/vByte, increased the fee rate to 3 sat/vBbyte and replace the transaction with d47e59db69c91f3e653da9c5ed0e0f9fc8fdc4422a4e8650d4d6b66c1db60f18 and increased the fee rate again to 5 sat/vByte but selected final this time so RBF was disabled for this transaction 2a7241f60d301ccda31a7be875d58610637534fe477e8c76d0e67bc31ef5824f
Cannot increase the fee rate anymore using RBF because it was disabled. Either I can wait for it to get confirmed or use CPFP.


Why is JSON-RPC over SSL "strongly discouraged"? The Wiki contains a page that simply states:

  JSON-RPC over SSL is strongly discouraged

Why?

I found a method for enabling JSON_RPC over SSL here. The post mentions nothing about JSON-RPC over SSL being strongly discouraged. What risks do I run by using it?

The RPC interface isn't designed to be used in any scenario which would require SSL, which would be access over the internet or other untrusted networks. It doesn't have the necessary denial of service protections or review to make it safe for use this way, and so letting potentially malicious clients connect to it would be incredibly unwise. If you need to talk to a remote bitcoind instance you are better off tunneling with SSH or stunnel which will provide a secure, authenticated path without exposing the socket any further than localhost.

As of 2017, support for RPC SSL has been completely removed to support the continued move away from reliance on OpenSSL in the daemon (unfortunately BIP70 mandates its inclusion for the GUI client).

As of 2019, all reliance on OpenSSL has been successfully removed from bitcoind.


How do addresses that refer to a web site work? Some bitcoin addresses on blockchain.info refer to an external website, see e.g. here:

https://blockchain.info/tx/40c09e1fb345d258b8123c5e6ceda3d53575def3053c87bf7d5571c74fc2227d

One of the addresses in this transaction is:

https://blockchain.info/address/1bonesNcbrNbHJZr33LV2gBmDS9m91TWz

This blockchain.info page shows the address as English text instead of a Base58 encoded string.

How does this work?

You can add a tag to your address here https://blockchain.info/tags

It will be shown on bc.i site


What can I do with Bitcoin Core to see my current balance? I've waited 4 days now for Bitcoin Core v0.12.0 to synchronise the network and its getting really frustrating, especially when I still have 2 years and 38 weeks worth of the blockchain to download.

The thing is I previously bought some Bitcoins to the address provided by Bitcoin Core before I realised that the blockchain had to be fully synchronised before I could see the transaction in the wallet! I now am a little bit stuck; Is there a way to move that Bitcoin address from Bitcoin Core to a completely new wallet like Electrum? Or is there a way to speed up the process of Bitcoin Core synchronising?

Regards,

Jordan Ellis

Bitcoin Core incrementally shows transactions you received as it processes blocks, so if you received the transactions a while ago they should pop up soon. You will not be able to independently verify the validity of your transactions without fully synchronizing.

If you just want to check the balance of your addresses it might be sufficient to look up the addresses on a public block explorer. The JSON-API gives you various methods for retrieving your addresses from Bitcoin Core. Once you have the addresses simply check their balance using a block explorer.

If however you'd like to move to a different wallet, the backupwallet API should give you a copy of your wallet that other wallet software can import.


nTime rolling is just an optimization for large/fast pools, correct? Need to confirm my understanding of nTime rolling...

It's used to give the miner more options to mine without needing to request more work from the pool, by incrementing the timestamp. However, given a sufficiently small pool, where the nonce space isn't even covered for any given block, nTime rolling has no significant advantage. You can scale the miners nonce range so that each miner is efficiently using bandwidth and time. And Because you're not covering the entire nonce space anyway, the scaling of a miners nonce range is all that is necessary to optimize efficiency.

As a follow-up, I guess it's perfectly possible that the entire nonce space produces zero valid nonces, and therefore you must increment the timestamp to ensure you have a chance, but just as before - for sufficiently small pools this doesn't come into play.

Is this understanding correct?

Is this understanding correct?

Basically, but you've failed to account for the small size of the header nonce space (32 bits) and the speed of modern hardware (on the order of 10 terrahashes per second per miner).

A 32 bit nonce can only provide 2 ** 32 = ~4 billion combinations.  That corresponds to 4 gigahashes.  A single modern miner can do more than a thousand times in half a second, so the nonce space is almost always exhausted without finding a block.

When Bitcoin hash rate was first increasing through the FPGA and early ASIC eras, nTime rolling was implemented so that miners didn't have to make significant changes to their hardware and software to deal with the problem of nonce space exhaustion.  However, that hack of a solution was increasingly less useful the faster hardware got, as a typical block can only move time around in a range of about two hours (3,600 one-second increments) and sometimes much less than that (this is especially the case when other miners are using nRollTime as they can use up the acceptable time values available to subsequent miners).

The correct solution was to put an extra nonce in the coinbase field of the generation transaction[1], something that was actually implemented in the original Bitcoin 0.1 software.  Changing any transaction in the block also changes the 256-bit merkle root in the block header, eliminating the risk of nonce space exhaustion.  This technique is now universally used by Bitcoin miners and usually implemented directly in the hardware (I think usually using a small FPGA for the extra nonce updates and merkle root regeneration).

[1] The coinbase field currently allows miners to add up to 96 arbitrary bytes without affecting any protocol features.  The company Coinbase is named after this field but has no other relationship to it.


Lightning Network Unidirectional Transaction In Lightning Network is it possible to setup a channel to make payment in on direction only.  For example Bob is buying Donut from Alice every day.  So Bob put in 0.001 BTC into the channel and pay Alice 0.0001 every day for the next 6 days.  My Question is does Alice need to place 0.001 BTC into the channel?.  Thanks.

All channels on the lightning network are bidirectional, even if they are only used in one direction.  However, this does not mean that both parties contribute to the funding transaction.  In fact, in the current spec only a single party contributes to the funding transaction.

That said, your scenario is not a good use case for its own channel.  The overhead of a channel for the purpose of paying for a weeks worth of coffee if probably not worth it.  Most likely you'd simply route the payments over an existing channel and through other hubs and channels.


What is NXT's "lessor"? While reading NXT's API wiki page I came across something called a "lessor", but I can't find its definition anywhere. What is a lessor?

A lessor, in general, is a person who leases a property to another.

NXT allows you to "lease" your forging ability to someone else.

So getAccountLessors gets a list of people who have leased their forging power to your account.


What happens when two transactions send to the same address? I would like to know the consequences of sending bitcoin several times to the same address. Let us say I send 1 BTC from Address1 to Address3 and later I send 2 BTC from Address2 to Address3 again.
The blockchain will have both, 1 BTC and 2 BTC transactions registered. So, What hapens when I want to send 2.5 NTC from Address3 to a new address?

It works just fine.

Bitcoin transactions can have multiple inputs and outputs; each input is a "pointer" to an output of a previous transaction (specifically, it consists of a transaction id and output index). So you  would create a new transaction with two inputs:

the A1->A3 transaction (or more properly, the particular output of this transaction that credited A3)
the A2->A3 transaction (again, the particular output).

It's not necessary to include amounts in the inputs, since the rule is that each input must be consumed completely.  So we now have 3 BTC worth of inputs in our transaction.

An output consists of an amount and a destination address. (One can also have a script which directs the payment in more elaborate ways, requiring multiple signatures, etc, but let's ignore that for now.)  You would want to have two outputs:

An output paying 2.5 BTC to the desired destination address, call it A4
An output paying the "change", 0.5 BTC, to some address of yours.  You could use A3 again, but it is generally better to use a newly generated address; call it A5.

(Actually, in real life, the second output would more likely be something like 0.4995 BTC.  The leftover 0.0005 BTC wouldn't appear in any output; it would be a transaction fee, collected by whichever miner includes this transaction in a block.)

For an end user, this is all done under the hood by their wallet software.  The user just specifies that they want to pay 2.5 BTS to A4, and the software takes care of identifying appropriate transactions to use as inputs and creating the necessary change output.  Sometimes this confuses people when they see that after the transaction, the balance in A3 has dropped from 3 to 0, if they don't know that the remaining 0.5 BTC has gone to a new address A5 which is still theirs.


Wouldn't the expected return of a mining pool be no more than solo mining? I don't understand the advantages of pool mining if you want to maximize your return.  It seems like all it does is even out your return to make it more predictable by paying you smaller amounts more often rather than nothing for long periods punctuated by an occasional 25 BTC.  But in the end won't you end up making the same amount, if not less (considering the pool operator's profit) by joining a pool?

Yes, but it's a similar situation to taking out insurance - many people would rather pay a known regular amount to insure their car than take the chance that they'll have to pay a large amount occasionally. Like pool mining, insurance usually works out in favour of the other party, but it's still valuable in order to reduce your variability.

If you have enough mining hardware operating that your payments are relatively regular, then it would likely earn you more to solo mine. If you would only solve a block very occasionally, you are taking a significant risk you'll get a low reward or nothing at all.

However, you also need to run bitcoind to solo mine, whereas you don't when pool mining. The more mining hashpower you have, the more bandwidth pool mining will use, but running a node will use a roughly constant amount of bandwidth. Update: pools are now available that avoid this problem (Thanks, Dr Haribo).

Back in the days when I mined with my GPU, I would've had to upgrade my internet account if I left the client running 24/7, which would have cancelled out any benefit from solo mining.


Is there a way to import bitcoin wallet into BitcoinJ? I tried to create bitcoin wallet that could be available as from BitcoinJ as from standart desktop wallet client (Bitcoin.com client e.g.) but it seems that I don't get something important.
I exported the wallet from desktop client which looks like
this.
After decrypting it with https://bitwiseshiftleft.github.io/sjcl/demo/, I got this.
The problem is the Wallet.class methods to import wallets are all eventually have seed creation time as a parameter, which is not stated in exported version of the wallet (setting it randomly doesn't help).
So basically I need any options to transform this exported data into working BitcoinJ wallet.
Any help or advices would be gratelly appreciated!

You need to pass DeterministicHierarchy.BIP32_STANDARDISATION_TIME_SECS if you want to use it as a normal BIP 32 wallet. The sample code that you have should do the rest.


After connecting to bitcoin-core (0.10.0rc3) I received:

ERROR: CScriptCheck() : 620186f101b7db97393af8747923db4cf3f30c3c3c48f4c7cfc23567b6d9ca07:0 VerifySignature failed: Data push larger than necessary
ERROR: AcceptToMemoryPool: : ConnectInputs failed 620186f101b7db97393af8747923db4cf3f30c3c3c48f4c7cfc23567b6d9ca07

(Thanks bitcoin devs for adding sane error messages!)

From here I noticed I was building the transaction with an outdated fork of bitcoin-ruby, updating to the latest bitcoin-ruby fixed this issue (On both 0.9.03 and 0.10.0). Still not sure why it would only relay after a bitcoind restart, will edit this answer if I figure this out.


2 years and 30 weeks to import blocks? Im using litecoin and it says its gonna take 2 years to import blocks heres a screenshot:

i have bootstrap.dat

This is a misconception and applies to everything based off Bitcoin's UI for the functions.

The bar at the bottom of the User Interface is not the "time to sync".  It's stating the last day/date (and how far in the past) the last synced block had on it.  Your client hasn't yet imported the rest of the blocks, so in a while it'll say 1 year or such.

That should decrease and reduce in the "how far in the past is the last synced block" value rapidly, as your computer churns through the blocks and imports and processes them.


Getting Imported address privet keys. (Blockchain) Am trying to get the private key for an imported address but am unable to do so.
I did tried to use the blockchain method but still unsucessful as I don't have the  private key on the tab.

Only if you have inserted the private key, you will be able to export the private key again. So in your case, you never gave blockchain your private key. So you are unable to export it. Blockchain cannot magically create the private key.


bitcoin smartcontract feature I am a noob, so please bear with me.

I'm wondering whether the Bitcoin Core team plans to integrate a smart contract feature evolving the Bitcoin scripting language in a more sophisticated one in the near for far future.

Afaik, the only work currently done is on sidechains. Any clues?

there is no such improvement planned for the protocol, only the expected BIP are listed in  https://github.com/bitcoin/bips/blob/master/README.mediawiki.
but you should understand why in bitcoin only a limited scripting mechanism is used instead a VM with a contract language as for Ethereum (security reasons). the project RSK aims to provide such opportunity through a sidechain, so explore it.


How do economists view Bitcoin? Have there been any articles or presentations about Bitcoins in any influential or respected economic websites or perhaps interviews with notable economists?

Paul Krugman, who is apparently the "17th most widely cited economist in the world today", wrote this article in Sep 2011:
http://krugman.blogs.nytimes.com/2011/09/07/golden-cyberfetters/

Personally, I'm not convinced that Krugman fully understands Bitcoin though (after all, it has substantially different properties to other money), and I'm not the only one. Some responses to his comments are here:

http://presentcynosure.wordpress.com/2011/09/10/krugmans-bitcoin-error/
http://www.theatlanticwire.com/business/2011/09/paul-krugman-incites-bitcoin-cyber-geek-infighting/42188/


When a transaction is split into two outputs, how does the network "know" you're the owner of the "change" address? Reading this thread about how transaction outputs are split due to "change" made me wonder how the bitcoin network knows you own that second address. How does your wallet/client display the correct balance, if it's unknown to everyone else that the second address is yours?

I'm assuming it has something to do with the wallet and accounts... if so, how can you find the "account" that corresponds with that address?

The bitcoin network does not know who owns which address. The concept of an address doesn't even exist at the protocol level - it's just an authentication layer on top of the scripting logic in transactions.

And of course your own client does - because it has the private key for change addresses it generated itself. That's all that matters. When spending a transaction output, the client will prove that it holds that private key by creating a digital signature that matches the address. That's all the network cares about.


Why is an invalid pubkey accepted in the blockchain? while trying to understand the address validation process, I fell upon this block : https://blockchain.info/tx/3d29f43a3278281192943276049c15e5f0d8c7e75d4d99a4cd6693113a948f48
In the outputs, the first two are regular pay-to-hash, but the last one is a pay-to-pubKey (the block was mentioned by the developers from blockchain.info as a bad solution to embed an ASCII message in the blockchain). My question is : as this pubKey is invalid, where does the address (1Du8MpTTV4VrQMHtgP4mG1Fq9q3ykb3L8h) come from ?
I could not manage to get it by hashing the pubKey...

thanks

Why is an invalid pubkey accepted in the blockchain?

It was intended as a message, not as a public key.
It is accepted in the blockchain because it is a valid output script, whether or not it is spendable is not relevant.

Where does the address 1Du8MpTTV4VrQMHtgP4mG1Fq9q3ykb3L8h come from?

That address is a result of the software blockchain.info uses to generate an address from an output script. Why or how that works is something you'll have to ask whoever wrote it.


What is SPV mining, and how did it (inadvertently) cause the fork after BIP66 was activated? I'm curious to hear an in-depth explanation of the hard fork and how it was caused; I've heard/read a great deal but I'm lacking a cohesive explanation.

SPV mining is the term commonly used for 'less-than-full-node-validation' mining. It usually means that miners skip the verification of the block and the transactions within, and immediately start mining a new block referencing the just-solved block header. However, since they don't know what is in the last block, they have to mine without any transactions (except for the coinbase transaction), to be sure that they don't mine a block with transactions that conflict with transactions in the previous block.

After BIP 66 became enforced, about 5% of the network was still solving version 2 blocks (BIP 66 enforces blocks use version number >= 3). One of the miners in this 5% solved a block with version 2, and if everyone had been doing full validation, then their block would have been ignored and replaced by a version 3 block. That is what was supposed to happen.

But, unfortunately, a few pools (F2Pool was the biggest one, I think), started mining a new block that referenced the invalid block header without verifying the transactions in it or that the new header used a version number of 3 (as just became enforced). Miners will sometimes directly connect their full nodes or monitor each other's work APIs to see when another pool has solved a block, so that they can start working on a new block as quickly as possible. In this case, a few pools heard that BTC nuggets solved a block by listening to their Stratum API, and started mining on it. They didn't even have the block header, just the hash of the block header.

https://en.bitcoin.it/wiki/July_2015_Forks#Invalid_Block_Hashes shows the invalid blocks:

0000000000000000009cc829aa25b40b2cd4eb83dd498c12ad0d26d90c439d99 mined by BTC Nuggets (98 non-coinbase transactions)
0000000000000000155f2519d35cd5d2869900bcc5093594b27763a0315390b4 mined by F2Pool (0 non-coinbase transactions)
00000000000000000cb7a20ee4e199e347ad7369936abae53a1518efa531ec61 mined by F2Pool (0 non-coinbase transactions)
00000000000000000966d65e0fd87d1d5a8f154a2c955816c28e2006e381aa18 mined by AntPool (0 non-coinbase transactions)
00000000000000001301bfd6f566a421c7eeba103d09b312032ca065cb185de7 mined by F2Pool (0 non-coinbase transactions)
000000000000000013fe26675faa8f7dccd55ce5485bb6d0373fa66345901436 mined by F2Pool (0 non-coinbase transactions)

One of the Core Developers, Gregory Maxwell, also posted an explanation here, which you may find useful.