scammed by a scammer First of all, this is to bring awareness of how an attacher may gain access to a persons' Blockchain Wallet:
 i hope this never happens to anyone else but it probably will. i am quite new to bitcoin, like probably a month. I feel stupid, no one need remind me.
what happened is this:
 i was on fb asking questions about a transaction i did to a third party that was pending for like 2 days, and the other person still hadnt seen it yet in their account so i was worried.  so i was asking about this happening etc.  and a person on fb commented it wasnt unusual to take a while for transactions to process.  so start private messaging, asking all sorts of questions. says he works for blockchain. And then he says this" blockchain wallet is starting to do mining with the extra funds in a wallet but it is only available in certain countries, not in the us yet, due to regulations. so we talk on, he says he can set up a new blockchain wallet to also do mining with the extra funds even if i live in the states.  then if i want i can fund it. so i create the wallet with no btc in it, and send him the identifier and pw. he was supposed to do some settings to it to access the mining aspect,, and i log back in, change the password,,  and fund it, i see the balance in the new wallet and after few seconds balance goes to zero.  he says that is because it is now in the mining side of blockchain. then he says, add more btc to see what the proceeds are from the mining.  i am starting to realize right then i had been scammed.  he kept saying no, just add more btc to see the balance, etc.  it went on like that for a while. i was out a few hundred dollars. what I think what he did was sink his smart phone to the account and it stayed sinked to the account, even though i changed the pw.  or perhaps there was some crypto-key he accessed and was then able to take the money out. i still dont really know. but i think BLOCKCHAIN Wallet should plug that hole !  so it doesnt happen to more people...  so i have changed a bunch of my passwords, etc, hoping that's the end of it. i had my cellphone listed in the verify section etc. so i went in and put in another number hoping that stops anything there. after this, i really had to re-think bitcoin and how easy it was to get scammed. i would say i was very tired, been working some long hours, and was worried about the other transaction going thru. i know there is no way to get it back, just have to take the lesson, but i want to make sure there are no other doors for this guy to walk thru since he got that information. also, he would have had the private key off the log in and just got it that way somehow.. Something Blockchain could do that would have prevented this: Not to allow more than one incidence of the wallet being open at once, or Notifying the user when more than once incidence is Open.
 Has anyone else been scammed , please share what happened  ?

Yep, you got scammed all right.  Sorry to hear about that.  As I suppose you have realized, everything the guy told you was total nonsense.

  perhaps there was some crypto-key he accessed and was then able to take the money out.

I think that's exactly right.  Blockchain.info lets you (i.e. the person with the password) retrieve and back up the private keys and wallet seed for the addresses in that account.  Having the private key for an address always allows you to spend money received by an account; if you have the private key you don't need any other passwords or anything else.  Keeping a backup of the private keys guarantees that you will have access to all funds received in that account, now or in the future, even if you forget your password, change it to something you don't know, or if the blockchain.info site quits working.

Of course, when someone else has the password and uses it to get the private keys, they get this same power, and can spend the coins even if the password is later changed.

  i think BLOCKCHAIN Wallet should plug that hole ! so it doesnt happen to more people

I don't think they should, since as I mentioned above, if used properly, it's not a hole, but a safety feature.  One of the things that many people like about Bitcoin is that it's decentralized - your control over your funds is not dependent on any one company or government.  Having backups of your own private keys is a big part of that.

  so i have changed a bunch of my passwords, etc, hoping that's the end of it. i had my cellphone listed in the verify section etc. so i went in and put in another number hoping that stops anything there

Caution.  The scammer still has the private keys, so he still has the ability to take out any further funds you might put in that account.  As you saw, changing the password won't help with that, nor will the two-factor authentication.

The best thing to do would just be to never use that blockchain.info account again.  If you still want to use the site, make a brand new account.  (There might be a way to reset the private key - I am not sure - but I would be reluctant to try that unless you are sure you know what you're doing.)


Transaction doesn't show up in my Blockchain wallet I am a beginner at Bitcoin. I sent my 0.0161034 BTC from LocalBitcoins to my Blockchain account. It said that it would take up to 30 minutes, but after 16 hours I still didn't get any money in my Blockchain wallet or anything to show up in the transaction history there. I also tracked my transaction on an explorer, where it's confirmed by 72 but it still doesn't show on my Blockchain wallet.

target your transaction on this site. Also review this


how to prevent losses after a hard or soft fork i learned about hard and soft forks from this question; now i have a basic understanding about forks; but the answers of that question did not say what happens to transactions on the stale chain; if i understand correctly those transactions are simply given up? but this looks like people would lose their money if they received payments on the stale chain; how does the bitcoin protocol protect them in this case? (there is a timer for confirmation of transactions but i am still not sure how it is being used and why it is adequate;)

what happens to transactions on the stale chain; if i understand correctly those transactions are simply given up?

Correct. In the case of a stale (abandoned) chain, any transactions that happened in the stale blocks (that did not also happen in the active chain's blocks) would no longer exist on the bitcoin network.

  but this looks like people would lose their money if they received payments on the stale chain; how does the bitcoin protocol protect them in this case?

Also correct. There is no built-in 'protection' against having a transaction included in a stale chain. As a user, it is almost always recommended that you wait for a few confirmations before you consider a transaction as fully settled. This helps ensure that your transaction isn't included in what will eventually become a stale chain. Often, people quote six blocks as being a high level of assurance.

In practice, we can see that it is exceedingly rare for there to be a stale fork that runs longer than just a couple of blocks. See this question for some examples of past forks.


A "Bitcoin for dummies" guide? I would like to introduce a number of people that are not necessarily tech-savvy to Bitcoin and instruct them how to make their first payments. Is there some "Bitcoin for dummies" guide that I could be referencing that would be understandable to anyone capable of using a computer and the internet payments?

I have created a page on the Wiki called "First time buyers guide". It is only a rough version at the time of writing, but hopefully it will be revised into a go-to guide for anyone wanting to make a payment with Bitcoin with as little unnecessary information as possible.


Why is DiabloMiner using so much CPU now? DiabloMiner uses about one 50% of CPU on my system (distributed among 2 cores). I could have sworn that it used almost no CPU (1-2% max) in older versions, but I'm not really sure if I should report this as a bug or not. So, is it normal, or am I correct in remembering that GPU miner should not use more than 1-2% of CPU while mining?

Link: Possibly related question.

It almost certainly is related to the question you linked and it almost certainly has the same answer I'm sad to say. There is a lot of this going around and no one is really certain what exactly is causing it.

There have been reports that ATI's 11-7_vista64_win7_64_dd_ccc_ocl drivers often bring the problem about, and reverting back to an 11-6 version seems to fix it. Not sure if it will work for you or if it even applies to your situation but it's worth a shot.


How does hyperledger fabric handle random number generation? Given that one can write chaincode in JavaScript or Go and freely call random methods provided by the language libraries, how does the network handle the randomness?

Hyperledger fabric works in the order of Execute Order and Validate.So Execution steps is done in Endorser so execution is done with endorsement policy which is defined and it also removes randomization to avoid statelessness.

Next the Ordering of transaction is done with the help of Orderer.

Finally Validation is done with the committer to avoid double spending.This is basically to check the integrity of the transaction.


How to connect my mining pool to another mining pool What are some ways to connect my mining pool to another mining pool without altering any settings on the miners?

Outsourcing to a larger pool is definitely possible and can help reduce variance. Conceptually, to them you're just a very large miner. On your side, instead of submitting a found block directly to the network, you submit it to the larger pool, and any shares you accept can be passed on the larger pool. (Regarding difficulty settings: Having different difficulty settings between your miners and the larger pool is find as long as the larger pool's difficulty does not exceed that of any of your miners. If that is the case, you must either bring down the difficulty of your miners or convince the larger pool operator to raise your difficulty (which they may very well agree to, since it reduces the load on their stratum).

For the actual implementation, I'd talk to someone who's done it before. TradeMyBit outsources its LTC and DOGE mining to MultiPool. I've talked to the owner merc before, and he seems like a nice guy. You could try contacting him here to see if he's willing to give you any tips.


How do nodes behave in light of a doublespend? Recently I have been studying on the bitcoin. while going through the double spend process, I found this link as
How do I detect a double-spend?

and an answer there describes different scenarios:

  Double spending is handled like this -- if two transactions spending
  the same input(s) happen in the same block, both will be rejected. If
  one transaction makes it into a block before the other, the first one
  will be accepted and the second will be rejected. Now, if two
  transactions entered the network simultaneously, but at different
  endpoint, by the time the next block is mined it's likely that they
  would have made it into the same block and thus be simultaneously
  rejected. It's also possible that a block is mined containing one
  transaction, and all subsequent blocks containing the other
  transaction will simply be rejected. The third and least likely
  scenario is that two blocks are mined simultaneously -- each
  containing one of the competing transactions -- and this would cause a
  fork in the blockchain. However, this is the purpose of having
  confirmations, and by the time you reach 6, it's extremely likely that
  the forks have been reconciled and that one of these transactions will
  be rejected along with the rejected fork.

however I could not grasp it.

if two transactions spending the same input(s) happen in the same block, both will be rejected.

Is it possible that two transactions are in same block? To my knowledge, each node will validate the transaction before it is placed in the memory pool. So next time the same transaction appears, doesn't it invalidate the second transaction?

if two transactions entered the network simultaneously, but at different endpoint, by the time the next block is mined it's likely that they would have made it into the same block and thus be simultaneously rejected.

Isn't it the same case as above???

is it possible that two transactions are in same block. to my knowledge, each node will validate the transaction before it place in memory pool. so next time the same transaction appears, doesn't it invalidate the second transaction????

Yes, it is possible. The transactions that a node accepts to its mempool is completely up to the node and is not governed by consensus rules. The sane thing to do is to ensure that a transaction follows the consensus rules and some other local node policy rules before accepting it to the mempool, but that is not required. Thus if a miner is running custom software that accepts all transactions, they could produce a block which contains conflicting transactions.
Also, if a block contains conflicting transactions, then the block will be rejected, not the transactions. The block is then invalid, the transactions are still valid. If the transactions were first seen in the block, I think then both will be rejected.

2)if two transactions entered the network simultaneously, but at different endpoint, by the time the next block is mined it's likely that they would have made it into the same block and thus be simultaneously rejected.
isn't it the same case as above???

I believe the first scenario may be referring to two conflicting transactions which the miner includes in a block, not that the transactions were broadcast to the network. However both scenarios operate in the same manner.


What is the advantage of a market-specific cryptocurrency? Reading this article, http://nakamotoinstitute.org/mempool/the-coming-demise-of-altcoins/, I wonder why there would be a separate coin for each market, like a coin just for buying bananas, marijuana, disk space or photh-sharing instead of using a general purpose coin for those things?

I'm not asking why coins are technically different; having different hash-functions, mining hardware, proof of work vs. stake, virtual machines, privacy, how the coin is governed, etc.

I am asking why there are coins for each particular purpose.  I think it would be better to only use one coin for everything because there would be less middle-man in the exchange from BTN to STORJ and vice versa therefore lowering fees.

Why is there more than one fast-food service? Why is there more than one internet browser? The competitive altcoin economy encourages other coins to surge with better implementations. Bitcoin has very high transaction fees as of early 2018, this is why a fork came off as Bitcoin Cash a few months ago, but Bitcoin Cash is not the only coin fighting for low fees. We have seen RaiBlocks (No fees) and many other altcoins surge recently due to low fees. Some coins are created not only to solve a problem, but to simply be better than the current coin. NAV wants to surpass Monero, by not only being a privacy coin, but also allowing anonymous Dapps and more.

A lot of coins have lucrative companies behind them, the answer to this question is not really different from the one of the question "Why is there more than one company in sector X"? People want to make money, so they will innovate and try to outperform the others with a better product.

Sometimes, companies will issue a token usually from an ICO to raise money on their platform. There's usually little reason for the purpose of their custom token/coin other than raising capital. A normal company would have to attract angel investors which is a lot harder than creating a coin and selling it while cryptocurrency is a hot asset. Doing an ICO also does not require to lose a share in the company. This is why we are seeing a massive influx in new coins.


How can I reverse a Bitcoin transaction mistakenly sent to the wrong address? I bought a bitcoin cash at a place called Bithumb in Korea and mistakenly copied the bitcoin address and sent it to the wrong. Obviously my fault is, but the fact that I can't get the cancellation done and lose all that money is very upsetting now.

Bitcoin, return my money right away. The money will not be sent anywhere, but it does not make sense that no refund is available.

2019. 5. 22. 13:20:14 BCH 20.121968
BitSumTXID:
7553dfd8ce04b2f78889224434f6602070c0ccdf81fb38a9e18307809d10d553

Id: 010  7122  1223

33zQhR8VGnHrXZuq4qz89VMqiWdCnPE51R

Firstly, Bitcoin Cash is not Bitcoin. Secondly, neither Bitcoin nor Bitcoin Cash have any sort of central authority or way to reverse/refund transactions. This is completely intentional - all confirmed transactions are final. The only way you can get a "refund" is to ask the person that you sent the Bitcoin Cash to to send it back to you. If you don't know who you sent it to or how to contact them, then unfortunately your money is gone.

The whole point of cryptocurrencies like Bitcoin and Bitcoin Cash is that it is like digital cash - once you hand someone cash in person, there's no way to get your money back except by talking to that person and asking them (or forcing them) to give you your money back. If you have no way to contact that person, then your money is gone.


How do Scripts work? Bitcoin protocol supports scripts.

How do they work?
How are those implemented?
What are their intended usages?
When are they planned to be used?

Scripts are one of Bitcoin's more clever features. The most obvious way to implement a crypto-currency is to make a transfer be to a public key. To claim the transfer, you sign with the corresponding private key. This is not the way Bitcoin works.

When you send Bitcoins (the out of a transaction), you send them to a script. When you claim Bitcoins (the in) of a transaction) you claim them with a script. To determine if a transaction input correctly claims a transaction output, the two scripts are combined and the result is executed. If the result is true, then the input claims the output. The scripting language is stack-based and roughly similar to Forth.

