text:
How can I transfer my Bitcoins from Coin Cafe to my local MultiBit wallet?
I recently purchased a fair sum of bitcoins through Coin Cafe. My transaction went through without a hitch and my coins are sitting in an online wallet given to me through their site. I chose MultiBit as my desktop wallet and I set it up earlier today to have myself ready for coin transfer once my coins were available.
How can I transfer my bitcoins from Coin Cafe to my MultiBit wallet?

Perhaps you could explain what problem you are having. What have you done? What are you expecting to happen? All you have said is that you have waited four hours for something, but you haven't said what.

It is not clear what you have tried so far, but step-by-step you want to do something along the lines of this:

In Multibit create a new receiving address by clicking the "New" button.
On Coin Cafe look for a "Send Bitcoins" or "Withdraw Bitcoins" option.
Check out any help provided on this option, to see if there is a fee for the withdrawal.
The "Withdrawal option" should allow you to specify a destination and an amount: Put the "receiving address" you created in Multibit as destination, and (if there is a fee for the withdrawal) your balance - fee as the amount.
Confirm the transaction/withdrawal

If you cannot find a withdrawal option, check out the help section, or get in touch with Coin Cafe's customer service: They provide a live chat, service email address and phone number.

authors: Игорь Нагаев


text:
Is the change address always at the same position in the vout array of a raw transaction?
When using the sendtoaddress command, does the Bitcoin client automatically place the change address at vout array position 0?
I would assume so, because bitcoin works through a sequence of procedures.

No, it picks a random position.
The purpose is to make it hard for people observing the blockchain to know which is change and which is the payment, as that would make tracing easier. This is also the reason why change outputs use new keys to send to.
Note that there has been a bug for a long time that made it always end up in the same position. It was fixed over a year ago, IIRC.

Note that it's still fairly easy to (semi-accurately) track which is change vs payment. blockchain.info does it automatically, and is usually correct, from what I've seen.

source: Stack Exchange

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

sort: votes


text:
Why is a short blocktime considered to be unsafe?
I've heard a couple of times "a shorter blocktime is unsafe," (first about Litecoin and now Ethereum) but never understood why. Is it the higher probability of a fork? Why do some people consider a shorter blocktime less safe?

The shorter the blocktime the more time is lost by the relaying of blocks in relation to the average blocktime. A very short block interval therefore makes SPV mining (i.e. mining empty blocks without transactions) more attractive, and increases the advantage of large pools, because they can start mining on top of their own block the quickest.
Additionally, it increases the number of headers that need to be verified and stored by any client, even smartphone wallets.

Also see How would faster blocks cause mining centralization?
for a more comprehensive explanation how the block interval influences mining incentives.

Related: https://bitcoin.stackexchange.com/questions/113505/how-would-faster-blocks-cause-mining-centralization/113506#113506

@AntoinePoinsot: Thanks, I added a link

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

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


text:
How can I watch an address on Windows and Android?
I want to be informed of transactions of my Bitcoin address on the Windows and the Android app. Can I use the same Bitcoin address on both? If yes, how can I backup the address on Windows and restore it on Android?

Quick note, blockchain.info lets you monitor transactions for a given bitcoin address without importing any private keys. It's under import/export "Watch Address"

Welcome to Bitcoin.SE. Please only ask about one topic per post: I've edited your question to refocus it on the second part, i.e. watching an address with two different apps. Your first question is answered for example here: What's the difference between a wallet and an address?, What is the role of bitcoin wallets?. Please feel free to edit this post if I didn't capture your intent for the second question. If you find your question about wallets not answered, please repost it as its own post.

Just use bitcoind
-walletnotify=    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)
in a script or for more details, access the bitcoind API via RPC  https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

You can add and monitor addresses in http://blockonomics.co
It can be used on both desktop and mobile


text:
How much hashpower would I require to surely mine one block per day?
How much hashpower would I require to surely mine one block per day?

There's no such thing as "sure": no matter how much hash power you have, there will always be some nonzero probability of mining no blocks in a day. How small do you want that probability to be? Also, your title talks about mining one coin but the body is about mining one block; please clarify.

You can play around with tools like this one http://www.bitcoinx.com/profit/
But as Nate said there is nothing sure. It are just estimations.

@NateEldredge I would like the probability of not mining a single block per day to be very low. Sorry the confusion, I was going to ask about mining 1 bitcoin, but then I remembered that we can only mine block by block.
This is all a sudden interest of mine, I'm not quite well familiar with bitcoin terminology and inner workings.

Nowadays almost all miners use mining pools. Look at this https://en.bitcoin.it/wiki/Pooled_mining

Divide this number by the number of seconds in a day (86400) to get the required number of hashes per second to solve one block per day on average. You might get more than one block on some days and no blocks on others. It's random.
Currently, you'd need about 931 TH/s, which is a ridiculous amount of mining power.

Given this number, one can work out the hash rate needed to have, say, a 99 percent probability to get at least one block per day. Look up the Poisson distribution.

At today's hashrate and prices, an investment of 2,223 (about $836,300 or 1467 BTC worth of) S3 miners would net you a block a day. All you need is ~16 cubic meters to house them, and 756 kilowatts of energy (more of each, for cooling, etc.). Oh, and PSUs.

@ today's rate: 200653409601322281662/86400 = 2322377425941230. Can someone convert this number to TH/s?

@balki Divide by 1000000000000 to get TH/s. Currently 2322 TH/s.

About 40 TeraHash will make 1 btc a day  About 66 Thousands bux worth of miners.
And 400Amp power service. Maybe a lil more.

"About 66 Thousands bux worth of miners" I like the way you show the things.

authors: ศรายุทธ ระรวยศรี


text:
What is Namecoin's blocksize limit?
Bitcoin's blocksize limit is currently 1MB. It seems as if Namecoin would have to be bigger due to it proving 512 bytes of storage with a name update, but it also has slower average block times (about 20 minutes according to BitInfoCharts).
Does Namecoin also have block size limit? What size is it?

Namecoin has not strayed from Bitcoin in this parameter, it is still set at a 1 MB block size limit. You can find it in main.h:
/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000;


text:
What happened to the bootstrap.dat provided by bitcoin.org?
I could download a bootstrap.dat.torrent from  bitcoin.org before, but it is no longer available. Does bitcoin.org still maintain it?
Is there another source for downloading a bootstrap.dat? I am stuck with a 0.9.x version of BitcoinCore for testing purposes, and the bootstrap.dat would improve synchronization for me.

possible duplicate: Can I download the whole block chain from somewhere?

I know bootstrap.dat, it just because bitcoin.org remove the link of bootstrap.dat.torrent.

Sorry, if I changed the intent of your question. Please feel free to rollback my changes or further edit your post to better align it with your intent.

As user Bitcoin has already pointed out, using a bootstrap.dat is no longer recommended—you can see the release notes for the new faster-synchronization feature here.
As a result, the bootstrap.dat torrent links were removed from bitcoin.org after a short discussion.
The bootstrap.dat file is still available here on the bitcointalk.org forum, and jgarzik has indicated that he will continue to occasionally update it "for academic research and development purposes."
Another alternative is the version which has been maintained by Armory Technologies, available here. At the time of this writing, it is more up-to-date than jgarzik's bootstrap.dat, however it's not clear if it will receive any future updates.

To whomever downvoted my answer: can you please explain why this is incorrect and/or how it can be improved?

I think yours is an exemplary answer. It treats all aspects of the question, i.e. why the bootstrap.dat its no longer listed on bitcoin.org, where the bootstrap still can be found andwhat alternative approaches exist. Meanwhile, it is well-written and commendably sourced. Have an upvote.

@Murch Much obliged; regardless I'm always open to constructive criticism and to fixing any mistakes I make.

Your answer is what I want to know, thank you!

@ChristopherGurnee: Would it be possible to download the Blockchain with BitcoinCore 0.10.x and use it with 0.9.x?

@Murch Afraid not—headers-first broke backwards compatibility of the block files and LevelDB databases (noted here in the release notes).

@ChristopherGurnee: What I meant was, I see the downvote, but I don't see an (obvious) reason for it.

@Murch Me neither ;)  I was just leaving open some benefit of the doubt.

It's not necessary so is not being updated anymore. Using a bootstrap torrent is slower than downloading from the network using Bitcoin Core 0.10.0 or above due to improvements in the block downloading method.

Thank you, but I need use 0.9.x for now, because my program is not test for 0.10.x yet.

Here is a thread where someone is providing updated bootstrap.dat downloads on BitcoinTalk:
https://bitcointalk.org/index.php?topic=1310261.msg13412290#msg13412290

I see it here:
https://bitcoin.org/bin/block-chain/
Maybe it was removed but it's back again?


text:
How does one calculate the profitability for a coin?
Given, a coin has difficulty 'd', an exchange rate 'x'/BTC or 'X'/USD, and given that my hardware can do 'y' MH/s (scrypt), how would I determine the best coin that I could mine? Do I need to consider any other factors?

You can use this website to find out what is currently most profitable to mine.

Um, pick the one that maximizes x*y/d.

I don't really see how this question is "too broad". Both Nick and Nate gave a valid answer in just a sentence. (Which would make good answers.)

authors: Руслан Коломиец


text:
what countries accept and refuse BTC as money?
I am thinking where to find list what countries refuse or accept bitcoin as money?
I read Denmark doesn't make tax for BTC because it is not accepted by the state as money. it has and legal consequences, if exchanger disappear with bitcoins, he will not go to the prison because he didn't steal money. as I see, mtgox took money, 100M bucks, and they are not in the prison.

We literally use this exact question as an example, in multiple places on the site, of a question that is too broad. We appreciate your interest in both Bitcoin and StackExchange but would kindly ask that you brush up on our rules a bit.

To follow up on Mathias's answer (because I dont have enough rep to add a comment to it), and to address OP's question about going to prison. Just because Bitcoin isnt considered to be money or currency by a state doesn't mean it is quasi-legal to steal it. States will generally still consider it to be property even if it isnt money/currency, which would still be illegal to steal.
And to address Karpeles/Mt. Gox, he isnt in jail because there isnt any hard evidence that he stole it. Being a incompetent businessman and bankrupting a company generally isnt illegal.

I think the most up-to-date list is from Wikipedia. If you want more countries and more recent news, I think you have to search for each country individually. For example, in the Netherlands it is declared by a judge as NOT money, but has the same status as gold and silver. This is the translated source from google.translate. If you are dutch and want to read it, this is the link to the original document.
The legal consequences differ from country to country, and I will not be surprised if it changes over time.


text:
Bitcoin Transaction within source code
I am messing with the Bitcoin sourcecode.
Normally when you want to send some BTC you type :
./bitcoind sendtoaddress 1ADRESSS 0.001

How would you do this in the sourcecode on a recurring basis?
So what code is needed to send a transaction to a specified address each time a block is created? Almost like a tax. and where would this code be placed?
I am learning the Inside of the Bitcoin protocol and C++ so any help would be great.

So you want a script that will spend your money without asking your permission? It's doable, but very dangerous. YOu would be better off looking at multi-signature or escrow transactions.

The table of RPC commands can be found in rpcserver.cpp in the static array vRPCCommands.  From that you can see that the RPC command sendtoaddress is implemented by a C++ function named, appropriately enough, sendtoaddress.  A quick grep shows this function is defined in rpcwallet.cpp, and its work is done by calling pwalletMain->SendMoney().  So pwallet->SendMoney() seems like the right function to call.


text:
What is a block?
I know bitcoin has a block chain that is from my best representation a list of blocks. I know the block holds many transactions. But i'm still very much lost as to what a block is and how a block can be the function of the transactions at the time prior to the block being solved and how a block can have any number of transactions prior to it being solved and locked in.
I'm also lost on the process of "solving" a block. I know it requires computers encrypting the transaction. If a block is multiple transaction would that imply that you have to solve all the transactions to get the block.

possible duplicate of http://bitcoin.stackexchange.com/questions/7330/whats-the-process-of-creating-a-block-on-the-blockchain?rq=1

@NickODell, similar, but I think this one is more about the structure of a block, and the other how to build it given the state of the block chain.

There are a lot of questions on the Bitcoin SE about blocks, but remarkably I couldn't find any that explicitly lay out what a block is.
A blocks has two things: A block header and a list of transactions.

Block:

Block Header

Version Number (4 byte integer)
Previous Block Id (32 byte hash)
Merkle Root (32 byte hash)
Time (4 byte integer)
Difficulty (4 byte integer)
Nonce (4 byte integer)

List of Transactions

Number of transactions in List
Tx1
Tx2
...
TxN

In the block header part of the block:

The version number is a parameter to help in updating how blocks are treated by the network.
The reference to the hash of the previous block is what makes the group of blocks a "block chain".
The merkle root is hash that can be used to prove that a transaction is in the block without providing all of the details of the block (this is a bit complicated, see this for more info).
The time field is to show the network what time the block was solved at, and to help in calculating the difficulty parameter.
The difficulty (or nBits as it is called in the code) is shorthand for how difficult it is to solve the block. Essentially, it encodes a target value, and the hash of the block (when treated as a 256 bit integer) must be below that target value to be considered solved.
The nonce (number used once) is just an integer that miners can change repeatedly to hash the header and get a different result each time, hoping to get a hash that is below the difficulty value encoded by the previous parameter.

The list of transactions is fairly straightforward, it's just the number of transactions and then the transactions themselves concatenated together.
Take for example the genesis block. The raw bytes are:

0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000

When we break this up, we can see what is in it:

01000000                                                          // Version
0000000000000000000000000000000000000000000000000000000000000000  // Hash Previous Block
3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a  // Merkle Root
29ab5f49                                                          // Time
ffff001d                                                          // Difficulty
1dac2b7c                                                          // Nonce
01                                                                // Number of Transactions
 Tx1:
 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000

When you hash the block header of the genesis block, you get:
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

See how it starts with all these zeroes? That's because many many tries were taken (changing the nonce each time) until the miner was lucky enough to find a nonce that makes the block header hash to a low enough value (look at the hash as a hex encoded integer, with the most significant bits on the left, and the least significant on the right).


text:
Is it possible to buy and sell Bitcoin within minutes?
I am curious to know if it is possible to easily buy $5 of Bitcoin and sell it a few minutes later, trying to make mini profits for fun, or are the waiting times etc... Too long?

@murch I'm wondering if the sole purpose of this question was to attract spam?

@JanDvorak: I just got this one up in my review queue and revisited it. On second look I felt that "Unclear what you are asking" didn't really fit. It's not the greatest question, but it isn't wrong or off-topic. I looked at the user's questions on other sites and this one is seems to be a genuine question, even though it is rather obvious. One could argue that it doesn't show enough research effort (which is why I downvoted it).

It depends. If you already have Robinhood, it may be able to let you buy in within minutes.  I had a Robinhood account, and I bought some Bitcoin within minutes, with no fees.

It will take a while to get money to an exchange platform, but once you have an account and a balance there, trading is very quick. A lot of people try to do exactly that: They buy low and sell at a profit, or buy on one exchange and sell on another for a higher price.
However, trading on exchange platforms happens off the blockchain, i.e. all the "score keeping" is done by a company in their bookkeeping. It would not be as easy to trade bitcoins by actually holding them, then you would be impeded by waiting for confirmations on the transactions which in average take about ten minutes. You could still trade on large swings over a few months that way, but mini-profits would be very hard to time with such delays.


text:
Historical BTC data in JSON
As of now, the only API I can find that serves historical data is https://blockchain.info/charts/market-price?timespan=60days&format=json. It only uses USD, and I need to serve non-USD data. My google-fu is failing me, does anyone know of an API that serves historical data for more than one currency? Preferably a currency I can specify as part of the API call.

I believe Coindesk has an index of data in various currencies. http://www.coindesk.com/price/ What you have to know however is that it was not possible to buy BTC in all currencies from the get-go. USD was the original traded currency, so that has the longest history. You could theoretically derive the price for any given day based on the FOREX rates in OANDA or XE.

You can try Bitcoin Charts API

Modern answer for visibility: https://min-api.cryptocompare.com/
Nice api they having pricing breakdowns for day, hour and minute granularity.

Free:
https://www.kaggle.com/mczielinski/bitcoin-historical-data
Not Free:
This is the most extensive data set you'll find for free.  I augment it with data exported from TradingView.


text:
Why does an adversary have to control 50% of the computing power to double spend?
If transactions in a block are valid, in order to add that block in the block chain, a proof of work needs to be found. I have read the bitcoin paper by Satoshi.
If the difficulty of the proof of work requires say 2^52 computations (13 hex zeros) on an average, and since every node on the network is working independently, why can't the powerful adversary surpass the length of current block chain and present his version of block chain to the network? Specifically, why does the attacker have to control 1 percent or x percent of the network's computational power, when honest nodes on the network are not working in collaboration to find the proof of work?
If the adversary can find a proof of work quicker than the most powerful honest peer, he can compute a longer block chain and broadcast it to the network.
Let us assume that there are 2^20 nodes on the network, each computing 2^40 hashes per second on an average. Each node would then require 68 minutes to find a proof of work (trying 2^52 hashes). The total computing power of the network is number of nodes * computing power of each node = 2^20*2^40 = 2^60.
If the adversary operates at the speed of 2^45 hashes per second, he requires just 2^7 = 2 min to find a proof of work (2^52 hashes).
Now, the computing power of the network is 2^60, however each node is trying to find a proof of work independently. The computing power of adversary compared to the network is 32,000 times smaller. The amount of computing power controlled by the adversary is 1/32000 = 0.00001%,  but still he can compute the longer block chain.
Please help, if I am assuming something wrong here. The honest nodes on the network do not work in collaboration. So attacker need not control 50% of computing power on the network and has to expend computing power just more than average computing power of the honest nodes.

2^12 is 4096, so each computer with 2^40 hashes per second would require 68 minutes, not 16.

agreed, can you answer the question?

Got a bit sidelined in between, but I just did. :)

Also see: How is it that concurrent miners do not subvert each other's work?, How can we be sure that a new block will be found?

Misconception: "If the adversary can find a proof of work quicker than the most powerful honest peer, he can compute a longer block chain and broadcast it to the network." should be: "quicker than ALL honest peers combined."

Probably already answered below, but "The honest nodes on the network do not work in collaboration." yes they actually do. That's the beauty of PoW. :)

@Jannes: Yes, I've addressed both points in my answer. :)

@Murch Yeah should have read the answer first. Great one (again). Already upvoted. Thx.

Every node on the network is working with different inputs to a hash function but trying to achieve the same target. So in a way all nodes are working together.

There are two assumptions in your question that aren't completely correct.
1) Each node would then require 68 minutes to find a proof of work (trying 2^52 hashes).
The process of finding a new block is not a linear task of work that needs to be accumulated. Rather it is a random process. Instead of a pile of work you are going through that has a fixed size, you could think of it as a lottery: Each try can win, but in average it takes 2^52 tries to win. This distinction is very important, because…
2) The honest nodes on the network do not work in collaboration.
…it allows the network to collaborate without coordinating!
Every mining entity is trying to confirm a different block. This is so, because each is trying to claim the block reward for themselves, therefore at least one transaction, the coinbase transaction, must differ.¹
So, since we have established that we are looking at a random process, and everyone is working on different data, we realize that the honest nodes are not duplicating each other's work. Therefore, all the honest nodes are going through a lot more inputs together than the adversary, and in effect are collaborating at finding a new block.
As cpast has pointed out in the comments, it is also very important to realize that nobody loses progress by switching. Therefore, only the time that the block requires to propagate through the network is lost, and everybody will switch to the new block with the one just found as a parent as soon as they receive it.
Finally, this means that we need to compare the mining power of the honest network with the adversary's mining power in order to see who can create the greater chain. And as you have said yourself, with your exemplary numbers the network is 2^15 times as powerful than the adversary.
¹ Also, they can be working of different sets of transactions, the transactions will be in a different order for different miners, the timestamp changes every second, and they add more random data to try different inputs.