The transaction input (the script trying to claim the Bitcoins) runs first. It will typically put a public key and a signature onto the stack. Then the output (the script whose Bitcoins are being claimed) runs. It will typically confirm that the public key is the correct one and that the signature signs the transaction with the corresponding private key.

Thus, you get the same effect as if you just specified a public key and signature, but you have the option of specifying more complex scripts. Unfortunately, this kind of simple script is pretty much the only kind of script supported right now. The original developer(s) imagined much more interesting scripts including things like contracts, multi-party signatures, and so on.

M of N signatures are planned. This way, you could list, say 3 public keys such that any 2 of them could claim the Bitcoins.

Unfortunately, some of the scripting components are feared to have security risks, so many of them are disabled currently.


What makes an extended public or private key? I was under the impression that an extended public key was comprised of the public key + chain code, and I'm unfamiliar with what comprises the extended private key.

However this does not seem to be the case. As per pywallet:

The key consists of
            * 4 byte version bytes (network key)
            * 1 byte depth:
                - 0x00 for master nodes,
                - 0x01 for level-1 descendants, ....
            * 4 byte fingerprint of the parent's key (0x00000000 if master key)
            * 4 byte child number. This is the number i in x_i = x_{par}/i,
              with x_i the key being serialized. This is encoded in MSB order.
              (0x00000000 if master key)
            * 32 bytes: the chain code
            * 33 bytes: the public key or private key data
              (0x02 + X or 0x03 + X for public keys, 0x00 + k for private keys)
              (Note that this also supports 0x04 + X + Y uncompressed points,
              but this is totally non-standard and this library won't even
              generate such data.)

It isn't so straight forward as publickey + chaincode. Can someone deconstruct an extended key from beginning to end? According to the amazing iancoleman website the network has an effect on this as well, which doesn't make sense to me either but clearly (as shown above) it is a part of this formula.

The extended public key contains just a bit more information than the public key and chaincode, but the public key and chaincode are all that matter for key derivation. The rest is just metadata about the keys for wallets and people.

The version bytes distinguish between xpub, xpriv, and other types of keys. The fingerprint identifies the parent so that a wallet can know what the parent of this key is. The child index tells a wallet how to derive this key again from the parent.

  I'm unfamiliar with what comprises the extended private key.

The extended private key is exactly the same as the extended public key but instead of 33 bytes of public key data, it's 33 bytes of private key data.

  the network has an effect on this as well, which doesn't make sense to me either but clearly (as shown above) it is a part of this formula.

The network determines the version bytes. These version bytes are present in everything else in Bitcoin and is only to indicate to the user what network the key is used for. This is useful in identifying whether a key may be compromised (because e.g. it has been used for testing software)

  Can someone deconstruct an extended key from beginning to end?

Let's use xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw as our xpub.

Base58 decoding this gives us

0488B21E013442193E8000000047FDACBD0F1097043B78C63C20C34EF4ED9A111D980047AD16282C7AE6236141035A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC56B8B9C580

0488B21E are the version bytes as defined by BIP 32.

01 means that this key as at depth one

3442193E is the fingerprint of the parent key