Is the probability of finding proof of work for any block, where each node is working on different block is equivalent to the probability of finding proof of work for the given block, each node working on same block but with different nonce?

SHA-256 is a cryptographic hash algorithm. That means, that nobody can predict which inputs will lead to a successful hash. Especially, it is irrelevant how big the change is between two inputs, as their outputs are not in a recognizable relationship to each other. Therefor, it does not matter what is changed about the input as long as there is some change. So, as long as nobody is duplicating the same inputs, working on different blocks or different nonces is equivalent.

Finally I got it.

I've just discovered Princeton's online course "Intro to Crypto and Cryptocurrencies", which covers Cryptographic Hashfunctions and collisions in the first few minutes, it seems to be building up to proof of work, but I have to leave for work now. ;)

Because it's irrelevant how long an individual honest node takes to mine a block. The honest nodes work independently, but if any of them mine a block they all move on to the next block. Nodes aren't all trying the same thing; each of the 2^20 honest nodes is looking at different hash values, so while an individual node only succeeds every 16 minutes on average, someone will get lucky and succeed after a minuscule fraction of a second (for instance, there's a 1/16 chance an honest miner succeeds in the first minute, so with 16 honest miners you'd expect someone to succeed then).

but if a new block is mined successfully by some honest node, it is added to the block chain and therefore all honest nodes have to consider this by computing its hash and including in the. Therefore, for honest nodes proof of work starts from scratch again because of ordering of blocks in the block chain. The attacker on other hand, can mine say 5-6 blocks in 10 min and broadcast them to the network, thus forming the longer chain.

But the honest chain gets another block mined in another fraction of a second. Every hash has the same probability of being valid, but the honest guys get 32,000 hashes to the bad guy's one. "Proof of work" isn't something you make progress towards and then have to start over, it's something where you're as likely to get a valid hash in minute 1 as in minute 60.

Also, the attacker has to increase his blockchain when he mines a block; even if "start from scratch" was a thing, the attacker would also have to do so.

I understand that every node on the network is not trying the same think. but say a honest node A, finds a proof of work for a block and broadcasts it to the network. If valid proof of work is found, all peers on the network confirm this by adding thatblock to the block chain. Since, blocks in the block chain are ordered, the peers have to include the hash of newly included block in their proof of work and the computation starts again from the scratch. Am I wrong? Further I am assuming that the attacker is working independently and mines 6 new blocks and broadcast them together on the network.

Also, every block must be added once in 10 min on an average. Otherwise, difficulty of proof of work is increased. How come, fraction of second is enough to mine a block?

@Curious A consequence of 2^20 people who can each mine a block every 16 minutes means a block is mined every 2^-16 minutes, or over 64k mined per minute. Your numbers are what led to that.

So the strength is due to every honest node in the network is working independently on different block (different transactions) to find a proof of work. If every honest node works on the same block(same transactions), in this case, the attacker can exploit his fast computing power?

I think I have understood your point. But bitcoin network mines every block in 10 min on an average. So how difficult needs to be the proof of work, to achieve this. does it also depends upon the number of nodes on the network?

And you seem to misunderstand mining. "Start over" has no meaning, because you have no meaningful work tied up in your failed efforts. Mining is like the lottery; each hash is a ticket. The fact that you bought a bunch of losing tickets doesn't mean you're about to get a winning one; when they move on to the next series of tickets, you didn't lose any value you had stored in old losing tickets, because they had no value anyway.

Yes, difficulty scales so that you would expect one hash in (number computed in ten minutes by the whole network) to be valid. And the attacker can't work off the same block (when he mines it he has to add a block too, six hashes of one block doesn't equal six blocks), but he also mined many fewer blocks than the honest network (who mined tens of thousands before he got one).

Does difficulty also depends upon the number of nodes on the network? So basically the probability of finding a valid proof of work in a given time is sum of probability of all the nodes on the network.

Is the probability of finding proof of work for any block, where each node is working on different block is equivalent to the probability of finding proof of work for the given block, each node working on same block but with different nonce?