80000000 means that the key is index 0h (0'th hardened key)

47FDACBD0F1097043B78C63C20C34EF4ED9A111D980047AD16282C7AE6236141 is the chaincode

035A784662A4A20A65BF6AAB9AE98A6C068A81C52E4B032C0FB5400C706CFCCC56 is the public key

B8B9C580 is the base58 check encoding checksum.


What is the currently most efficient and reliable method to store the Bitcoin blockchain in a local database? I have seen several posts on this before, and have tried all the suggested solutions, but I can't get any of them to work.

I am interested in analysing transactions with the OP_RETURN opcode for a project, and need to dump the entire Bitcoin in a database to start working on that. I have already installed Bitcoin Core and downloaded all data until today.

There is a list of tools available to do this, and I have had problems with all of them:

WebBTC: The files don't seem to be available
BitcoinDataBaseGenerator: This seems like the most promising solution, as it is easy to set up on Windows, and a MS SQL Server database is easy to use. However, after file blk005**.dat it crashed, saying that there are blocks with an unknown version. I also can't try to run it again because the queries to delete data from that file won't finish executing and timeout after ~2 hours. Looking at the issues at GitHub, people seem to be having problems with that too, as the repo is not maintained any more.
Blockparser + SQL: This only keeps the data in memory.
BitcoinABE: I have not tried this one yet. I read many issues that it is very slow though, and there are generally many open issues. Might work though, I will try later.
NBitcoin.Indexer: Made for Azure, I want to have a local database though.
Blockchain2Graph: This also seems promising, and it is under active development. It uses neo4j, which is fine. At the moment I have no preference for either SQL or graph databases. I set up a Debian Virtual Machine and followed all the steps, which did work. However, at the end I can't get the application to actually show up in the browser. From my understanding it uses RPC calls and not the blk*.dat files directly.

Then I found one more on Google:

Bitcoin-to-neo4j: This takes the block files directly and puts them in a neo4j database. The problem with this is that the database is apparently six times the size of the actual Bitcoin data. I don't have 1.7 Terabytes of free storage space available. It also mentions that it takes several weeks to process it all. I simply don't have the time to wait for that.

So, my question is if there are any other tools currently available to easily write the Bitcoin blk*.dat files to a local database. Maybe I did something wrong, with the above mentioned solutions, but none of them seem to be an ideal solution. How easy would it be to write a custom application that only extracts the data I'm interested in, and are there code templates for that?

There are roughly two approaches as you've noticed:

process the block .dat files from running bitcoind
rpc to a node, pull blocks or headers, and batch process them in parallel

For speed, probably doing #1 is best, as BitcoinDataBaseGenerator does.  Unfortunately, as you've noted, it stopped being maintained in early 2017 and so does not support Segwit.  I think in practice, a lot of people do 2, as you can then rely upon external nodes maintained by others.

I have a working prototype using #2, but will not link it here, as it is missing some things.  I only mention this to say that I did not find it tremendously difficult to do so (the work I did was scattered over a period of time where I was busy with other things also).  I think probably the real challenge is trying to construct the right tables for whatever you need; the actual work to persist the blockchain data into say, a Postgres db, is fairly straightforward.  It did take me a week or so to persist the data, but this was using a small EC2 instance.

It is rather surprising solutions aren't more widely available, but in the end, understandable.  I do think everyone needs to tweak their databases a certain way and it's just easier to process the data yourself in a way you understand.

Having said that, the Cross-Chain Group has a working implementation that connects to an Electrum server and persists it into sqlite.  Looking through the code, I don't believe it would be difficult to change the persistence code to persist to another db.  They've done the hard work of processing the block headers and transactions.


How does the lightning network affect miners? Not a miner here, just wondering what other changes might be coming to the space.

With Lightning fees are really low, how do miners manage this?

Does this have a simple answer or is any resource I can look?

Thanks in advance.

Miners do nothing with Lightning Network due off-chain transactions.

Miners are confirming only on-chain transactions.

Source


BlueFury BF1 and Mac OS X I've been mining with ASIC miners for a short while on Mac OS X and recently bought a few BlueFury BF1 miners but no matter what I can't get them to work.

bfgminer 3.3.0 states:

/dev/cu.usbmodem1d11 is already in use by another process

And bitminter and cgminer do nothing.

You can use bfgminer or the FPGA/ASIC window in MacMiner without removing parts of Mac OS

http://fabulouspanda.co.uk/macminer/

you can download just bfgminer and/or cgminer compiled for Mac OS X here:

http://fabulouspanda.co.uk/commandline/

Then you won't have to kextunload every time you restart your computer.


Where is the lightning history persisted? In relation to this question:

Alice & Bob where they transfer 1 BTC each other.

Both Alice & Bob transfer 1 BTC into a shared multisig address.
A ‘balance sheet’ is created where 1 BTC is paid by Alice -> Bob and 1 BTC is paid by Bob -> Alice.
In the above transaction, Alice signs the transaction and gives to Bob and vice-versa.
Either Alice or Bob can sign their counterparts payout transaction and broadcast it to the blockchain.
Alice will update the ‘Balance sheet’ as 0.5 BTC to Alice and 1.5 to Bob and send the payout transaction to Bob to sign.
To ensure neither Alice  or Bob revert to the old transaction, each will create an ‘anti-cheat’ transaction.
If Alice and Bob wants to close the channel, they can consensually close the channel and broadcast the transaction to the blockchain.

Where is this balance sheet persisted? What happens if BOTH Alice AND Bob lose this information?

We like to say that Bitcoin is decentralized, and it is, but all the data can be viewed as having a centralized "source of truth": the blockchain.  All transactions that have ever occurred are a part of this source of truth.  The management and upkeep of this source of truth, however, is decentralized.  Nobody is in charge of it, yet everybody agrees on a single set of data.

The lightning network, however, is even more decentralized.  It doesn't just manage and update itself without central authority, but there is no agreed upon "truth" of the network.  The activity that occurs between two participants in a channel is only the business of the participants, and nobody else ever needs to see it.  Therefore it is not shared, and unless the participants want to, it is not stored.  Once a channel closes, the participants have completely settled all transactions between each other with a single transaction to the main Bitcoin blockchain.  They may very well persist the activity data for their own purposes, but it is in no way required for them to continue to participate.


How do I empty the memory pool? I have some transactions pending in the memory pool, how do I empty the memory pool without restarting bitcoind ?
I would like the transactions to be cancelled also.

Has the transaction already been mined into a block? I'm assuming not since it's in your raw mem pool. Why wasn't it mind in that case? Did it not have any fee?

I would try sending the coins to yourself with a much larger fee than the original transaction. Like Steven Roose said above, once transactions have been sent out to the network, they can't really be undone. Even if you delete it from your raw mem pool, it's still in everyone elses raw mem pool just waiting to be confirmed.

To make your own custom transaction that spends the UTXOs you want to spend, use the rpc calls:

listtransactions
listunspent
createrawtransaction
signrawtransaction

The default behaviour is for clients to accept whatever transactions spend an UTXO first. So most standard clients will not accept secondary spends of specific UTXOs. Mining pools may be a little bit more persuadable.

Not sure how viable this is, but I just found this: http://www.bitundo.com/. Read up on it before giving any money to a service like this. It also only works for transactions that haven't been confirmed into blocks at all yet.

I would also read this article http://bitcoinmagazine.com/2960/instant-transaction-fraud-an-explanation/. It has some very interesting stuff relevant to this question.


what distribution does the hashrate follow? Where can i find historical data for the distribution ?

How does it fluctuate ?  It is not constant, correct ?

Mr Nakamoto in his white paper assumed it was constant ?

Hashrate

The number of hashes a miner can do per second. What you seem to be referring to is Network Hashpower: the amount of computational power of all the miners on the network. This was not assumed to be constant, but the block time was intended to be close to constant, hence the reason the difficulty is adjusted based on how often blocks are mined.

Estimating network hashpower

How would you estimate the hashpower of the entire network without knowing all of the miners and details about their hardware, and how long they are running? You could potentially see the rate that shares are submitted to pools (and their difficulty) if you have access to that data. But, more likely you'll have to estimate it based on the current difficulty, and rate that blocks are solved. This can calculated based on the probability of finding a hash at the current target by guessing randomly, and then how many guesses per second (hashrate) it would take to get one every 10 minutes:

Hashrate = (1/P)/Blocktime, where

P is the probability of guessing a hash that solves the block at the current target
Blocktime is blocktime in seconds (600 seconds for bitcoin)

  what distribution does the hashrate follow?

Here are some charts:
https://bitinfocharts.com/comparison/hashrate-btc-bch.html
https://bitinfocharts.com/comparison/difficulty-btc-bch.html

You can see that the difficulty follows the network hashrate. As the hashrate increases over time with more user adoption (miners coming), the difficulty increases to maintain a 10 minute block time.


How much are bitcoins worth? I'm new to this bitcoin thing-I am trying to find out what is the conversion of bitcoins to US money? I.E. a bitcoin is equal to how much US dollars? Thank you for your help.

The best place to find bitcoin's current value is probably bitcoincharts.


How do Bitconnect Creators Hide their Identity? Does government really seize Bitconnect assets?

This asks if Governments really seize bitconnect assets.

There are a bunch of legal arguments.

However, with all legal arguments aside, is there anything governments can do to nail the creator of bitconnect ponzy?

It seems that no body knows who created bitconnect. They are invincible.

But how come?

Their website is accessible openly. How did they pay for their website that allows them to host anonymously? Do they pay with bitcoin too?

What did the silkroad do "wrong" that bitconnect did "right"

How do Bitconnect Creators Hide their Identity?

By using services† that either do not ask their customers for identification or which do not adequately verify proffered identification.

By paying for those services using payment methods which are anonymous, or at least pseudonymous (e.g. Bitcoin, pre-pay debit-cards, fiat cash, ...).

† domain-registrars, web-hosting, ISPs etc


What type of smart contacts will be available on Lightning Network? What kind of contacts will we be seeing eventually on LN? Will it be anything like what Ethereum has?

(This is according to my understanding, so any comments are very welcome.)
Lightning Network Summary
Currently, the lightning network operates by first creating a transaction on the blockchain, this is called a channel. See LND Overview.
When someone does a transaction on the lightning network, they create a transaction that they sign, which could be signed by the recipient and "closed out" at any time, which broadcasts the final state of the channel to the blockchain.
The fact that either party can close the channel at any time by broadcasting it to the blockchain means there isn't any loss of trust. With this level of trust, this limits the transactions on the lightning network to the current Bitcoin Script System which is intentionally not turing-complete.
Possibilities
Theoretically, another layer could be built on Lightning network (or the Bitcoin network for that matter) that established it's own form of scripting (e.g. some turing-complete scripting like Ethereum), and then generated Bitcoin-compatible transaction scripts. But, then the user would have to trust the new scripting language to generate a valid transaction that is in their favor. However, that introduces a very large attack vector and possibilities for developer errors like we've seen on Ethereum smart contracts. This does not depend on the Lightning network, though some of the concepts of LN might be useful.


If Two Cryptocurrencies use different curves, Can They be in the same HD Wallet? I was looking through some code for HD Wallets and I saw that they used curve param.N which is specific for whichever curve is used.

Does this mean that when using HD Wallets to derive Private keys, they also need to account for the curve?

I know that they need to account for the curve when going from private to public. However, let's say that we were only deriving child private keys, can this be done without knowledge of the curve?

You can only do that if you are deriving hardened keys. For non-hardenend keys, you still need to know the curve as a public key is calculated for non-hardened derivation in order to derive the next private key.

Note that hardened derivation means that you will not be able to derive public keys from a master public key.


Creating a raw bitcoin transaction and signing it with the private key using php and javascript I have a full bitcoin core node setup and would like to use it to just "broadcast" my signed transactions. But what is required to make a raw transaction using PHP and Javascript? The variables I have are just the private key, amount i want to send, and a send to address. What other missing data do I need?

Is there a good easy tutorial to follow for doing this in PHP and Javascript?

I want to make a static html/js page where I can paste my private key and other data into and it would output a "signed" transaction.

You also need to acquire the UTXO's which are spendable by your private key.

The private key in WIF private key format provides the information required to derive the pubkeyhash found in P2PKH(pubkeyhash) and P2WPKH(pubkeyhash) output scripts spendable by the private key. Deriving the pubkeyhash, or even address, can be done with BitcoinJS on the front-end.

Once you have derived the pubkeyhash or address key, you need to have an index to look-up all unspent spendable output points (utxo's) belonging to this key.

You can either build your own pubkeyhash/address index, or use an Bitcoin server implementation which does this (e.g. Libbitcoin-Server).

Your backend can lookup the pubkeyhash/address key and fetch all spendable UTXO's which are then signed on the front-end by your private key (depending on the amount and coin-selection strategy, you will select specific UTXO's to build the transaction which spends to your destination address(es)).


Do web wallets keep customer accounts isolated? Say there's an online wallet or exchange or some site, and they give me an address to send my bitcoins to.

I get the public address but not the private address because technically those bitcoins are now "theirs" - and i'll use them to exchange for other crypto currencies at some time.

But the public address is listed on sites like blockchain.info and I can see all of my transactions to that wallet.

Is it normal to see transactions going out of that wallet, even if I haven't spent those bitcoins with the service? Is my wallet isolated to transactions I might conduct?

Or do they use a normal bitcoin server, so whenever anyone withdraws, it uses whichever bitcoin transactions are available in this company's entire collection based on their bitcoin servers algorithms using all the accounts listed?

In theory, it shouldn't matter, so long as the total amount in everyone's accounts is equal to the total amount in all of the private keys they maintain. But do any of the services keep them isolated as sort of a check to make sure that a customer's coins are still there and it's not some type of ponzi scheme?

There are different kinds of web wallets. Some are more like pieces of software that you re-download every visit, but you still actually own the private keys (re-downloading is still a risk, mind you). But in this case it looks like you're talking about an exchange or other web wallet where you don't actually own the coins anymore (i.e. they have the private key). Yes, in that case it's normal that coins are not isolated anymore. And yes, that is extremely dangerous and has gone wrong many times before.

In general try to avoid web wallets and if you really need to use for example an exchange, try to move out the Bitcoins as soon as you can, to minimize your exposure to this risk. If you're actually actively trading on such an exchange, then you don't really have a choice and simply have to accept the risk of losing all your coins one day.


block verification cost When a node receives a block, is it enough to validate root of Merkel tree ?
How does block size affect the validation cost?
 What is the difference between the cost of validation 1mg-size block  and 2mg-size block? Its variations are linear or constant or quadratic?
Tnx.

It is not enough to check the merkle tree, as this says absolutely nothing about the validity of the contents of the block, just that somebody was able to follow the protocol up until that point. If a transaction say, created money out of nowhere, this would not be caught by simply looking at the existence of a transaction in a block.

To correctly validate a block a node must do the following low-cost checks:

format of the header is correct
rules about timestamps and difficulty are followed
the proof of work matches what is required

Assuming these rules pass, they must do the following high-cost checks:

the merkle tree is correct and matches the root in the header
no outputs are spent which do not exist (or have already been spent)
the values in every transaction input and output don't create money
that every script execution is successful and does not end in an error
that every ECDSA signature is valid
that misc rules such as size, format of script, and total block size are not exceeded

Most of these are CPU intensive, such as doing potentially hundreds of thousands of ECDSA, SHA256, and RIPME160 operations. Some are IO intensive, such as validating previous transaction entries if these are not already in the cache. None of these operations are exponential in cost with the number of transactions, but they need to be completed quickly to maintain consensus on the network.

Much of this work can be done ahead of time, an unconfirmed transaction can have many checks against it done, so when it arrives confirmed inside a block the validation is cached. However we can't assume this is always the case, as the Bitcoin network needs to be able to operate in adversarial conditions, such as a miner creating a block with a large number of otherwise unseen transactions.

We also need to consider that every block needs to be validated by nodes which are newly joining the network, and the cumulative cost should not be excessive to process. The historical chain at this point takes many hours or even days to validate on low-cost hardware, and we of course shouldn't be changing behavior in such a way that this cost grows more quickly.

That said, the Bitcoin network frequently has blocks above 1MB today, often exceeding 2.2MB.


Do the all coins/tokens have the corresponding network exploring sites/tools? I see that Bitcoin has Blockchain.info, Ethereum has Etherscan.io. What about other coins and tokens. Is it obligatory for the given coin/token to have such blockchain exploring site/tool, is it a best practice or a voluntary measure?

All open source cryptocurrency project should have a community which voluntarily elects to support its ecosystem. At the beginning, block explorers for said cryptocurrency project are run on a voluntary basis, but as it gains traction, there will eventually be an economic incentive to provide said service.


LND doesnt create macaroons or directories I installed lnd and got to the point of creating a wallet with "lncli create" but I get an error "unable to read macaroon path" and gives the path of where the macaroon should be. I believe when you start lnd for the first time it creates these macaroons along with some other files and folders but mine only created
tls.cert
tls.key
logs/bitcoin/mainnet/lnd.log
data/graph/mainnet/channel.db
And no macaroons. Does anyone know why it would create only some of the files and folders?? Stumped!
Running on Ubuntu 20

What version of lnd is this? I had the same problem on git master, it vanished when I changed it to 0.11.0-beta. Seems to be a new bug. I already passed it on to a dev, but you might want to open a formal issue as well.


How can I check where my bitcoins have gone to in my app? help
I need to know where to go search my bitcoins after they entered my account on my bitcoin app...so far its two day still nothing showing....

That looks like the unimaginatively named "bitcoin wallet"

I would review the transaction details provided by the sender of the Bitcoins. If you have a transaction-id or receiving-address you can look it up on a blockchain explorer to see what is happening.

A few obvious possibilities to bear in mind

insufficient mining fee
incorrect recipient address
problems with wallet configuration

not syncing with bitcoin network
private key not imported?


Can I export my funds from blockchain.info with the backup phrase? For some reason lately Blockchain.info's 2FA emails haven't come through. I tried resetting 2FA emails with my back-up keys and did it successfully but now the 2FA emails aren't coming to the new email. So something is totally off on their side. Is there a way I can export my funds (BTC/ETH) out from blockchain.info without knowing the private keys for my addresses but only the back-up phrase?

Thanks!

If you mean by "backup phrase" the Mnemonic phrase which is 12 word for blockchain so the answer is yes, you can export your funds.

Assume you want to import your mnemonic phrase to electrm

you have to choose that your mnemonic phrase is bip39 seed, not electrum seed.

Then they will ask about derivation path you leave it 44 (default) for blockchain.


Which blk*.dat file contains a particular block? Is there a way to find out which blk*.dat file contains a particular block?
For example, it would be useful to know which *.dat file contains block 478558, which is the point where BCH forked from BTC. As both share all the prior blocks, when running the forked node, it would save a lot of bandwith to just copy the block files from BTC to the BCH data directory and reindex them (with the -reindex option), rather than having to re-download them all over again.

Is there a way to find out which blk*.dat file contains a particular block?

We can't tell you which of your *.dat files contains block 478558 because there is no requirement that different nodes store their data in the same way.
Two installations of the same software (e.g. Bitcoin core) could have different blocks in a blk*.dat file of the same name. In fact this is probable.
See Is every copy of the Blockchain the same?
So the only way for you to find out is to parse the indexes or search every file until you find the block. I imagine you could probably make an estimate of which file is most likely based on current blockchain height + sought block and start your search in files near your best guess.


Minimum number of transcation in blocks one must include? Anybody as the miner can just include 1 transaction and mine 12.5 award transaction and nonce and although it may not speed up my process as (number of transaction +Award+ Nonce)=some Constant to be inside the sha256() === < target

so it does not save any calculation ??
but valid or invalid depends upon minimum one ...or not

A block is required to have one or more transactions. The first transaction must be the coinbase. (This is the transaction that claims the reward.)

Removing transactions from your block will not save you mining time. (Note that it may make your block propagate faster, and it may be impossible to tell if a transaction is valid when SPV mining.)


Is it likely that side-chain support will be added to Bitcoin? Is it likely that side-chain support will be added to Bitcoin? As I understand it, side-chain support will require a hard fork to Bitcoin to support this functionality:

"moving" BTC to external blockchain-based currencies,
for each of these currencies, keeping a counter of how much BTC has been moved to that currency, and
allowing BTC to be moved back into the Bitcoin blockchain (which decrements the counter).

Part #1 is (and has been) supported without a hard fork, using addresses like 1BitcoinEaterAddressDontSendf59kuE , but part #3 is critical for side-chain support and requires a hard fork.

I understand that it will be extremely difficult to have a hard fork on such a large cryptocurrency. What is the likelihood that it can be done?

Yes, it is very likely that Bitcoin will support side chains within the next few years.  (By my guess, not 2015 but maybe 2016.)  Side chain support does not require a hard fork---it only requires a soft fork.  As the sidechains paper explains (page 10, final paragraph):

  To use Bitcoin as the parent chain, an extension to script which can recognise and validate such
  SPV proofs would be required. At the very least, such proofs would need to be made compact
  enough to fit in a Bitcoin transaction. However, this is just a soft-forking change, without effect on
  transactions which do not use the new features.

Note that Bitcoin doesn't need a special counter to keep track of value sent to child chains---it already keeps track of every spendable balance.  Sending bitcoins to a side chain will be essentially the same as sending money to any other bitcoin address---except that you'll need a special tool to create the transaction for you.  Receiving bitcoins back from the side chain will also require the special tool, but that tool will just create a transaction that spends one or more of the transactions previously sent to the side chain.  (Note that the tool will need to operate on both the side chain and the Bitcoin block chain to maintain consistency.)

As an aside, hard forks are only as difficult as it is to convince people to upgrade.  The most recent hard fork, the August 2013 fork mentioned in BIP50, was relatively easy because it was a fix for an acknowledged major bug.  On the other hand, Gavin Andresen will likely soon be proposing a hard fork to increase block size that may be quite difficulty because it's a major change to how Bitcoin has worked since 2010.

Pegged side chains falls somewhere in between those two extremes (and it is only a soft fork), so I guess it will "only" take about 3 months of discussion and testing once a patch/BIP is proposed and about 6 months to fully rollout the soft fork, similar to the rollout of BIP34.


Allowing Incoming Connection on Bitcoin Core Good Evening,

I recently installed Bitcoin Core v0.12.1 on my home server (running Windows 7) and wanted to allow it to accept incoming connections and used the guide found here: https://bitcoin.org/en/full-node#windows-7 to ensure I did everything that was needed.  Unfortunately, it hasn't been showing any incoming connection and when I used the connection tool recommended in the guide (https://bitnodes.21.co/#join-the-network), it says my server is unreachable.

I have already setup port forwarding for port 8333 to both my server's IP address, 192.168.1.105 (wireless) & 192.168.1.129 (ethernet).  I ran a port scan on the following websites and they all indicate that Port 8333 is open:

Ping.eu Port Check
WhatMyIP Port Scanner
T1 Shopper Port Scanner

(I would provide links for the above scanners, but I cannot post more than 2 links)

I also created two rules in Windows Firewall (under Inbound Rules) with the following properties:

Local Port - 8333
Remote Port - All Ports
Scope - Local & Remote IP address set to Any IP Address
Domain, Public, and Private all checked
All programs that meet the specified conditions checked
Set to allow the connection
Rule is enabled

There are two rules with the above settings, one for TCP and one for UPD.  Even with all the above setup, the "Join the Network" tool on Bitnodes website (second link from the top) still says my node is unreachable and the debug window inside the program shows 0 incoming connections and 8 outgoing connections.

I'm not sure what else needs to be setup since I completed everything in the guide and port 8333 is definitely open.  Any help or information with this issue would be greatly appreciated.  Thank you in advance.

Dominick

I had the same problem. The port was open, but the test at bitnodes.21.co would fail. However after my Bitcoin client downloaded the entire BlockChain everything worked. I used about 144 hours to download the entire chain with a 150Mbps fiber line.

Before the entire chain was downloaded the test at https://bitnodes.21.co/#join-the-network would give an "Unreachable" error. After it downloaded it changed to Green saying it's reachable.

So you just have to be patient :)