text:
Unspent outputs get spent automatically
After generating a 2-out-of-3 wallet (using brainwallet http://ms-brainwallet.org/#generator) I am able to store my private/public keys for each of the participants.
Afterwards I send a small amount of BTC to this address (0.0002). The amount is correctly recorded and confirmed in the blockchain and is listed as an unspent transaction.
Afterwards I create a new transaction that spends (0.0001 BTC). This transaction is successful. On the third step I sent more funds to the 2-out-of-3 wallet (0.0003). This is where the issue happens: any funds I deposit in this wallet from second transaction on are automatically spent towards various unknown addresses, and there is never any unspent transactions no matter how much I deposit there.
I have tested this with several wallets already.
What I am thinking of is that there is a change problem. I found some ways that funds can 'evaporate' but I haven't been able to nail the issue completely. Any inputs would be appreciated.

I'm not sure I understand what's going on from your description. Could you give the multisignature address, or draw a diagram?

Is it 32sQKWebFMMdgmvfyJsUz8Fxbi4HJJaqcf?

You either made a mistake in crafting the multisig transaction, or your private key is compromised somehow (brain wallets in general are just a bad idea). As others have stated, it would help if you post the multisig address in question.

Yes its 32sQKWebFMMdgmvfyJsUz8Fxbi4HJJaqcf

My guess is that you are using weak passphrases to generate your keys. This is a common mistake with brain wallets. It is well known that there are bots that scan the blockchain for any unspent coins contained in an address generated from a weak passphrase and takes it for itself. I've not heard of a bot that looks at multisig p2sh addresses for weak passphrases, but I'm not surprised that it exists. It's not that much different than looking for weak passphrases in a standard pay to pub key transaction.
The reason why I think this is the case is because your coins get taken from the multisig address after you've made one transaction from the multisig address. When you make a transaction from the multisig address, you reveal all the public keys that the multisig address is associated with. If the passphrase associated with the key is weak, the private key can be cracked by the bots and your coins will be gone.
If your coins were taken before you've made a transaction from the multisig address, this could mean that your computer or the brainwallet generator is compromised. It is also possible that there is a bot that can crack a p2sh multisig address without knowing the public keys (this is doable but since the search space is bigger it would be harder for the bot).  But since this is not the case, it seems pretty clear that you are using weak passphrases to generate your keys.

I've not heard of a bot that looks at multisig p2sh addresses for weak passphrases<<< OK, now you have heard about it :)

That should be the case since I was playing around with small amounts. Thanks!


text:
My balance gets sent back to me
I'm using the blockchain API to make a "send to many transaction". In the recipients I only put other people addresses, but somehow the API sends the remainder of my balance back to me.
For example:

https://blockchain.info/tx/b4c3203815fdf61616c0a2358fa0388e734bf53503f0a659d3c9fc7863da8adc

I had 0.01 btc in my wallet. I sent 0.0000543 BTC to two different recipients, but somehow my whole balance got spent and my 0.0097914 BTC got sent back to me. I didn't ask for this.
EDIT: It also happens on a singular transaction:

https://blockchain.info/tx/2eb4273313e27c2ede86844c58f687dc535aeaa5207e9a9c4a526a032cd5143a

I've inspected the API calls and they are correct. My address is no where to be seen in it.
Why is this happening?

Thank you very much. Didn't knew it was called change and so google wasn't hepling.

That's how Bitcoin works. Accounts don't really have balances, they have unspent outputs. You have to spend entire outputs, but you can return amounts to yourself to create a new "change" output that you can spend later.


text:
Getting Bitcoin address from Android Bitcoin wallets
In the android app that I am developing, I need to send a request to check if other Bitcoin apps exist on the user’s phone, and if that is the case, I need to get the user’s Bitcoin address from the wallet.
Is there any type of API/URI specified for this? Or how else can I do that?


text:
How does schnorr signature construct multisig functionality?

How does the multiparty schnorr signature work and enable multisig
functionality in Bitcoin?
What are its limitations? Can we construct any m of n signature?
Is there anyway to hide the signers among the participants?

*I specifically would like to see the elliptic curve math in details.


text:
How are bitcoins generated during mining?
I know that when someone is able to find a block and hash that can be attached to the chain, he will be awarded with "newly found bitcoins"
However, isn't mining simply finding the hash? Where do these new bitcoins come from?

On a high level, the entire bitcoin network is built on the fact that all of the nodes are following the same rules. The rules state that whoever hashes the next block gets to mint a number of coins, so they can.
From the Bitcoin white paper:

By convention, the first transaction in a block is a special
transaction that starts a new coin owned by the creator of the block.
This adds an incentive for nodes to support the network, and provides
a way to initially distribute coins into circulation, since there is
no central authority to issue them.

From the wiki:

Bitcoins are created each time a user discovers a new block. The rate
of block creation is approximately constant over time: 6 per hour. The
number of Bitcoins generated per block is set to decrease
geometrically, with a 50% reduction every four years. The result is
that the number of Bitcoins in existence will never exceed 21 million.


text:
Are transactions in the mined block validated by other nodes on the network?
After successfully mining a block, the block and the solution is broadcast to the network. The nodes on the network in turn verify the solution. Aren't transactions that belong to the broadcasted mined block validated?

This has been covered before (I can't give links at this juncture as I'm on mobile device), but:

each block references the previous block, preserving manipulation of blocks through POW
each Tx references it's corresponding UTXO hash
each UTXO requires a cryptographic puzzle (script) solution to spend the UTXOs

I'm sure someone will refer you to further information if I haven't edited this myself later on.

https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages

I'm not sure this answers the question. The asker is asking about whether clients validate the block (they do) not whether the information to validate the block is sent between nodes.


text:
Electrum wallet - Can not send bitcoins
Does anybody know what this code means?  error: {u'message': u'64: dust', u'code': -26}   I've managed to send bitcoins once, same settings, but it only worked once.
Any help is welcome, thanks!

Is it possible that the amount you were trying to send is below 5430 satoshi? That would be considered dust, and perhaps electrum would not send a transaction with dust. You might need to add more information for us to give you a better answer.

I think that was the problem, i have send a higher amount and it worked. The "dust" i was trying to send was to test my wallet since i am new in this bitcoin revolution. Thank you very much for this fast reply and the solution! Best regards!

Cool, glad I could help. I had been researching meanwhile and found a little more about your error. See my answer below.

According to another question about an Electrum error message the error message is just passed along by Electrum and originally was generated in BitcoinQt:
According to rpcprotocol.h in the source code error -26 has the following meaning:
 RPC_VERIFY_REJECTED = -26, //! Transaction or block was rejected by network rules

Guessing from the word "dust" appearing in the message, was the amount you were trying to send below 5430 satoshi? That would be considered dust, and perhaps electrum would not send a transaction with dust.


text:
Wallet gone, how to get it back?
So I had my Bitcoin wallet at Multibit and due to computer problems I formatted my hard drive and the wallet within it. I have no backups of the wallet, I have only my account name. Are my Bitcoins now gone forever?

I am not sure what you mean by "account name".  I can't find any reference to Multibit using such a thing.  Can you explain what you mean?  Maybe a screenshot of where in the program you would enter this?

I would check these help pages out. The first one explains that your wallet may not be fully deleted.

https://multibit.org/en/help/v0.5/help_support_missingWallets.html
https://multibit.org/en/help/v0.5/help_lostOrForgottenPassword.html

Multibit has a pretty good troubleshooting page too, which explains where all their data is stored. I would check and see if you have any data in your system specific directory.

https://multibit.org/en/help/v0.5/help_troubleshooting.html

If the wallet is truly deleted, and you don't have any backups, then yes, unfortunately your bitcoins are gone forever. :/

I still have my account name. Is that same thing as private key? Can I somehow return my wallet using that?

The account name is nothing like the private key.


text:
Which function is called to mine a block, broadcast the newly mined block & receive a newly mined block?
I am trying to understand the control flow and handling of transactions in the memory pool.

These are all different functions. Could you be a little more specific?

@NickODell When a new transaction is received it is added to the memory pool (after checking for conflicts). While mining, only the transactions which are in the pool are considered. What happens to the transactions after they are included to a newly mined block? Are they moved to another data structure from pool? If yes, Which function handles it ?

authors: Игорь Кононенко


text:
How do nodes rebroacast transactions
When a bitcoin node receive a new transaction, it rebroadcast it and stores it in its mempool. If the transaction gets into a block, then it is removed from the node's mempool.
But what happen when it is still unconfirmed after some blocks? How does it check which transactions to rebroadcast? Is there a priority list to choose which transaction to broadcast?

Nodes typically do not rebroadcast transactions. They have no reason to do so, it is not their problem if a transaction is not confirmed.
However if a wallet will likely rebroadcast its transactions, and only its transactions. Rebroadcasting works in the exact same way that broadcasting a transaction works. If nodes still have the transaction in their mempools, then they will ignore the transaction. Of course this means it will not propagate well if all of the nodes that a wallet is connected to already has the transaction but other nodes don't.

Since the asker used "rebroadcast" to also refer to the first time a node relays a transaction, it sounds like you're saying they don't relay tx at all.


text:
Is there a public API server for Stellar?
I'm writing a Stellar application. I'm looking to use the API provided by stellard without running a copy of it myself.
Is there a public API server for Stellar?

Yep:
https://www.stellar.org/api/

Stellar Foundation runs two instances of stellard you can use if you
don't want to run your own.
network   address           RPC Port  Websocket Port
test          test.stellar.org 9002          9001
live           live.stellar.org 9002          9001

If you want to try the new API look at this page: https://www.stellar.org/galaxy/getting-started/


text:
ELI5: What's the difference between a child-key and a hardened child-key in BIP32
I've read BIP32, and I do understand it more or less.
Could someone please explain to me like I'm 5 years old what the difference between a child-key and a hardened child-key is?
I'm trying to add HD wallet generation to a service I'm building. I need to be completely informed about this before I dabble in it. Fret not, I'll be using Bitcore, so I won't be dabbling with the crypto directly.

Essentially, a hardened child key is is computed with hash(parent private key + index), whereas a non-hardened child key is computed with hash(parent public key + index).
So what practical consequences does this have?
With an extended public key, you can derive non-hardened child public keys. This is useful in situations where you want to accept payments without immediately being able to spend them. For example, if you had a website selling alpaca socks, your server could use an extended public key to accept payments without losing all of your money if it got hacked. So that's a reason why you might use non-hardened derivation.
With an extended private key, you can also derive hardened keys.
However, non-hardened public keys are weaker when an attacker has 1) the extended public key and 2) one of the non-hardened private keys that was derived from it. In that circumstance, the attacker can work out the private key of the extended public key, and therefore get every key that can be derived from that, hardened and non-hardened.
So what should your app use by default?
You should use non-hardened keys, and disable the ability to export private keys when that would allow an attacker to compromise other keys in the wallet. Even if an attacker gets ahold of one of the private keys, in situations where the attacker doesn't have access to the extended public key, non-hardened is equivalent to hardened security. In my mind, the features of non-hardened keys outweigh the added security of hardened keys.
However, if you don't need the features of non-hardened keys, then you should use hardened keys, because they're more secure.

What can hardened keys be used for? What are their limitations.

Hardened keys are useful whenever you don't need the ability to give someone a master public key, and have them know all addresses. For those cases, they have much better security properties than unhardened.

@PieterWuille how so? I don't think I get it. I want to make a service which generates bitcoin addresses which people can pay, and that I know I can spend from. With hardened addresses, I need a private key on this service, so if I get hacked, I lose all the money. With non-hardened addresses, there is no sensitive info on my service, so it can be hacked to no damage. I just need to store the private key safely anywhere.

Yes, that's something you can only do with non-hardened keys.

How changing private key to public in the hash function makes derivation non-hardened? Or is it just a convention? There’s 0x00 prepended probably to make it look like a public key?


text:
Add a Watch-only Wallet in Bitcoind
When running bitcoind under OSX/Linux, how can we add a watch-only wallet using the JSON RPC? Do we need the public key or is the bitcoin address sufficient?