Custom filter for mtgox depth api request I am looking at mtgox api documentation and specifically at Multi Currency depth http://data.mtgox.com/api/1/BTCUSD/depth/fetch

It returns back the list of asks and bids and a filter criteria like this:

filter_min_price: {
    value: "42.25504",
    value_int: "4225504",
    display: "$42.26",
    display_short: "$42.26",
    currency: "USD"
},
filter_max_price: {
    value: "51.64504",
    value_int: "5164504",
    display: "$51.65",
    display_short: "$51.65",
    currency: "USD"
}

Is it possible to apply the custom filter and get the filtered response from the server? Say if I wanted a smaller min/max price range. Can this be done in the API request?

I understand I can filter the response on the client after I get all the data, but was looking for a way to do it via api

On the v2 api, It's not possible, I guess, but they say here that it is, but that arguments to do so are not known. if you try any arguments the response is:

"error":"Invalid call method, please ensure query string is empty (min,max)"

that's why I think you can't, I guess it's the same for v1. Maybe you should think to do what you wanted to do another way, maybe updating your data with trades/fetch?since=1364767190000000


Bitcoins stolen during transaction guys!
Recently, I transfered bitcoins from paxful wallet to bitcasino. Usually, it worked. Now, I cannot reach them, it looked to me like they were stuck on the way and I wanted to ask either side what happened. However, I realized an unusual activity, having traced the transaction by its ID. Usually, I wait for confirmation and it's done. It gets green and all is good. Now, the bitcoins are nowhere, but something is different at the same time. I noticed a minus next to my bitcoin amount, covered in red, as recorded within blockchain website. I suspect a steal, since everything matches. Did someone have a similar experience and can someone find a solution? Thankful in advance!

If you do not run a node, you should use blockstream.info to look at your transaction. Type in the TXID, and see if the transaction funds were used again or are sitting in a specific address. Sometimes, transactions simply take a long time to clear, but that doesn't mean you have lost your funds. They will eventually clear.
Alternatively, bitcasino could have either screwed up or been hacked.


Is it a way to restore private key from 12-phrase? I can not restore my wallet from Copay even though I have the 12-word. Is it a way to convert back 'manually' with an other external solution and get the private key? Is the 12-word key storage a universal thing, or only Copay, Bitpay uses it?

You can restore your wallet using another external solution called Exodus.

You can find a step by step process here: How do I restore from my 12 Word Phrase?

I hope it helps you.

There are some other ways as well, I will keep this answer updated.


Key exported from BitcoinJ is different from the key shown by bitcoind I am quite new to Bitcoin. I am trying to use Bitcoinj with regtest mode.
I have created the following application:

public class TestBitcoinj {
    private final static BigInteger ONE = new BigInteger("12345");
    private final static BigInteger TWO = new BigInteger("67890");

    public static void main(String ... args) throws Exception {
        final ECKey from = new ECKey(ONE);
        final ECKey to = new ECKey(TWO);
        System.out.format("from: %s, to: %s\n", from.toAddress(RegTestParams.get()), to.toAddress(RegTestParams.get()));

        final WalletAppKit kit = new WalletAppKit(RegTestParams.get(), new File("/tmp/bitcoinj"), "mirko_btc") {
            protected void onSetupCompleted() {
                System.out.println("Key chain size: " + wallet().getKeychainSize());
                if (wallet().getKeys().isEmpty()) {
                    wallet().addKey(from);
                }
            }
        };

        kit.setAutoSave(true);
        kit.connectToLocalHost();
        System.out.println("State: " + kit.startAndWait());

        System.out.println("Address: " + kit.wallet().getKeys().get(0).toAddress(RegTestParams.get()));
        System.out.println("Private key: " + kit.wallet().getKeys().get(0).getPrivateKeyEncoded(RegTestParams.get()));
        System.out.println("Balance: " + kit.wallet().getWatchedBalance());
        System.out.println("Done");
        System.out.println("State: " + kit.stopAndWait());

    }
}

I have started bitcoind with the following:

bitcoind -regtest

I have generated some blocks just to have some money:

bitcoin-cli -regtest setgenerate true 101

Then I have run my program just to have the private key, which is:

Chiave privata: cNQM8FUZ9tJeNKNNJPiwHZpWkREqzzk5JhioYJWZaszHa5vgsLct

Now I import that private key in bitcoind using the following:

bitcoin-cli -regtest importprivkey cNQM8FUZ9tJeNKNNJPiwHZpWkREqzzk5JhioYJWZaszHa5vgsLct mirko4

Finally, I have noticed that my program dumps the following:

Indirizzo: mrtwCcpmvRYU5wBDaUP8LiaW85nGEkbauM

whereas if I run the following:

bitcoin-cli -regtest getaccountaddress mirko4

I get the following address:

mrXizN9m9cyKgvBKqCVzTvMAWJoVgnBBev

That address is far different from the one I have dumped using Bitcoinj. However, the private key should be the same.

Probably I am missing something, but I can not figure out what.

Thank you very much for your support.

Sorry I have found the solution. The dumped privkey is not comparable to the address. If I want to use the dumped format, I have to use the class DumpedPrivateKey.

Thanks for the help!

After  Aussie Cryptocurrency's request, I am pointing out the problem in the code.
What I was doing was trying to import the private key of the 'from' keypair using bitcoin-cli. However, it is important to know that such operations must be run using DumpedPrivateKey: this class can manage private keys in the format that bitcoin-cli likes, whereas in my previous tests I was trying to import the private key simply Base-58 encoding the private key. The odd thing is that if you do so, the key seems to be imported, but the private key is completely different to the expected one.

Hope this helps.


If bitcoincore.org goes down how can I access it? What can I do to help others access it? bitcoincore.org is a trusted resource for information on new Bitcoin Core releases and soft fork upgrades. How do I access it if it is taken offline? How can I help others access it if it is taken offline?

Wladimir van der Laan answered this on Mastodon.

if you want to help, make mirrors (can we do something like "deterministic verifiable builds for websites"?), host the files, seed the torrents

Is there a more robust way to create a mirror exist now, other than wget -mkxKE -e robots=off https://bitcoincore.org?

Yes wget seems suboptimal. The robust way is to clone the website off github (git@github.com:bitcoin-core/bitcoincore.org.git), so that you have a copy of the source code as well, then you can build it yourself. That gets all releases and verifies them against their gitian.sigs hashes

However that's for the website—it won't give you a copy of the historical release binaries, i'm not sure of a good way to mirror those, maybe best would be to make a script based on https://github.com/bitcoin/bitcoin/blob/master/test/get_previous_releases.py and https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/master/gitian-verify.py

This one might actually be best, it downloads SHA256SUMS.asc for an arbitrary release, verifies the signature, and downloads all the files mentioned in it: https://github.com/bitcoin/bitcoin/tree/master/contrib/verifybinaries


searchrawtransactions in bitcoin-cli returning "Method not found" error some days ago I installed bitcoin core patched with the addrindex option ( btcdrak version ), after indexing the entire blockchain for 5 days, I tried to use the searchrawtransactions parameter on bitcoin-cli in order to query some addresses, but it is returning the following error:

error code: -32601
error message:
Method not found

In github I saw the following statement:

  First run will require a full reindex of the blockchain. After that, the searchrawtransactions will be available.

But it's not working for me. Anyone has experience with this or with any other bitcoin core patched version?

There is no cli API as searchrawtransaction in the core bitcoin client. I guess what you are talking about is getrawtransaction. This would be place where you would find all the API's aggregated in one page and you can search for the API you are concerned with.


Needing Instant (1-2 minutes) API / IPN for bitcoin payments Basically I'm creating a autobuy in PHP.
I'm currently using coinpayments.net but their payments take 1-12 hours to send (which defeats the object of my autobuy). I'm needing to know of any way I can allow my payments to be done after 1-2 minutes so I can send the buyer their email with their order automatically.

I wrote to coinpayments.net and am waiting for a reply.
This should help you understand what I'm needing:

  I'm creating a autobuy shop and am using your API / IPN to get callbacks from the users payments to determine the status (successful, or unsuccessful) payment. The problem is that when a user pays the bitcoins to the address on the autobuy, (in coinpayments), it takes about 6-12 hours for the payment to clear. This defeats the whole object of my website (an autobuy). Is there any way I can make payments be completed after 1-2 minutes if a user actually does pay correctly ?