As of bitcoind v10, there is support for watch-only addresses. A bitcoin address is sufficient. The bitcoin-cli command is:
bitcoin-cli importaddress "address" ( "label" rescan )
Where "address" is the address you wish to watch, "label" is an optional label for the the address, and "rescan" is a boolean of whether bitcoind should rescan all previous transactions for activity relating to "address".
The example in bitcoin-cli's documentation of the JSON-RPC command is:
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["myaddress", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
Release notes for watch-only wallet support

thank goodness for this new functionality. this should have been one of the first things that was implemented in bitcoin. how else can anybody run a trustless e-commerce site with air-gapped private keys? i was writing my own re-implementation until this feature came out purely for this purpose :p

Today this is not possible.  There's been an active discussion on this topic on GitHub, but it's currently not implemented.
There was a pull request submitted a while back that some people may have started using in production, but my understanding is that the code is old and currently not buildable against the current source.
It would be a great feature, so I hope it comes out at some point.

authors: Дмитрий Березин

authors: Евгений Фёдоров


text:
is it necessary to stay connected to internet
it could be a basic question for you guys, but i'm new in this.
is it necessary to stay connected to internet while doing solo-mining ?
is there any method to keep mining without permanent internet connection (i mean offline mining)?
thatnk's

You need to be online because mining is sort of like a mathematical race: whoever finds the hash of the next block (with value less than the current target) wins. And in order to prove that you found this value before anybody else, you need to be online in order to broadcast it to other users.


text:
Unconfirmed transaction - Non(e) standard input
A few hours ago, I created an offline transaction using the offline transaction tool available at:
https://www.strongcoin.com/downloads/offlineTransaction.zip
I coped and pasted the resulting transaction into the chain at:
http://blockchain.info/pushtx.
The transaction appears to be stuck. It has a high priority but also says "This transaction has a none standard input."
The transaction # is:
5826ae9e76e2edac733bf9633f5b13de3985dc8989d64ba1780e01d7eac76ee2
I did some googling around, but have found no definitive solution. In the meantime, I imported the private key of the sending address into a wallet at blockchain.info (not sure if this can help - it shows that I sent the bitcoins, but the transaction is unconfirmed.).
What should I do? If I wait a few days, will the transaction simple fail & the funds revert back to the sending address? Will sending a second transaction work (possibly after waiting a few day)?
I'm new to the bitcoin thing. I am pretty technical (part of the reason I went for an offline wallet to begin with), and thought I had a firm grasp of what I was doing. As it were, I should have played around more with smaller transactions.
Any suggestions would be very appreciated. Thanks!

May I suggest Bitcoin Armory? It has a very nice offline wallet tool.

Your transaction has obviously hard time getting accepted by miners, thus it is stuck in the unconfirmed transactions pool. If no miner decides to include it in a block (because it's non-standard), you'll wait forever - it won't automatically "fail".
The best thing you can do is create another transaction spending the same outputs, this time with standard inputs though (use BitcoinCore client if unsure). It will be picked up by the miners quickly.

Your tool for creating raw transactions has a bug. It encodes DER-signature to wrong format.
Have a look to these bytes (I added some extra spaces)
3044
0220 d034c6cd1aa5590a7d5dac9143d794c49953dd78083a746c9888bbe1020e0b4c
0220 a104832606c509a77543b5889c3940df22fc888aa3240c43ae1e99f6959fea87 01

These numbers should be encoded as signed positives, not as negative!
Modern bitcoin nodes do not accept/relay/mine such transactions.
But you can manually fix this raw transaction.

replace 4730440220d034 with 493046022100d034
replace 0220a104 with 022100a104

What should I do? If I wait a few days, will the transaction simple fail & the funds revert back to the sending address?

Yes.

Will sending a second transaction work (possibly after waiting a few day)?

Yes. But you should create your second transaction with the fixed tool :)

Many thanks to everyone that responded. Your time is most appreciated.
To reiterate, here's the plan of attack:

Wait a few days

Submit a second transaction using a reliable tool (I have both Bitcoin Core & Bitcoin Armory on my machine).

One final question: Will it matter if the second transaction sends to a different address than the first transaction? The intended recipient has multiple receiving addresses, and I'm also considering first sending the funds back to myself (at a different address) just for some reassurance (although probably for no good reason).

You may submit second (doublespending) transaction any time you want, any amount, to any address.

So I might as well try to doublespend now rather than waiting a few days?

Yes. But you should send doublespend transaction in different way. Not through bc.i

That is to say, don't submit it on blockchain.info, but using Bitcoin Core or Bitcoin Armory should work?

You may try to submit doublespend tx even to bc.i . But there will be an error message something like "Inputs already spent" while bc.i keeps the first tx


text:
What's the difference between synced_blocks and synced_headers?
My P2P is a bit rusty, but as far as I understand; if we're running a full node, other nodes will connect to us to share blocks. So I can see why it would be useful to be able to see how far behind other nodes's blockchains are with the getpeerinfo command.
However, what's the practical difference between synced_headers and synced_blocks?
For example, what does it mean if a peer has synced_headers equal to the height of our own blockchain, but a synced_blocks of -1?

Bitcoin clients can have headers without having blocks. (However, Bitcoin Core never has a block without a header.)

A synced_blocks of -1 means that the best block for the other node is unknown.
synced_blocks is set here:
https://github.com/bitcoin/bitcoin/blob/b3e42b6d02e8d19658a9135e427ebceab5367779/src/main.cpp#L557
stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;

A synced_headers of -1 means that the best header for the other node is unknown.
synced_headers is set here:
https://github.com/bitcoin/bitcoin/blob/b3e42b6d02e8d19658a9135e427ebceab5367779/src/main.cpp#L556
stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;

Thanks again, Nick. So would it be correct to say that if the nCommonHeight is -1, then the other node isn't attempting to send or receive block data with our node?

@inersha I think so, yeah.


text:
How does getblocktemplate select transactions?
I wrote a script that compares the transactions listed in the memory pool with the transactions included in getblocktemplate:
http://learnmeabitcoin.com/explorer/node/memorypool
(I've ordered the transactions by [current priority], and highlighted the ones included in getblocktemplate in blue.)

How does getblocktemplate choose which transactions to include from the memory pool in a candidate block?
Why aren't transactions being selected from highest to lowest priority?

The whole mempool won't fit in a block; getblocktemplate returns enough transactions for a block. Blocks are, by default, limited to 750kb by policy, but many miners increase the size to the block limit of 1mb (which can be done by command-line flag).
The specific piece of code that decides on the transactions that should be included in a block can be found here. It's reasonably well documented, and not terrible to read, I'd suggest taking a look through it to see where your script operates differently.


text:
Why don't P2PK scripts have their own address?
If I understand addresses correctly, different types of addresses are used to map to a particular locking script (scriptPubKey).
So based on the leading character of an address, a wallet will decode the address, and then form the appropriate locking script around it.
For example:
P2PKH = 1address
13qWKACQWgQDwDRDoRtqUbN59bar6ousQf
OP_DUP OP_HASH160 1f1cafe31d63e061a3f74b541f4ce7a4515b4d0c OP_EQUALVERIFY OP_CHECKSIG

P2SH = 3address
3MmRfLoNzap2Mt8PwHqhVtxHsmdRieuXfk
OP_HASH160 dc37feb38b5a4ad4bf09bc61eea4831f85c58103 OP_EQUAL

P2PK = n/a
n/a
031b0e8c2567c12536aa13357b79a073dc4444acb83c4ec7a0e2f99dd7457516c5 OP_CHECKSIG

Why is it that P2PK scripts have never been given their own address?
Why not give the public key in a P2PK a checksum, then base58 encode it with it's own leading character so that we can have an address for it?

One of the issues with encoding P2PK outputs as an address is that they can be very long. P2PK can have both compressed and uncompressed keys. Uncompressed keys are 65 bytes, which means that the resulting address would be very long. In fact, this length is probably why P2PKH exists in the first place: as a way to have short strings as addresses. So P2PK addresses could be very long and unwieldy, so not that useful.
But nowadays, everyone uses compressed pubkeys so length isn't much of an issue anymore.
Since Satoshi didn't give P2PK an address type, the reason that one has not been created since then is that no one cares to. P2PKH already does everything P2PK does, just a little bit longer. And with other improvements coming such as Taproot (which is A pay to pubkey scheme and has its own address type), there isn't a compelling reason to go through the effort of defining a standard and trying to get wallets to implement it.

I think there is a mix of transaction type (p2pk, p2sh, p2pkh...) and pubkeys or addresses. The addresses are generated from the hex pubkey (a cool playground here: http://gobittest.appspot.com/Address). The pubkeys  are hashed, a network Byte added, some check summing and base58check encoded. This gives me the bitcoin address of a public key.
In a transaction I can use different methods to transfer funds. I had replied to your other post as well. So when the spending condition only requires you to present your public key and signature, then it is a p2pk transaction. The public key would be recognized by your wallet  (following the above mentioned coding scheme) as „type 1“ address.
If the spending condition is set to present a public key hash, then it is a p2pkh tx, and you have the std Op_Dup, Op_Hash160,... structure.
When having a look onto the stack, it becomes clear, what happens. The spending tx puts its sig and pubkey on stack. Then the pubkey script goes onto stack. First command is OP_Dup, so pubkey is duplicated. Then OP_Hash160 follows, hashing the pubkey. This hash is then compared with the hash of the pubkey script (in your example „1f1cafe31d63e061a3f74b541f4ce7a4515b4d0c“), and hopefully these two match (as per the following OP_Equal). This proves, that you are the rightful person to spend the funds, cause you could proof, that you can hash your pubkey to the referenced pubkey hash. And hashing is a one way function... no one else could do this. In the last step, the signature in the transaction is verified, and with your now provided pubkey the transaction would be checked for a valid signature (OP_Checksig).
Hope I could shed some light in the confusion on addresses and „pay to pubkey“ or „pay to pubkey hash“ transactions :-)

Downvoted. This is very confused and does not answer the question. P2PK outputs do not require presenting a public key and a signature; only a signature. P2PKH outputs do not require presenting a public key hash and a signature; they require a public key and a signature.


text:
Why are blk*.dat files ~134200000 bytes?
I understand that blocks are stored on disk across multiple blk*.dat files, but why is the maximum file size roughly 134,200,000 bytes?

What's the reason behind this file size?
Where can I find this setting in the source code?
What's the exact maximum size?

The constant is called MAX_BLOCKFILE_SIZE and is set in src/validation.h.  It is currently set to 0x8000000 which is 128 MiB (134,217,728 bytes).
You can see where it is checked in FindBlockPos() in src/validation.cpp.
There isn't any indication of why this specific size was chosen and it may be arbitrary.  It is desirable to have some limit because some operating systems (or specific filesystems) have limits on maximum file size, usually above 2 GB or so.  So at least this limit ensures we never get anywhere close to an OS limit.

The rarionale is to enable pruning. We always delete full block files at once, as soon as all blocks in it are old enough. Larger files are more efficient on disk, but have more overhead for pruning, due to delaying when the older blocks in a file are removed.


text:
Do Miners have to get below the Target or the Bits value?
You get a specific Target value when you divide the maximum Target by the Difficulty.
But when you convert the Target in to the Bits format, you're only taking the first 3 bytes of the Target and losing some accuracy.
For example:
Difficulty: 166851513282.78

Original Target: 0x696f3ffffffe0c000000000000000000000000000000000
Target -> Bits: 0x180696f4
Bits -> Target:  0x696f4000000000000000000000000000000000000000000

So when a Miner is trying to get a low enough hash value for the block, are they trying to get below the Bits value or the Target value?

Below the target value that corresponds to the bits field in the block.

So the Bits field is ultimately a short (and slightly less accurate) representation of the Target, just for the purposes of having a representation of the Target in the block header?

Also, I'm assuming Bits is always rounded up?


text:
What kind of node connects to your full node and doesn't share blocks with you?
When running getpeerinfo I can see that a number of connected nodes return a synced_blocks of -1.
Some of these have been connected for days, so:

Is it correct to assume that these nodes are never attempting to propagate blocks around the network?
If so, what's their purpose if they're not propagating block data around the network?

You can see what I mean here: http://learnmeabitcoin.com/explorer/node/

It could be a blockchain analysis node of some sort (eg. Chainalysis or similar), or it could be a pseudonode.


text:
Which files do you recommend I start with to learn Bitcoin?
In the bitcoin/src, which files are the "main" files I should start with if I want to learn how Bitcoin works? In other words, where's it good to branch off from?
I'm new to C++, but can code okay in PHP and Python. I'm learning C++ along the way.

I certainly appreciate your level of enthusiasm to want to dig straight into the code, but if I were you I'd start with the Developer Guide on bitcoin.org, and perhaps also the Developer Reference. A whole lot of effort has gone into this documentation (especially thanks to this guy), and I think you'd be remiss to not to take advantage of it.
After digesting some of that content, you'll have a better idea of what particular aspect of Bitcoin Core interests you the most. As I'm sure you've noticed, it's a rather large codebase, covering consensus issues, blockchain/storage/pruning issues, elliptic curve cryptography, DOS issues, Bitcoin scripting issues, Bloom filters, wallet issues, UI issues, and tons of other things I can't begin to fathom. After getting a good technical overview of Bitcoin and posing a more specific question, I'm sure someone (perhaps not me) can give you a more specific staring point.

I've found Python to be the best Bitcoin learning tool, and many agree, namely because:

You can use the Python console without compiling code, allowing you to easily play with it until it makes sense
Python (especially version 2.7) is dynamically typed (bytes, strings, ints do not need declaring) See Christopher Gurnee's comment below
There's some fantastic libraries for Python, namely Pycoin and pybitcointools

I agree that Python is a great learning tool for Bitcoin, however saying that Python isn't strongly typed is inaccurate. Strong typing refers to the fact that values and objects have a specific type, and require explicit casts/conversions when converting between dissimilar types, e.g. this expression is invalid: "1" + 2, TypeError: cannot concatenate 'str' and 'int' objects. Strong/weak typing isn't related to whether or not variables are explicitly typed; you're probably thinking of static vs. dynamic typing (and Python is dynamically typed). It's also often called "duck" typed.

you're probably thinking of static vs. dynamic typing: You're right mate, I misspoke there! I've edited accordingly, thanks

Even I'm quite new to Bitcoin and I started out with this.
This short explanation gave me good overview.
And Christopher Gurnee is right with starting to study the Developer Guide, the Developer Reference and in addition you could take a look at the Developer Examples.
Regarding your interest in coding, you should take a look at the bitcoin-0.10.X/qa/ directory - here you find (also python) code for quality assurance tests.


text:
How to calculate the size of the blockchain?
I want to find the size of the blockchain data. I've been using this Linux command:
du --exclude=index /home/me/.bitcoin/blocks/
Is this the most accurate way to do it? And does dividing the result by 1024/1024 give the size of the blockchain in GBs?

Note: The --exclude=index part excludes the blocks/index/ subfolder, which I've heard is extra metadata used for levelDB to make it faster to search through the blockchain. I just want to know the size of the blockchain data only, so does it make sense to omit this?

du rounds up file sizes to the next multiple of your filesystem's block size.  It also includes the sizes of directories.  So this will give you a (slight) overestimate.
You really just want to add up the total sizes of all the blk*.dat files.  You can get that with
du -c --apparent-size /home/me/.bitcoin/blocks/blk*.dat

You can divide this number by 1000000000 to get GB, or by 1024*1024*1024 to get GiB (note the distinction).
Note that this will still include "orphan" blocks that you downloaded and stored, but that are not part of the main block chain.  There isn't any easy way to exclude those, as far as I know.

Thanks Nate. I'm going to display the size of the blockchain on a website. In your opinion, would it make more sense to use GB or GiB?

I don't have an opinion on that.

@inersha: GiB is less ambiguous. When you write GB, especially in the context of storage capacity some might understand it as 10^9 bytes while others think you mean 2^30.


text:
What is the difference between on-chain scaling and off-chain scaling?
What is on-chain scaling and off-chain scaling?
What is the core difference between on-chain scaling and off-chain scaling?

Note, I use scaling, capacity, and scalability as follows:
Scaling: Growing the network's utility in any fashion.
Capacity: The number of payments that can be processed on the network.
Scalability: Capability of the network to handle a growing amount of work.

On-chain scaling
The term "on-chain scaling" is frequently used to exclusively refer to increasing the blockchain capacity by means of bigger blocks.
However, in the literal sense of the term, it should refer to any sort of protocol change that improves the network's capacity at the blockchain layer, including changes that facilitate production of equivalent transactions at lower cost. These approaches tend to provide at most a linear capacity increase, although some are also scalability improvements.
Examples:

Blocksize/blockweight increase
Faster blocks
The witness discount of segregated witness
More efficient new address formats
Smaller size of Schnorr signatures
Cross-input signature aggregation
Key aggregation

Off-chain scaling
The term "off-chain scaling" refers to approaches that increase the utility of the network without touching the blockchain, or by making superlinearly efficient use of the blockchain load they produce. I also include approaches that create non-equivalent transactions that result in more efficient use of blockspace.

Batching multiple payments into one transaction
Virtual payments within the system of a custodian (Tipbots, Coinbase,…)
Payment Channels/Tumblebit/Lightning Network
Sidechains
Colored Coins

Generally, off-chain solutions are scalability improvements but go hand-in-hand with a different trust model and different trade-offs. They often require additional software and complexity over on-chain scaling approaches.
For example, Lightning Network will require its users to be online to receive payments while on-chain transactions allow passive receival. On the other hand, it will easily scale the count of payments between participants, but only scale the number of participants in a limited fashion as becoming a LN user requires on-chain transactions.

Whats your reasoning for putting 'batching multiple payments into one transaction' in the off-chain section? It seems to me that it would fit better in the on-chain section. Even if a single transaction accounts for many payments in your own accounting system, there is still an on-chain payment that encompasses them all. I'm assuming you're describing a situation like an exchange batching many individual withdrawal transactions into a single on-chain transaction. Or do you mean it in the case of: 'two users kept their own tab, and then settled the tab later using a single transaction'?

@chytrik: I've put it in the off-chain section, because batching does not improve the capacity. Rather, one is creating a different form of transaction for the same payments. This is strictly more efficient use of the blockchain space at the cost of incurring higher wait times for the recipients, different privacy properties, and a caching period of payments before initiating settlement. In the on-chain section, I've only collected features that actually increase capacity or decrease size of equivalent transactions.


text:
How is a doublespend prevented in the Lightning Network?
How Lightning Network handles double-spend? What will happen when the other person is not available online to enforce the integrity of the transactions?
PFB my understanding of the Lightning Network.

Lightning Network builds an additional layer on top of the Bitcoin network that enables instant off-chain transfer of the ownership of the Bitcoin. Lightning Network utilises bi-directional payments channels that consist of multi-signature addresses.  Meaning Bitcoin will be held in a multi-signature address where transactions will use a multi-signature address as their input and point at two different addresses as their output. The transactions inside the lighting network are not broadcasted to the bitcoin network as long the channel is open (in order to reduce the load on the blockchain).

In this example how is Alice prevented from double spending?

Alice and Bob both send 0.05 BTC into a shared 2-of-2 multisig address. This requires a transaction on the Bitcoin blockchain.
Alice wants to pay 0.1 BTC to Bob.
      a. Alice creates a new transaction B2 and changes the balance to 0.4 BTC to Alice and 0.6BTC to Bob.
      b. Alice signs B2 and sends to Bob
      c. Now Bob creates a new transaction A2 and changes the balance to 0.4 BTC to Alice and 0.6BTC to Bob.
      d. Bob signs A2 and sends to Alice.
After step 2a (before Bob verifies the transaction), can Alice close the channel and double spend the money?

In your example both the transactions are identical. They have the same balances.

Thanks! Have edited the question. Need to know how LN is stopping Alice from spending the same BTC to Bob and transfer the same by closing the channel if Bob is not online ?

Which transaction is Alice broadcasting to close the channel?

can she broadcast the initial transaction balance 0.5 BTC to the blockchain & unilaterally close the channel? while Bob is unavailable to verify the transaction in the LN channel

Did Bob receive and broadcast the 'anti-cheat' transaction from Alice after she sent him B2?

No, in that case can Alice double spend her coins ?

Did Bob provide any goods or services to Alice? If so, Yes. But only because Bob hasn't followed the protocol correctly.

Thanks! In general how does the protocol enforce integrity of the transactions since its not broadcasted to the blockchain?

Alice and Bob open a channel with a fixed balance equal to the amount in the multi-sig address. The channel opens with a balance sheet which includes proof for both Alice and Bob’s balance.
Every update to the balance sheet requires action and cooperation from both Alice and Bob, so they must both be online, and each step is designed with contingencies keeping the process fair by providing leverage against an uncooperative party.
The balance book is therefore always identical for both parties. When closing a channel, if both parties sign, the channel closes cleanly. One party could close the channel by themselves, as they have a signed contingency script provided by the other party but that script includes a time lock. This gives the other party time to see, verify and contest the closing transaction by providing details of a newer balance if it exists. There won’t be one if the first party was honest because that party would not agree to partake in any more payments.
The cost of cheating is that the cheater gets 0 and the would be victim gets the whole balance. If the victim is not online for the whole time lock duration and does not contest the transaction, they can be a victim of double spend. Users should always be online and the time lock provides a contingency in case of outages or down time for justice to be served.
If need be, you can use “watchtowers” to protect you if your node is offline often.
As long as one or both party is closing the channel, the balance sheet will not change and transactions will not route through your channel, so the lightning network will never experience an imbalance or double spend off-chain.
You can experience a double spend if you are not online, but with the time lock and the penalty of forfeiting all the funds, the risk of ending up worse off is very high so although possible, this type of attack is very unlikely.

That's a great first contribution. Welcome to the site!

Based on your comments, I think one fundamental issue you're missing is that to pay with LN, the other party has to be online at the time. There's no question of "what happens if Bob is offline" because if he is offline, no payment is possible.
The other thing you need to know - especially if you meant that Bob is offline after the payment was completed - is that LN is complicated. Many transactions are involved in each payment. To get the full details you will have to read the whitepaper - https://lightning.network/lightning-network-paper.pdf.
But a main point is that as part of the process of accepting an LN payment, Bob gets a penalty transaction. If Alice ever tries to broadcast a tx representing an old channel state, thus reverting an earlier payment, Bob can broadcast his penalty tx, and take all the money in the channel (even the part that never belonged to him).
Because of this, it is recommended that Bob either stays online constantly, or delegates watchtowers to this job (which does not give the watchtowers access to Bob's money).

What stops Bob from broadcasting the penalty transaction even if Alice didn't do anything wrong?

@theferrit32: The penalty transaction spends outputs that are in Alice's old-state transactions, which shouldn't be public. Unless Alice cheats, those outputs don't exist, so the penalty tx is invalid and can't do anything.

Doublespends are not possible, because a payment on LN is only considered finalized once both payment channel owners have revoked the previous state of the payment channel by handing their partner a breach remedy that invalidates the previous state.
Thus, Bob should not hand over whatever service Alice was purchasing until the payment is finalized. Once the payment is finalized, Alice can no longer broadcast the old state without opening herself up to the penalty transaction being broadcast by Bob.

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


text:
Why do nodes trust other nodes to approve their transactions?
I know that the blockchain technology works so well, because everybody has basically a copy of the last ledger.
Therefore, if a transaction happens, everybody inside the network has to "approve" the transaction to do it.
These other participants are then seen as trusted sources.
However, what makes them into trusted sources? Let's say there are only three participants, two make a transaction and one has to decide if the transaction is acceptable or not (does the clearing). What makes him a trusted source?
Are these thoughts right or where am I wrong?
I appreciate your replies!

Can you clarify what you mean by "These other participants are then seen as trusted sources."? What do you think they're trusted to do, or to not do?

I know that the blockchain technologie works so well, because
  everybody has basically a copy of the last ledger.

Yes, every full bitcoin node has a copy of the blockchain (aka ledger).

Therefore, if a transaction happens, everybody inside the network has
  to "approve" the transaction to do it.

Correct, every transaction is propagated to all bitcoin nodes and it is validated by each one of them. Some of those nodes also do mining and they will include this transaction to a block. If they mine the block successfully (before any others mine their blocks successfully) they propagate their block to all the other bitcoin nodes which validate the block and all the transactions within. Thus, transactions are validated a second time.

These other participants are then seen as trusted sources.
However, what makes them to trusted sources. Let`s say there are only
  three participants, two make a transaction and one has to decide if
  the transaction is ok or not(does the clearing). What makes him a
  trusted source?

No one is considered a trusted source. Bitcoin enables trustless transactions. If we have 1000 bitcoin nodes in the network and user A makes a transaction that sends some coins to user B all 1000 bitcoin nodes will validate the transaction. Then, when the mined block is propagated all 1000 nodes will validate it again. Note, that users A and B may or may not run a full bitcoin node themselves.
Hopefully, that clarifies things a bit.

Thx for your great answer! What do you mean by all 1000 users will validate the transaction? How do they validate it?

@Kare, all 1000 bitcoin nodes will check that the transaction is valid according to the protocol rules set. For example, if user A tries to send 5 bitcoins to user B, it will make sure that you control the bitcoin address(es) that contain the bitcoins you are trying to sent, plus it will make sure that the bitcoins that you are trying to sent are not more than the bitcoins contained in your addresses (e.g. in case you have 2 bitcoins but trying to send 5), etc. Check the rules link above for more.

Thx for your answer! Ok I get this part. So the network basically validates the transaction. But when a block gets added to  the chain, the winner of the "lottery" basically decides, which block gets added to the chain. Can't he decide that a fraudulent problem get's added to the chain? Appreciate your  reply!

The miner that successfully mines the next block (he managed to solve a difficult problem that also requires luck; thus, winner of the "lottery") propagates his block to all other bitcoin nodes. Then all other nodes verify that the solution to the problem is correct, validate the block as we mentioned above and add this block to their local copy of the blockchain. If the winner adds another block to his copy of the blockchain he will be inconsistent with the rest of the network and soon, to simplify, ignored.

everybody inside the network has to "approve" the transaction to do it.

I think "approve" is not the best choice of words. They only check whether a transaction is valid or not, no approval is necessary.
To explain with your example with three participants:
Alice, Bob, and Charlie each have a copy of the blockchain. Alice wants to send bitcoins to Bob.
Two conditions apply:

Alice has to have sufficient bitcoins to fund the transaction.
The transaction has to have a valid signature.

When Alice broadcasts her transaction, everyone (Alice, Bob and Charlie) can check whether the money is available, because the transaction specifies which coins are being spent.
Also, everyone can check whether the signature is valid because it can only be produced by the owner of said bitcoins. Each user by themselves will immediately dismiss a transaction if the signature is invalid or when there are insufficient funds.
Next, whenever anyone mines a block, it will include a set of valid transactions to confirm them. When found, the block is broadcasted to the network. Everyone checks that the block is valid and that it only contains valid transactions. Since everyone builds the database from the same blockchain, they all end up having the same state in the database, and therefore will be in agreement which balances are available for spending.
In other words, you can trust your own copy of the blockchain, because you checked every piece of it for validity. However, others may not. Yet, nobody else has to trust your copy of the blockchain, because you can send them the pieces so they can build their own and check the work themselves.

Thx for your reply! Is there a flow chart out there, which describes this process?

@Murch what you are saying is correct although the UTXO will confuse a user that is just starting learning. I want to rephrase your conclusion however (I know what you mean but I just feel it might confuse):  what you trust is the algorithmic execution of the bitcoin protocol that ensures there is consensus between the majority of the blockchain "copies". You can trust your own blockchain but the rest of the network might not.

@Kare: Check this out: http://spectrum.ieee.org/image/MjA3NDM1OA

@karask: Thanks for the feedback, how is that?

First of all you need to understand that the use of Bitcoin is not controlled by anyone at all, therefor there is no way to check the integrity of anyone using the Bitcoin technology.
With that in mind one should always be cautious when making transactions.
People who make a lot of transactions succesfully are considered trustworthy (technically) but there is always a chance this will change.
It's actually the same as in real life, like when you mail-order something you rely on trust. The more people order from the same company the higher the trust will be but as with Bitcoin, that trust can be broken for many reasons.
The time we live in is truly a sick period in mankind's history. So many people try to scam each other any which way they can including governments, banks etc.
So in short : you can not trust anyone 100%, so forget about trust and be cautious when sending large amounts of bitcoins. If you need to make a big transaction to someone you don't know you should try and find some transaction history of that person. You could check the blockchain info for that persons transactions to get a more accurate estimate on how trustworthy that person might be.
I hope this answer clarified your questions.

Whether more transactions make someone more trustworthy is quite debatable. The cryptographic literature on decentralized trust is quite limited and such intuitive claims do not seem to be backed by reality; for example, refer to the bitcoin-otc case of a repeatedly good-transacting individual who abandoned ship after years of good trade.

-1 This answer seems to be referring to trust in exchange relationships where people trade cryptocurrency for other valuables. It completely misses the point of the question.


text:
Why does the "global lottery" prove the validity of the blockchain?
As far as I understand it currently, when winning the "lottery" (mining) you can add a block, sum of transactions, to the blockchain. This block is in the first instance verified by all network users.
BUT can`t a lottery winner also add a fraudulent block to the chain?

What does this lottery contribute to the validity of the chain?
Or in other words: How are miners approving a bitcoin transaction, besides adding it to the blockchain when they win? Potentially, they could also add a lot of "sh**" to the blockchain.

Miners do not prove validity. They solve the problem of needing to decide between two potentially conflicting but otherwise valid versions of history.
The rule that full nodes follows is that they accept the longest valid block chain, where valid is defined by the network's consensus rules, and long is defined as having more mining work performed. If a miner produces a block that is invalid according to those rules (for example, it spends a coin without valid signature), full nodes will ignore the block and any block built on top.
There are also lightweight nodes ("SPV nodes") which do not verify validity at all, and will accept whatever block chain has most work. Their security however relies on the fact that blocks are expensive to produce, so a miner wouldn't create one that isn't accepted by full nodes.

Does the above concept work also in distributed ledgers? Where you have  several network participants with different ledgers?

@Kare: In the above concept, several network participants have their own ledgers, but they will (most of the time) arrive at the same state.

BUT can`t a lottery winner also add a fraudulent block to the chain? What does this lottery contribute to the validity of the chain?

No. If the block is invalid, it's ignored by everyone.
The "lottery" only determines which chain of all fully valid blocks is the right one. For example, say I have 1 bitcoin and I sign two transactions, one sending that bitcoin to Alice and one sending that bitcoin to Bob. Both those transactions in the same chain would be invalid. But you can imagine two chains -- one with the transaction to Alice and one with the transaction to Bob. Both are valid, which is right. That's what the mining lottery is for. It solves the "double spend" problem without a central authority to arbitrate.

Or in the other way: How are miners approving a bitcoin transaction, besides adding it to the blockchain when they win? Potentially, they could also add a lot of "sh**" to the blockchain.

The same way everyone else does. If they add a transaction other people won't consider valid, then their block will be ignored and they will have wasted the effort they spent mining it.
Blocks that don't pass all the requirements for validity, including checking every transaction in them, are totally ignored. Honest clients will never relay them to other clients or consider them part of the valid block chain.
Every participating Bitcoin full node can verify every single transaction in every single block.

the answer is simple.  if miner puts shit into the block, the next miners would ignore the incorrect block. the original miner looses the reward.
mining without reciving reward is pointless, the miner would be just wasting power


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

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


text:
How do I get bitcoin price without any external source?
I have searched the Internet for solution but could not find the one I was looking for.
I want to get bitcoin price (in usd) without using any external website (meaning not getting the price using api or something)
I want to "calculate" it myself, since there are websites who display their bitcoin price and it's slightly different from other websites I guess they found the price from their own.
How can I find the bitcoin price by myself?

The bitcoin price is determined by a free market of buyers and sellers. There is no way to calculate the price on your own without an external source. I suppose the only exception to this would be if you ran your own bitcoin exchange and you had enough users and volume to produce a fair market price.

If the bitcoin is working in a way that I can see all the transactions isn't there a way I can determine the price based on them?

@user3495259 You can see the bitcoin transactions in the blockchain. You cannot see the corresponding dollar transactions in the blockchain. If you see 1 BTC being transacted, you have no idea what the sender got in return.

I do not agree with @immibis, because when bitcoin has started, it was 1btc=1$, which means that there is away to determine the price of the bitcoin from the blockchain, especially that bitcoin is decentralized and inflation free, so it should never be determined by an external source. If an external source should determine the bitcoin's price, we should only take in consideration the inflation and add it to the price retrieved from the block chain.

@AlanDeep I can't make any sense of your comment. I don't think you understand how prices work.

You may be thinking with cause and effect reversed. The Bitcoin price being $300 does not cause people to buy and sell at $300. Rather, people buying and selling at $300 causes the price to be $300.
Obviously, there is no way to find out what price people buy and sell bitcoins at without buying or selling bitcoins, or asking someone else who's buying or selling bitcoins, or asking an exchange that bitcoins get bought and sold through.

The year is now 2023, and there has been a proliferation of cryptocurrencies. You still need to ask a crypto exchange. You still can't see the dollar transactions whenever someone trades a bitcoin, on the bitcoin blockchain, so you don't know what they paid for the bitcoin.
But if you're willing to look at a different blockchain, you may ask a decentralized, blockchain-based crypto exchange, for example, the Uniswap V3 WBTC-USDC pool on Ethereum. As long as WBTC is still exchangeable for BTC, and USDC is still exchangeable for dollars, and Uniswap V3 is still a protocol that people use, you can assume this is the price people trade bitcoins for dollars on this platform. (If it very different from the bitcoin price, then someone would trade it and make free money. That's why there's only one price.)
You don't have to read it from the info.uniswap.org website - after getting familiar with Ethereum, you could read it from the blockchain. The information is still invisible to the Bitcoin blockchain, but since the Ethereum blockchain is working as a crypto exchange, the information about its trades is available on that blockchain.


text:
Should I include the fee in the sent bitcoin amount?
I'm using Electrum and want to purchase something with Bitcoins. When I get to the bitpay screen with all the details (And the timer) I input the information into the electrum client, which then generates a Fee for the transaction.
My question is: I need to send an exact amount, will the fee take the amount straight out of the amount being sent (And therefore send too low an amount) or do I need to add the fee to the amount being sent?
i.e Let's say the site requests exactly 0.05 bitcoins, fee is 0.02. Do I send 0.07 and let it take the fee, or do I send 0.05 and it takes the fee out of the wallet another way?
Thanks.

The fee is going to be separate from the amount.
Using your exmaple:
If you need to send bitpay 0.05 btc, you enter 0.05 for the amount field and 0.02 for the fee field. Do not send bitpay 0.07 btc
If you specify a fee of 0.02 btc and you only have 0.06 btc combined in all of your addresses, electrum will alert you that you don't have enough.
Please note that the fee is something that you decide you want to include. It is not a fixed value, but there is a minimum if you want to get your transaction included into a block in a reasonable amount of time. Looking at the current block, 402557, transaction fees look like they are around 0.001 btc. The fee can depend on a couple of things like age of coins, size of transaction, and/or how fast you want your transaction included. You may also want to increase the fee since more and more blocks are reaching the size limit and miners will favor a more profitable transaction.

The transaction fees are just a way to indicate to the miner that this transaction is important and needs to be verified ASAP. The higher the fees the faster it is verified.
In your case, you only need to specify the value to pay and the fees if needed (generally there is a default amount of 0.0001 that is used). These transaction fees are not paid to the other person's wallet, neither is iit given to any payment gateway, it stays with the transaction for the miner to claim but still gets cut from your wallet. The amount of fees you want to add is completely upto you.
Please make sure that if you are using a previous transaction that has a higher amount paid to you (eg. you were paid 1BTC and you need to give 0.5 away), you have a return address for the remaining bitcoins (0.5BTC) to come back to your wallet else it may all go as transaction fees.


text:
Shared Coin in BlockChain new wallet?
How can I send Shared Coins using BlockChain new wallet?!
I can't find that option in the new wallet!

Hi Sh Sh, what are "Shared Coins"? Please add more details, because I don't know what you're referring to.

You cannot. That feature has been was "temporarily" cancelled due to numerous reports of stuck transactions and growing awareness of its privacy limitations:
https://blog.blockchain.com/2014/03/17/shared-coin-suspended-temporarily/
http://www.coindesk.com/blockchains-sharedcoin-users-can-identified-says-security-expert/
I dont think the previous version of SharedCoin is ever coming back because its GitHub page is now gone:
https://github.com/blockchain/Sharedcoin

authors: تارویردی لته جان


text:
How To Calculate Merkle Root?
I found this example:

Current merkle hash list:
  32650049a0418e4380db0af81788635d8b65424d397170b8499cdc28c4d27006
  30861db96905c8dc8b99398ca1cd5bd5b84ac3264a4e1b3e65afa1bcee7540c4
Current merkle hash list:
  d47780c084bad3830bcdaf6eace035e4c6cbf646d103795d22104fb105014ba3

I have tried to calculate the hash using PHP:
$tx1="32650049a0418e4380db0af81788635d8b65424d397170b8499cdc28c4d27006";
$tx2="30861db96905c8dc8b99398ca1cd5bd5b84ac3264a4e1b3e65afa1bcee7540c4";
$v=hash('sha256', hash('sha256',$tx1.$tx2) );

But I got:
2b5f377b4adab64f489a2f73605ffb448b8add5b708d218729f9dfc58f1f5fe2
What is wrong?

you should hash the binary data, not the human-readable hexadecimal representation

@amaclin Sounds like that should be an answer, not just a comment

This is the correct way to double hash two tx's.
First you need to convert them into little endian, and then convert into raw binary data before hashing.
<?php

function le_raw ($str) {
    return pack("H*", join("", array_reverse(str_split($str, 2))) );
    // return map { pack "H*", join "", reverse /(..)/g } @_;
}
function be_hex ($raw) {
    return join("", array_reverse(str_split( unpack("H*", $raw)[1], 2)));
    // return map { join "", reverse unpack("H*", $_) =~ /(..)/g } @_;
}

$tx1 = le_raw("32650049a0418e4380db0af81788635d8b65424d397170b8499cdc28c4d27006");
$tx2 = le_raw("30861db96905c8dc8b99398ca1cd5bd5b84ac3264a4e1b3e65afa1bcee7540c4");
$v = hash('sha256', hash('sha256', $tx1.$tx2, true), true );

echo be_hex($v), "\n";

output
d47780c084bad3830bcdaf6eace035e4c6cbf646d103795d22104fb105014ba3

Also, take a note of third param to hash(); https://www.php.net/manual/en/function.hash.php


text:
Can I rely on multisignature addresses being future proof?
I am afraid to store my bitcoin in a multisig address.
In the future, if the Bitcoin protocol is updated, could there be any problems with multisig addresses? Are they safe to store bitcoin in for long term investments?
Is there any chance to lose my Bitcoin stored in a multibit address due to Bitcoin system updates/upgrades?

Multisig transaction types use standard CHECKMULTISIG opcodes (which have been present in Bitcoin since its initial release in January 2009) and P2SH addresses (standardized in BIP13 in October 2011). Both are very commonplace nowadays.
Consensus changes sometimes happen in Bitcoin, to add features or improve security. However, to the best of my knowledge, valid useful scripts have never been invalidated by such changes, nor do I expect such a thing to ever happen. Loss of money caused by a protocol change should and likely would cause an outrage.


text:
Pruning is not working anymore on Bitcoin Core 27.1.0
My situation
du -sh .bitcoin/
14G .bitcoin/

I enabled pruning with a limit of 6 GB
bitcoin-qt -prune=6000

I wait, but it’s still 14G
du -sh .bitcoin/
14G .bitcoin/

Even after I close, edit .bitcoin/bitcoin.conf to put
prune=6000

and then restart bitcoin-qt, it still shows 14G occupied space.
Why?
System is: Slackware 15.0
Bitcoin version is : 27.1.0

The size of "ldb" files is various
du -shc .bitcoin/chainstate/*

....

436K    .bitcoin/chainstate/3482775.ldb
524K    .bitcoin/chainstate/3482776.ldb
956K    .bitcoin/chainstate/3482777.ldb
564K    .bitcoin/chainstate/3482778.ldb
456K    .bitcoin/chainstate/3482779.ldb
908K    .bitcoin/chainstate/3482780.ldb
224K    .bitcoin/chainstate/3482781.ldb
64K .bitcoin/chainstate/3482782.ldb
60K .bitcoin/chainstate/3482783.ldb
1,1M    .bitcoin/chainstate/3482784.ldb
1,2M    .bitcoin/chainstate/3482785.ldb
2,1M    .bitcoin/chainstate/3482786.ldb
2,1M    .bitcoin/chainstate/3482787.ldb
13G total

Pruning controls the size the blockchain data itself is kept at, by deleting old blocks after validation.
Bitcoin Core however uses many other files to operate. Most of these are small, but some can have significant size:

The chainstate (UTXO set database), which tends to be 10+ GB for mainnet these days.
Blockchain indexes (optional) like the transaction index, compact block filters, statistics, ...
The mempool backup on disk (~100 MB, typically).
Wallet files (which may be big if they contain many addresses and/or many transactions).
Various other files, that typically don't exceed a few MB in size.

All these other files add on top of the part of the blockchain data that remains after pruning.
Nothing has changed in this regard for many versions of Bitcoin Core, though the UTXO set size has grown over time, making the difference with the configured prune size more apparently, especially when the prune setting is small.


text:
Can Armory be used for mining?
Can Armory be used for mining?
I hear it is a wallet, but as it downloads the whole blockchain anyway should not you be able to mine with it, too?

Armory uses Bitcoin Core to download blocks and other basic functionality. Bitcoin Core is what is normally used for mining so that's what you'd be using. Armory does not add anything useful for mining. When you mine you can send the mining income to an Armory wallet without Armory taking part in the mining process.