I'm guessing that your payment processor (coinpayments.net) is trying to construct bitcoin transactions with with lower fees, and therefore de-prioritizing confirmation times.  Perhaps their API offers the ability for you to prioritize your transactions by paying extra on the fee.  I know blockchain.info allows you to specify a fee if you are using their wallet API.  I'm sure others do as well.

Alternatively, you could run your own wallet/node and construct your transactions yourself with a higher fee.  It's a lot more effort, but depending on what you are trying to accomplish, it might be worth your time.

In any case, keep in mind that the bitcoin network averages a 10-minute block time, but does not guarantee it.  On top of that, the best rule of thumb is to allow for 6 blocks blocks of confirmation before considering a transaction irreversible.  For most payment systems, the values being transferred are so low that it's not necessary to wait for 6 blocks.  There are even plenty of types of purchases where so-called "zero-confirmation transactions" are perfectly acceptable.  This is what you will need to use if you want to send your email in less than 10 minutes.  You will have to judge for yourself how many confirmations you need, and what level of risk you are willing to accept.


Is it possible to create a transaction in pure python without needing to run bitcoin locally? Lets say I have a bitcoin address that has 10 BTC sent to it. I also have the private key for this address

Using Python (2 or 3) is there a way to create a signed transaction (which I believe is a long string of hex digits) that can then be sent to an external service (bockchain.info or whatever) for network propogation.

It seems all the python libraries for making transactions require a connection to the bitcoind rpc interface. In my application, there will be no locally ran bitcoind.

I'm thinking the code I'm looking for is like this:

address = '1ALis8zeW1XduXf98ZjoL4EKLen5mVA1q4'
private = '5KiUZd5as1TKsiwnt1KiPgiECtXiuF9BS1MxrAgedNrXcScm4d5'

from some_btc_library import make_transaction

tx_hex = make_transaction(
    inputs=[[address, private]],
    to='123rn4tNGhf1ZehQHLohYn8WRQYhjeGSCw',
    amount=3,
    miner_fee=0.0001
)

send_to_exteral_service(tx_hex)
print "transaction complete"

In case you have not seen it, there is a good (IMHO) article which describes how to generate a transaction "manually" using "raw" python (no bitcoin libs or RPC):
"Bitcoins the hard way: Using the raw Bitcoin protocol"


Bitcoin "Quits unexpectedly" everytime but only on my account Everytime i try to open Bitcoin QT it quits unexpectedly, however if i log out and log in using another account on the same Mac, it works fine.  Can i use the other account (where my Bitcoin QT opens fine) to transfer bitcoins to from MtGox as it is still the same computer or do have to fix this issue of it quitting all the time?

I expect this has something to do with the file permissions. Your own user does not appear to have read/write access to the wallet or blockchain directory. Simply copy them to a location that is accessible by both of you, or change the permissions to allows your own user access.


Electrum Wallet How to use "Child Pays for Parent" my transaction is here: https://blockchain.info/tr/tx/cb371b331e99eccb2d7447f4fe02417812ad066de21843fa156d4890e2cdf329
The reciever is a exchange wallet I don't know the reciever's private key.
it got stuck for hours and I need them immediately. I used electrum wallet for the first time and I have forgetten tick "replaceable". So now I can't change fee.
Once, I used "child pays for parent" property but now I couldn't see on electrum wallet. How can I unstuck it? or How can I use " Child Pays for Parent" feature ? I really searched for hours but I couldn't use it.

note: and I open for other answers.. for example how to stop braoadcasting transaction? is it possible?
This is the weakest side of bitcoin, I think :(

You can't use CPFP to confirm that transaction. It's impossible for one to rescue a low fee transaction using CPFP, unless he/she has a private key of at least one ddress of that transaction's outputs (in your case, it's impossible, because you don't).

That transaction's receiver can do CPFP, if he/she wants.

Hint: Use RBF (https://freedomnode.com/blog/75/how-to-fix-slow-bitcoin-transactions-with-replace-by-fee) or pay $4 on confirmtx.com


Does Bitcoin have a physical equivalent like US dollars do? I can send US dollars electronically and they get recorded electronically at my bank. However I can also get a piece of paper to represent different amounts.  For example, my bank will give me a 'hundred dollar bill' to represent 100 US dollars.  This is the largest amount of US dollars that one US bill can represent.  Billionaires would need a lot of them to carry around their US dollars.  However, at least it is possible in theory.  Does Bitcoin also support using physical paper 'bills' or is it strictly electronic?

Bitcoin is only stored on the blockchain. Unlike a fiat currency, where the banknote holds inherent value (i.e., the banknote holds its own value - it does not rely on another system to say it has that value, and a $1 banknote will always maintain its value of $1).

Bitcoin is always on the blockchain. A wallet, or paper wallet, only holds the private keys that can spend certain outputs on the bitcoin blockchain. As long as the outputs corresponding to those keys are unspent, a wallet will hold value.

However, once those outputs are spent, a wallet would have no value (unless more transactions created new outputs controlled by that wallet).

Paper wallets allow you to put a private key on a piece of paper. However, if the money controlled by it is spent, the value written on the paper will not be true.

Additionally, Tangem sells banknotes that contain some BTC that cannot be easily spent, making it function more like an actual banknote.


Bitcoin script verification fails after certain time period So I want to write a bitcoin script so that after a certain time period (say for example after 30 mins), the verification fails and transaction is marked invalid even if it gets broadcasted. Time locks are used so that a transaction is considered valid after a certain time period. I want the opposite to happen. So can I just enter some bogus lines of code after  OP_CHECKLOCKTIMEVERIFY so that script check intentionally fails? Or is there any opcode by which I can achieve the same functionality?

This isn't possible with a single bitcoin sript, but your example can be realized quite easily by simply adding one more transaction to the equation:

So the premise is that given an input, it can be spent by either party A or party B. The restriction is that party B must spend it within the 1st 30 mins else after that A must spend it.

Party A and party B cooperate to create a 1-of-2 multisig address, and then have coins sent to it
After 30 minutes, party A will create a second transaction which pays the coins to an address that only party A controls
Now party A can spend the coins, party B cannot

This depends on party A publishing the second transaction, but that step could also be automated and happen during the initial setup of the multisig address. The second transaction could even have a timelock added, such that it could not be published early (though party A can otherwise spend the coins at any time, so this seems unnecessary).
Otherwise, as mentioned in the comments, this sort of construction isn't possible using bitcoin script alone.


What happens under the hood when I use BTC to buy an Altcoin on an exchange? What happens under the hood when I use BTC to buy an Altcoin on an exchange?

I recently used Binance to buy an Altcoin using BTC. After making the trade I was expecting to obtain a transaction identifier which I could use to look up the history using blockchain.info.

Nothing will happen "under the hood" in the blockchain of a cryptocurrency when you trade on an exchange. The exchange has many wallets where the funds of the user are stored. The exchange has also a database where they store the information about the assets of the user, their trades and their resulting balance. Example:

A person A deposits 1 btc to exchange XY. Person B deposits 10 eth to exchange XY (these are transactions which you can see in the public blockchain of the respective blockchain).

Now the exchange has 1 btc and 10 eth and in their database they write analogous: "A has 1 btc; B has 10 eth".

Now person A wants to exchange his 1 btc into eth. So he buys 10 eth from person B and pays with 1 btc. This trade will not cause any transaction which will be added to the blockchain, because it is an exchange-specific process. When the trade is executed, exchange XY write in his database something like "A has 10 eth; B has 1 btc". (When person A, for example, now wants to withdraw his 10 eth to his ethereum-cold-wallet this would cause a transaction in the ethereum-blockchain.)


Difference between a bitcoin wallet and the blockchain As the title said, what is the difference between the bitcoin wallet and the bitcoin core, do i have to install both of them to work? Can I just have a bitcoin wallet?

As stated in comments, the blockchain is a public record of all bitcoin transactions. If a wallet is like a bank account, the blockchain is the currency system.

For a new or casual user, it might be easiest to use a remote web-based wallet, rather then one on your own device. In that case, you don't really need to worry about interacting with the blockchain. For more information on remote wallets you can use, go here https://bitcoin.org/en/choose-your-wallet Click the "web" icon and you will see seven options to consider.


How would an atomic exchange of assets be implemented in a blockchain? There are non-Bitcoin blockchains being created at the moment that are used to trade and transfer assets. It is my understanding that on such a block chain there are "tokens" representing assets such as a share in a company or some other security.

Assuming A wants to exchange with B some assets, how would they create a transaction so that the exchange happens atomically?

A non-atomic solution would be to have A transfer the assets he is selling to B first. Then, B transfers the assets he is paying with back.

Multisig transactions do not seem to solve this problem: One of the signers has to sign first (A). He cannot force B to then sign as well. B might abort the transaction or delay it. This is a trust issue and not atomic.

For a concrete example, A might want to trade a certain Namecoin domain name against another name that is owned by B. This is supposed to be trustless and atomic.

The basic idea is that one party makes a payment in such a way that the funds go back to them unless the other party makes the other payment, in which case the other party gets those funds. The other party can then make the payment and claim the output of the first payment.

Here's one possible more detailed sketch:

A and B each generate a private key, determine the corresponding public key, and exchange them.
A and B each sum the public keys and hash them to form a joint address for the transaction.
A and B form two transactions. One sends the funds back to A but has a lock time in the future. The other sends the funds to B if B provides proof of payment of B's funds to A.
They each sign both transactions and the signatures are summed so that both transactions are ready to submit. No additional transactions for the joint address can be signed unless A and B agree.
A sends her funds to the joint address formed in step 2. A knows that she can get her funds back when the lock time expires and that B can only get the funds if she provides proof of payment to A.
B sends the funds to A and submits the proof of payment along with the signed transaction to get A's funds. At this point, the payment is complete.
If B fails to perform step 6, when the lock time expires, A submits the signed return transaction to get her funds back.


How to verify the compressed signature in Bitcoin? It is 138 long in hex I am using the bicoinjs-message npm module for signature verification.
I learned that there are few signatures which are of length 138 in hexadecimal.
When I tried to verify such a signature it is throwing an error:

Error: Invalid signature length

How to verify the compressed signature?
I think there is a lib in ruby, bitcoin-ruby 0.0.20, which verifies it, but I don't know ruby.

If you have the bitcoin core software, you should be able to use the CLI to verify signatures using the verifymessage command. Some wallet software also has this functionality.


Is there a rpc/cli method for payment protocol in bitcoin-core? I have a full node running bitcoin-core 0.16 bitcoind (not bitcoin-qt). Today I tried and failed to pay a bitpay "secure" payment protocol uri invoice via the cli. The uri was in the form bitcoin:?r=https://bitpay.com/i/... with no visible bitcoin address or amount. (Guess people can't be trusted to copy-paste the address correctly?). Not surprisingly, the usual sendtoaddress method called the uri invalid.

I curled the address hoping to get the real payment details so I could enter them manually, but I just got a 301 redirect to a page on bitpay.com saying the invoice has not been paid. Guess they filter on uagent or some other header.

I also googled it but only found explanations of what the payment protocol is, why bitpay is using it, and how to do it with popular UI wallets. Nothing about cli.

Does anyone know if/how this is possible with cli/rpc only? Or perhaps the magic header bitpay looks for to distinguish a wallet app from a browser so I can get the real address? If not, I plan to open a ticket with bitcoin core devs on adding it.

Update:

bitpay link as requested: bitcoin:?r=https://bitpay.com/i/97ghKmFG8HVJNEbxkVefV though it has now been payed (via bitcoin-qt ui) so its usefulness may now be limited.

The payment protocol is only usable from the GUI (i.e. bitcoin-qt). It is supposed to be an interactive protocol so you cannot use it from the command line which is non-interactive (in the sense that you issue commands and get a response back instead of issue command and interact within the context of that command).


Do HTLCs get "carried over" in the subsequent commitment transactions? With regular commitment transactions, current transaction invalidates the previous one. This is fine, since TXs between A and B in their channel happen one after another. However, HTLCs are sort of delayed transactions. How then further transactions can happen without waiting for the secret R? Does it mean that the HTLC contracts get simply "carried over" in the subsequent transactions between A and B?

How then further transactions can happen without waiting for the secret R? Does it mean that the HTLC contracts get simply "carried over" in the subsequent transactions between A and B?

Yes, that is correct. You go on adding HLTC outputs in the commitment transactions as more and more HTLCs are added, and delete those HTLCs that are either fullfiled with a successful pre-image or those that are failed. Every time, you add/delete an HTLC, a new commitment transaction has to be signed and the previous commitment transactions have to be revoked.

For that reason, lightning network specification puts a limit of 483 HTLCs for a commitment transaction, so that even if both sides send the maximum number of HTLCs, the commitment_signed message will still be under the maximum message size.


Is there an open source tool to publicly destroy bitcoins? Several interesting applications of bitcoins involve a scenario where they are intentionally "destroyed".  Is there an open source tool that can be used to destroy bitcoins?

And if so, is it possible to programmatically verify (via the same tool or another) that the bitcoins have indeed been destroyed?

The most secure way to destroy bitcoins is to send them to a script that can never return true, and which includes the reference code that confirms the goal of destroying these coins. I don't know of readily available software tools that can do that, and I'm not sure the network will accept these transactions.

Here's a simple method everyone can try at home: Take the reference code, apply RIPEMD-160 and encode it as an address. Do a transaction which sends a satoshi to this address, and the the coins-to-destroy to 1BitcoinEaterAddressDontSendf59kuE.

To demonstrate my point, here is me destroying 1 mBTC - http://blockchain.info/tx/f374fb91ea29b02d295d535da537c7770caa71c4937095c51467b4d8b1b60c1b. Address is hash of https://bitcoin.stackexchange.com/a/7443/575.

Signing a message with the address used to send can also be employed as extra verification.


Is there a way to inherit bitcoin? I know this is a long shot: Is there anything I can do to recoup the bitcoins my father owned when he died? Is my only chance trying to find his password?

What are the possible ways may father may have managed his bitcoins, and how can I find this out? How could I find out if he was using a third party to keep his bitcoins? I have no idea what I am looking for...

Does this happen often, or are the majority of people who own bitcoins young enough that this is rare?

What are the possible ways may father may have managed his bitcoin, and how can I find this out? How could I find out if he was using a third party to keep his bitcoin? I have no idea what I am looking for...

The first thing you have to come to terms with is that there is no guarantee of success. If your father did all of his Bitcoin transactions on a LiveUSB drive, then buried the USB drive inside of a tupperware in his backyard, there is no way that you would know, unless you found it.

That said, there are some general ways to focus your search.

Examine bank statements: Look for cash withdrawals/deposits. Look for transfers to Bitcoin companies or unexplained transactions. Combine this with other methods, like web history. If he withdrew money on the same day that he visited Coinbase, that suggests that Coinbase might have some of your father's assets.
Ask third parties like Bitcoin exchanges to give you any assets belonging to your father: Make sure to attach documentation showing that those Bitcoins are legally yours. An estate lawyer can help you with this.
Look for known wallet programs: Bitcoin Core, Electrum, and Bitcoin Armory are all programs that might be installed on your father's computer. Also look at this list, and this less popular list.
Examine downloaded programs, installed programs, and web history: Continue your search for wallet programs by looking in the Downloads folder for any installation programs. Look in the Start menu. Look in Add and Remove Programs.
Don't forget smartphones: You can run wallets on phones too. Look for the apps on this list. (Click "Mobile" after you visit that link.)
Don't forget paper records: These can have Bitcoin wallets too. Look for a long alphanumeric string beginning with 1, 5, or L (capital "L").

Example: L1aW4aubDFB7yfras2S1mN3bqg9nwySY8nkoLmJebSLD5BWv3ENZ
Talk to people who your father might have talked to about Bitcoin, or how he kept his Bitcoin: This might include the primary beneficiary of the will, or someone who introduced him to Bitcoin.
Consider getting a forensic examination of your father's computers: Ask them how much experience they have assisting with Bitcoin related investigations and lawsuits. This can find programs that were installed, then deleted, or files that used to be present on the computer.


Why doesn't changing MAX_MONEY change the maximum number of coins? I've changed MAX_MONEY to decrease the number of coins issued in my altcoin, but it's not working.

Why?

Despite the name, the MAX_MONEY constant is not used in determining the total maximum number of coins.  Rather, it is used only for a sanity check: any transaction output larger than MAX_MONEY is automatically rejected as invalid.  They simply set this new constant equal to the eventual maximum number of Bitcoins, since that is a value that certainly should never be exceeded by any output.  This was part of the fix to an early bug where only the sum of all outputs for a transaction was checked, leading to the possibility that the addition might overflow.

The block subsidy (aka reward) is computed in the
GetBlockSubsidy function in validation.cpp.

CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return 0;

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Here you can see the initial block reward of 50 coins is hard coded.  The halving interval consensusParams.nSubsidyHalvingInterval is set in chainparams.cpp in the constructors for CMainParams, CTestNetParams and CRegTestParams respectively (the respective default values are 210000, 210000, 150).  Note that MAX_MONEY does not appear.

So in order to change your coin's total money supply, you'll need to do a little math to decide what the initial block reward and halving interval should be, and modify them accordingly.  If you want the reward adjusted by any other mechanism than "continue halving until the reward reaches zero", then you'll have to rewrite the
GetBlockSubsidy function.  (And you should also change MAX_MONEY to an appropriate value that should never be exceeded by any transaction output.)


How did Coinbase monitor BTC transactions? I've been seeing a lot of articles like this one claiming that Coinbase has been suspending users that transmit and receive BTCs from sites that provide objectionable goods and services (e.g. drug sales, gambling, etc.).

I'm not interested in the why of their actions but the how.

My knowledge of BTC and Coinbase is extremely limited but I was under the impression that each transaction has a unique target address (or at least it's an advisable security practice). So if a person were to send 10 BTC to "objectionable site A" at newly created address AAA, and then later "objectionable site A" sends 12 BTC to me at newly created address BBB, how would Coinbase even know that address AAA were owned by "objectionable site A"? Isn't it anonymous?

I sort of understand the concept of the blockchain and how everyone can see every transaction that's taken place, but from Coinbase's perspective, it seems like all they'd be able to determine is that someone sent some BTC to address AAA. How would they even know what business AAA is associated with?

I'm confused. Please explain. Thanks!

Your understanding of Bitcoin is correct.  What you may not know is that the "advisable security practice" of using a unique address for each transaction is not followed by many block chain gambling sites, such as SatoshiDice.  Because these sites reuse addresses, transactions sent to those addresses can be flagged or blocked.

Even if this were not the case, block chain gambling may be easy to detect by analyzing transactions.  For example, I believe SatoshiDice always sends back a tiny transaction for each bet it receives, which is an obvious marker.  There may be more subtle indicators too, like the ratio of spends to receives being near the ratio of the amount spent and received.  Also, Coinbase could have access to non-block-chain info like people's Coinbase addressbooks where they write "dice, 1:100 odds" or "weed dealer".


How much Bitcoin was lost in the Jul. 2011 MyBitcoin site shutdown incident? https://en.bitcoin.it/wiki/MyBitcoin

How much money was lost when it shut down? (You can also edit the wiki page and add this info). Best estimates of course.

According to this speculative thread at bitcointalk.org forums, a minimum of 27,000 BTC (worth $370,000 USD at that time), with a possible maximum of 75,000 BTC, estimated.

Here's a screen cap of the first post in the thread, in case the forum later disappears:


How can the blockchain survive without an army or other kind of law enforcement? I'm sold on most of the Bitcoin aspects. I believe that the blockchain has incredible potential value and how the fact that it's decentralized removes a lot of the corruption and cronyism that are rampant in today's centralized institutions.
However one thing I don't get is how does the contract, or property or other value that you have stored in the blockchain is enforced? Surely some people won't care that the proof of property of your land is in the blockchain and just claim it with guns. What do you do then? How is this sorted? States have judicial and military power. What does the blockchain have?

The blockchain itself does not have any power. It is just public set of records, like a phonebook.

Depending on the contract between trading parties, you arbitrage the contract disputes within the legal means you have available.

However, blockchain can act as a proof of agreement and everything signed there is very hard to forge: the other party cannot claim they did not sign the agreement if the private key used in signing can be proven to belong to the party.


What is the "wallet export format"? The "wallet export format" is mentioned at the Wiki page for Mini private key format, but it doesn't seem to be explained on the Wiki. How does one convert the export format to and from corresponding keys?

As it was explained on the forum, it is a base58 encoded private key with added 0x80 byte at the front and 4 checksum bytes at the end.

More detailed explanation is not available on the wiki, as well as in a new testing suite.


What is a bitcoin wallet? I do not understand how addresses and wallets are related. I see that you are advised to generate an address for every transaction and, furthermore, use (multi-in multi-out) tumblers to maintain anonimity. This will create a hell amount of (unspent) keys+addresses. How do you manage them all and handle complexity? How do you remember that this was a simple transaction from that wallet to mine and the rest is just intermediate activity. Is a wallet just a collection of (unspent) addresses so that you can simply merge different (wallets of) bitcoins by just gathering these keys/addresses? I understand that to have a coin means that you know which address has some unspent bitcoins and you have a key to demonstrate that it is your coin/address in the next transaction. But what if you share same coin addresses between wallets and one wallet will think that there are still money while you spent them (peahaps partially)? What about compatibility of various wallets, is there a strandard/converter? Am I right that the thing that you must keep in mind is the list of addresses plus corresponding keys and the wallet is such a record?

You are asking a lot of questions in one post but to answer the question in your title concisely:

A Bitcoin wallet is loosely the equivalent of a physical wallet on the
Bitcoin network. The wallet actually contains your private key(s)
which allow you to spend the bitcoins allocated to it in the block
chain. Each Bitcoin wallet can show you the total balance of all
bitcoins it controls and lets you pay a specific amount to a specific
person, just like a real wallet. This is different to credit cards
where you are charged by the merchant.

From Bitcoin.org.
A wallet contains any number of public/private keys.  You can easily create new wallets or new public/private keys in your existing wallet.
I'd recommend breaking down anything still unanswered into their own specific question.


Using Docker version of Lightning Network daemon to gain understanding In trying to understand the Lightning Network further. To do so, I was looking at the link below (it shows how it is being used with Docker):
https://hub.docker.com/r/cdecker/lightning-ci/

Based on the information in the link, I had questions.

STEP 1: # Returns an address  cli/lightning-cli newaddr
^^^^ Ques: Is this a new address created on LIGHTNING NETWORK? Is it on the BITCOIN NETWORK? Is it in "No-Mans-Land/Purgatory"? Where
is the Private-Key? Can many addresses be created?
STEP 2: # Returns a transaction id  bitcoin-cli -testnet sendtoaddress
^^^^ Ques: So, if you forget / lose this address (after sending money to it), you are out-of-luck? Also, "bitcoin-cli" commands are
executed under the "btcd" BITCOIN dameon?
STEP 3: # Retrieves the raw transaction  bitcoin-cli -testnet getrawtransaction
STEP 4: # Notifies lightningd that there are now funds available: cli/lightning-cli addfunds
^^^^ Ques: It is at this point the funds are actually added to the LIGHTNING NETWORK. I take it that the funds are associated with
the  created in STEP 1 above?

TIA

The documentation you are following is using the bitcoind wallet, so the address generated in Step1 will be derived from your bitcoind master private key.

Checking the current c-lightning documentation, this seems outdated, step 3 and 4 are no longer needed.

Q1: this returns an address from the bitcoind wallet
Q2: you send a bitcoin transaction from any wallet you like, here the local bitcoind (Bitcoin Core) node is used.
Q4: here, you notify lightningd to use the funds when opening channels. But no channel is opened and thus no funds are committed to the Lightning Network yet. (as mentioned, seems obsolete now with current release)


Is it possible to monitor all crypto-coins? Different coins have their own blocks and wallets, I want to build application to support multiple coins and my questions is Monitoring all coins possible(view transactions, get balance etc)?

You would need to install all of the coin daemons and scrape them for transactions using something like Abe, or your own custom solution using RPC commands.

If you are able to find an API which provides this information (I have yet to find one with a good amount of coins and reliable), then you could simply make calls to that; the only problem with using an API is that you are dependent on them and if they go offline, so do you.

My recommendation, get a VPS and start installing some coins :)


How peer discovery works after connecting to hardcoded nodes? I am tinkering with the bitcoin source code and trying to understand the exact working of peer discovery mechanism in the testnet mode for which I have made the following changes:

Disabled the DNS seed discovery in order to force bitcoind to fallback to connect to hardcoded nodes.
Changed the default hardcoded nodes to my known 4 addresses, lets say A,B,C and D, which I ensure are always online.

Now, when I run the bitcoind client (call it E), it connects to one of A,B,C or D, running the same modified version of bitcoind. It gets the peer addresses from  the hardcoded node that it first connects to by exchanging getaddr and addr messages but I am not sure how it proceeds after that. I have following queries:

a. If a node falls back to connect to hardcoded nodes, is it supposed to connect to only one of the hardcoded nodes like it happends in my case or can it connect to multiple hardcoded nodes ?

b. After getting peer address via the addr message, when will the node E start connecting to those peers ?

Please point me to the relevant code files/sections if possible. Thanks

Did you add the hardcoded nodes with addnode or with connect?

addnode=<ip>          Add a node to connect to and attempt to keep the connection open
connect=<ip>          Connect only to the specified node(s)

So, if you used connect, it will not connect to any but the hardcoded nodes.


ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8) For study and fun I try to create my own altcoin.
I forked Litecoin, removed checkpoints, changed nTime, *pszTimestamp, noNce and hashed new hashes for genesis block in main net, testnet and regressiontest net.
The hardcoded assertions goes OK but when I start the deamon

./src/cryptoind

I get alwais the same result:

ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8) ... ActivateBestChainStep --> Failed!

Going deeper in the code the following statement always fails (main.cpp):

if (UintToArith256(hash) > bnTarget)

Seems like the genesis block does not respect the difficulty (PoW)

Someone faced the same issue? Thank you all

It seems the -reindex parameter solves the issue.

https://github.com/bitcoin/bitcoin/issues/8081


Running both bitcoind and bitcoin-qt for use with lightning I've been toying around with bitcoin & lightning nodes.
I like having the Bitcoin Core Qt GUI around for things, but also like being able to change specific configuration / startup flags (maybe eventually contributing) with the source + bitcoind.
My proposed solution is to download Qt GUI (current version 0.20.1) and then get the same version from github and share the same bitcoin chain database.
To do this, I want to have the same version. Is this as easy as:
# I downloaded 0.20.1 .dmg file from Bitcoin Core and installed it, thus I need that tag from Github
git clone https://github.com/bitcoin/bitcoin.git
git checkout tags/0.20.1
# ... do build here

Then, depending on what I'm doing I run either 1) Qt, or 2) bitcoind, but never at same time.
Any additional steps I need to do to check the versions are the same? Is there an easier way to achieve this? Maybe it's just safer to build Qt stuff myself...

There's no particular issues with running both the daemon and the QT using the same data directory, you're also protected against running them both at once due to locking. Most versions, especially within a single major release, are compatible so there's no burning concern about keeping them exactly in sync with one another.


How exactly is Ripple decentralized when OpenCoin has so much XRP? Let us assume in a best case scenario, the Ripple system gets opensourced this year and the 50 billion XRP are distributed fairly to many people in the world.

One of the reasons of having XRP currency is to prevent spam and provide safety to the Ripple network from abusing.

OpenCoin has about 50 billion XRP or even 30 billion XRP without the founders count. So they can technically use their massive XRP to harm the system if they need to. I have not reviewed how many different and harmful ways one can abuse the Ripple network if they have too many ripples.

Why does any single entity needs to have such amount of power over the network? Technically, for us to trust Ripple, we need to trust the OpenCoin entity forever. Even if OpenCoin people are good, what if their accounts got hacked and the XRP is with malicious people?

There are only two known "attacks" you can perform with a large amount of XRP.

First, you can dump a large amount of XRP on the market. This will reduce the value of XRP, which OpenCoin would have to report as a loss. The net effect would be that people who hold XRP as a store of value would be harmed. So if you choose to use XRP as a store of value, you are incurring the risk that OpenCoin might hurt you by hurting itself more.

Second, you can sustain a large flow of transactions that would bid up the transaction fee on the network. This would mean that people who wanted to perform Ripple transactions would have to wait or would have to "outbid" OpenCoin for transaction slots. This would cost huge amounts of XRP for every minute you wanted to keep the network unusable. So this attack could just be waited out.

But really the premise behind this is false. OpenCoin's XRP has the same value regardless of how it was acquired. So worrying about this is really no different from worrying that someone with large amounts of Bitcoins might dump them on the market crashing the price. It's true, but people don't do that often because it hurts them more than it hurts anyone else. So, yes, it's a risk.

But generally speaking, there are many kinds of attacks someone can perform at their own expense to hurt you. Someone could flood the Bitcoin network with transactions with a .2 BTC transaction fee each, effectively knocking out Satoshi Dice. It's not rational to unduly worry about these kinds of things because it's so rare for someone to attack you in a way that hurts them more than you unless they have some clear motive to harm you and otherwise you'd pretty much have to worry about everything. And, of course, OpenCoin has no motive to deter adoption of the Ripple network.

(I'm an employee of OpenCoin speaking only for myself.)