Why is the transaction priority removed? As far as I know, in the earlier version of Bitcoin, there was a mechanism about transaction priorities. However, it has been removed (or not being taken into account anymore) and now the only criterion to be selected for confirmation is the fee.

Can anyone explain, what the reason was behind this design decision? Shortly, why?

Firstly, the priority mechanism was not a consensus rule. Originally it was just a few hundred kilobytes of space reserved in a block (100 kb IIRC) for transactions that had a high priority. But this was not a consensus rule; it does not have to exist. After blocks started getting full, many miners, out of the interest of getting as much income as possible, chose to stop reserving this space for priority. There is more money to be made by choosing a few hundred transactions that paid more fees than it was to choose a few hundred transactions that didn't but had priority. Since no one miner was actually using priority, Bitcoin Core removed priority from its fee and confirmation estimations so that the given values would be more realistic and the code would be simpler.

The following pull requests and the issues linked within them contain some of the discussions that the Core devs had when removing priority: https://github.com/bitcoin/bitcoin/pull/9602, https://github.com/bitcoin/bitcoin/pull/7022, https://github.com/bitcoin/bitcoin/pull/7008.


Do I have to save my private keys? Is it a good idea to take my private key from my wallet and save them? Because I read it is not save to make your wallet shows your private keys. (It guess I do not understand that well).

Edit: Are they different than seeds? the words-phrase that wallet gives?

And how can I use the private keys to restore my coins in case for example, my wallet company stopped working?

Yes indeed you should back up your wallet, printing out a paper copy of your private keys is a good way to do this because paper can only be accessed physically rather than being hacked via the internet. Obviously it's not safe to store them unencrypted on the cloud or something. The security warnings are there just to make sure you don't do anything stupid with them, to make you double check before potentially giving others access to them.

Bitcoin Core for example allows you to import private keys to restore a backup. If you print them out as QR codes, many wallets allow you to sweep them


Why does the chart on a coin vary between exchanges? Look at the BCH chart for instance, the 8 november there is a wild selloff following the cancelation of the new scaling protocol for bitcoin. This has nothign to do with BCH but causes a selloff nevertheless, on big volume with  a long deep red candle. This is on Bitfinex. Then look atr the same
chart at Kraken. No long deep red candle, no selloff.

So I guess either the chart was edited (manipulated) afterwards, or no Kraken customers sold any BCH outside that range on the chart?

There is no central market for the bitcoin or other altcoins.

Crypto currencies are exchanged on each exchange for the price set by people transacting there. This means that the price is set exchange by exchange, not centrally for every coin.

Thus the variance of the graphs.

Cheers, David


How to get correct block details url with block height on blockchain.info I need to generate urls to block details page of blockchain.info when I have block height as input but cant find the relationship between block height and the number they are using in the url.

Eg: For block 273294 the url is https://blockchain.info/block-index/335666 which contains the number 335666 instead of 273294. So how to convert 273294 to 335666.

Any help in conversion is appreciated.
Regards

It seems to me that Blockchain.info just increments the id of blocks whenever it sees a new one. If that is the case, the id of a block on Blockchain.info would just be an arbitrary number and the only relation that it has to the block height would be id ≥ height.

This is so, because it is possible that more than one successor to a block is found at roughly the same time. If that happens all successors (usually not more than two) will have the same block height, and are competitors to build the chain with the most accumulated work, "the longest" or main chain. This conflict will be resolved, when one chain gains another successor, pulling ahead of its competitors.
However, Blockchain.info will still store the detached blocks, allowing the id to grow quicker than the block height.

Apparently, Blockchain.info gives an overview of blocks at the same height under the URL https://blockchain.info/block-height/<height>. There it lists the hash of the main chain block, which you could use to lookup the id.


What are the ways to create an offline Ripple wallet? Do I have to download/compile my own version of the client? Is there a difference between the Ripple and Bitcoin wallet address creation methods, or can I use, say brainwallet, also for Ripple?

Note: even if it is not correct, I use terms wallet and address interchangeably. I assume that wallet is just a (possibly encrypted) container of addresses and corresponding public/private keys.

There are two components of making a Ripple wallet offline:

The blob vault
This is what stores the private key that controls your wallet. Other people can try to guess your username/password over the network, and if the blob vault isn't trustworthy, then it can do a much faster attack against it.
Install instructions: There is an install script included (serversetup.sh), but it will only work on Debian-based systems. You can get it to work on others by installing node, npm, and mysql server. Be aware that you also need to edit the script and replace PASSWORD with your actual mysql root password.
The ripple client itself
Copy it to a local webserver, and point your brower at it.

Be aware that you need to be online to see the balance of your Ripple wallet.


Is there a PoW system that shows cumulative work without an ever-increasing proof size? Let's say I have an output in the blockchain at height 100,000. At height 200,000, I want to prove that my output has the work of 100k blocks built onto it, securing it. In Bitcoin, proving that the output has X number of hashes securing it requires providing the full chain of headers, or 80 bytes * 100,000.

Is there an alternative proof of work where these 'work-proofs' do not grow in size indefinitely?

EDIT:

Now that I have found some resources, the terminology for I was looking for is "compact SPV proofs".

There's a suggested change to Bitcoin (adding skiplists to the header) that would make that quite possible. See Appendix B of Blockstream's sidechains paper,  Efficient SPV Proofs:

  The inspiration for compact SPV proofs is the skiplist [Pug90], a probabilistic
  data structure which provides log-complexity search without requiring rebalancing (which is good
  because an append-only structure such as a blockchain cannot be rebalanced).
  We require a change to Bitcoin so that rather than each blockheader committing only to the
  header before it, it commits to every one of its ancestors. These commitments can be stored
   in a Merkle tree for space efficiency: by including only a root hash in each block, we obtain a
  commitment to every element in the tree. Second, when extracting SPV proofs, provers are allowed
  to use these commitments to jump back to a block more than one link back in the chain, provided the
  work actually proven by the header exceeds the total target work proven by only following direct
  predecessor links. The result is a short DMMS which proves just as much work as the original
  blockchain.

  [...]

  Therefore if we want to skip the entire remaining chain in one jump, we expect to search only
  halfway; by the same argument we expect to skip this half after only a quarter, this quarter after
  only an eighth, and so on. The result is that the expected total proof length is logarithmic in the
  original length of the chain.
  For a million-block chain, the expected proof size for the entire chain is only log2(1000000) ≈ 20
  headers. This brings the DMMS size down into the tens-of-kilobytes range.

Also see Mark Friedenbach's Email on the bitcoin-dev mailing list concerning compact SPV proofs: http://sourceforge.net/p/bitcoin/mailman/message/32111357/


How does having a large mempool and allowing a greater transaction ancestry set change the interaction with your peers? Bitcoin Core by default allows up to 300 MiB of mempool data, and restricts unconfirmed transaction trees to an ancestry set of at most 25 transactions and 101 kvB of transaction data. Since these are config values, you can obviously use other values than these. How does this change your node's interaction with its peers? Do peers send data that exceeds your node's preferences and your node drops that data upon arrival or does your node inform its peers what to send? Is this the same for mempool data generally and unconfirmed chains specifically? If you allow more data via higher values, does your node forward previously unacceptable data to its peers once their backlog clears enough for the data to be accepted by them?

How does this change your node's interaction with its peers? Do peers send data that exceeds your node's preferences and your node drops that data upon arrival or does your node inform its peers what to send?

The protocol supports a fee filtering command, simply, only relay transactions which meet a specific feerate and nothing below. This prevents pointless relaying of transactions which would result in immediate eviction from the memool.

  If you allow more data via higher values, does your node forward previously unacceptable data to its peers once their backlog clears enough for the data to be accepted by them?

No. Wallets in Bitcoin are expected to re-send transactions periodically if they have not been confirmed. If they will successfully relay at a later date with less mempool pressure, re-broadcasting it would be required.


How does a new node know where to connect to initially? Is there a default (centralized) set of IPs that a node connects to when it's just starting up for the first time, in order to get the list of other nodes' Ips? What happens if these initial IPs are down, blocked or banned?

There are a number of DNS seeds hard coded into the Bitcoin client.

It's not really possible for these to be banned. The way DNS seeds work is by returning multiple A records for the DNS seed hostname, with each A record belonging to a node. In essence, they act as name servers, and use the existing DNS specification to provide nodes with the information.

It is possible for a network to tamper with these responses, or prevent the DNS lookup to begin with. In such a case, one could manually use the addnode option in Bitcoin.conf to connect to one or more peers directly. Once you are connected to a few peers, they will share their peer list with you, and you can connect to the other peers on the list, and get additional peers from them, and so on and so forth.


How to get the first block of bitcoin? I put together a small fork, and I want to extract the first block of bitcoin.

At the moment I can't, and can't understand why, maybe I forgot something to disable or change.

Here is a link to the fork with a modified Genesis blocks.
I pointed out a time in the future

How to get the first block of bitcoin?

take blk0000.dat
skip first 8 bytes
take 285 bytes

that's all, folks!


What is the point of "Bitcoin Lightning" and "Bitcoin Liquid"? Even having been "into" Bitcoin since almost since the start, I constantly find new weird things mentioned which are just apparently taken for granted and exist suddenly and somehow have tons of support and users.
Today I learned about the existence of "Bitcoin Liquid". I had not heard of it ever until today (2021-01-21). Apparently, it's the same thing as "Bitcoin Lightning", in that it's not a separate "altcoin", but somehow "attached to" Bitcoin yet not using the Bitcoin blockchain. This makes no sense to me.
I do know that "Lightning" was touted as a solution when the Bitcoin network was all clogged up with waiting times for transactions a few years ago, but since then, I've not heard one peep of it. Never heard it mentioned at all. I assumed that it was dead. But apparently it still exists, and now "Liquid" also exists. Are they competing against each other?
I find it utterly impossible to figure anything out by reading their official websites, because they always use bombastic wording and list how many groups support them and they are the future and blablabla... Useless information. I want to know neutral, real information. I can't find it anywhere.
What exactly are "Bitcoin Lightning" and "Bitcoin Liquid"? Why do they exist? Why aren't these "BIP"s put into Bitcoin itself? How can they be attached to Bitcoin yet be separate? Is one of them objectively better than the other? Do they solve different problems? Is one of them dead now? Should I be using/bothering with them? Are they an attempt to take over Bitcoin slowly by not being an "altcoin" upfront, but slowly turning away from Bitcoin?
I swear, I could probably sit there and spend my entire life doing nothing but trying to read up on Bitcoin-related stuff and still never have any clue what's going on. It seems like not one day passes without some "revolutionary" and "fantastic" new invention which seems to be little more than a slick website with nonsensical sales talk on it.
I'm looking to get a grasp of the state of Bitcoin and its development. I have no idea how these weird "sidechains" fit into that or why I should pay any attention to them. Maybe it's the best thing ever and makes perfect sense?

The lightning-network (LN) is an instant payment system built on top of Bitcoin. Its relationship to Bitcoin is akin to that of Visa card payments and the US banking system. The LN is a convenient and efficient way to pay directly from one user to another, especially for smaller amounts. Under the hood, the Lightning Network works by spanning payment channels between users and providing cryptographic guarantees to prevent abuse. Compared to on-chain payments, the LN trades off different privacy properties, lower transactions fees, and manifold increased transaction throughput with different security assumptions and the opportunity-cost of staging funds in payment channels.
The liquid sidechain is an alternative blockchain protocol whose native currency is "Liquid Bitcoin" (L-BTC). Users may convert Bitcoin to L-BTC 1:1 by paying into the custody of the federated peg or withdraw BTC by returning L-BTC back to the peg on Liquid. The Liquid sidechain operates with different consensus rules that give it better privacy (via confidential-transactions), greater throughput, and the ability to issue other assets. This comes at the cost of trusting that the majority of the Federation remains honest. Being closely related to Bitcoin, Liquid has its own Lightning Network.
LN and Liquid are sufficiently separate from Bitcoin's protocol development that they are not covered by the Bitcoin Improvement Proposal process even though LN is widely considered to be part of Bitcoin, while Liquid is more distinct. LN and Liquid solve different problems and are optional.


getrawtransaction doesn't work for every transaction with -txindex=1? i put txindex=1 in bitcoin config and reindex blockchain after that when i call getrawtransaction for some transactions didn't exist in my wallet and work well like:

[Working]

getrawtransaction d2632db404d0cdff861278f369b8dfc09a8e84e9af76558dcc6457909544cf1e 1

but with this transtions didn't work why ?

[Not Working]

getrawtransaction 37e3abcbfc9b2b984fb34e2605d512614a4a2a507fe50fb4b639c08d29137f34 1

getrawtransaction 7bdaefdd1819440fdd988538ad59ef0d9a5a899b4db7446bfea5dee3d88dfb1b 1

It would appear that when you asked the question the transaction had not been confirmed. They have since been confirmed and they will show up now.


Does asic API exists? I have an antminer asic, and it has web interface. I could see temperature and hashrate through it.

Now i want to retrieve and store that data (from multiple asics), within another program on another device. Obvious but inefficient way is to send HTTP request and parse HTML responses.

But does asic has some way (for example JSON output via some GET/POST requests, or even custom TCP protocol) to get information in machine-friendly format?

How do such aggregated statistics monitoring and control usually implemented in big farms? Is there any existing software for solving this obvious control/monitoring task?

Most Antminers have a WebSocket API that connects to the built in CGMiner software on port 4028.

You can test this in a command prompt in Windows, Mac, or Linux with (nc is a program called netcat which you may need to install):

echo -n "stats" | nc IP_OF_MINER_GOES_HERE 4028

There may also be a way to do this with CURL instead of netcat, but I have not had a chance to test it yet.

Code Examples:

  api-example.php - a php script to access the API   usAge: php
  api-example.php command  by default it sends a 'summary' request to
  the miner at 127.0.0.1:4028  If you specify a command it will send
  that request instead  You must modify the line "$socket =
  getsock('127.0.0.1', 4028);" at the  beginning of "function
  request($cmd)" to change where it looks for cgminer

  api-example.rb - a Ruby script to access the API.  usage: ruby
  api-example.rb command[:parameter] [HOST [PORT]] This script prints
  the parsed cgminer API response

  API.java/API.class  a java program to access the API (with source
  code)   usAge is: java API command address port  Any missing or blank
  parameters are replaced as if you entered:   java API summary
  127.0.0.1 4028

  api-example.c - a 'C' program to access the API (with source code)
  usAge: api-example [command [ip/host [port]]]  again, as above,
  missing or blank parameters are replaced as if you entered:
  api-example summary 127.0.0.1 4028

Java Example

C Example

PHP Example

Python Example

Ruby Example

I've built a small script for my personal miners which will not work for most environments (due to reliance on data from SlushPool), but it may be useful for some code snippets (C#): Here


How can I use the Litecoin testnet? Is there any Litecoin testnet explorer which records Litecoin testnet transactions? Where can a Litecoin testnet wallet be downloaded? Any reference or step by step explanation would be much appreciated.

Download Litecoin Core, install it,  and start it with the -testnet option.

I'm aware of two Litecoin testnet explorers:

http://testnet.litecointools.com/
https://chain.so/testnet/ltc


Submitt transaction with custome fee I like to doing to submit every new transaction with user specific fee. I don't see any valid documentation for achieve it using RPC call. Give any suggestion.

Thankyou

Every transaction references input UTXOs (also called VOUTs) as VINs and outputs bitcoins to certain addresses. The input value, in bitcoins, is summed up. This sum is the maximum amount that can be allocated to outputs, but does not need to (and usually is not) what is completely allocated to outputs.

Usually, the sum of outputs is slightly less than the sum of inputs. In Bitcoin, the difference between these two is paid to the coinbase address of the block that the transaction is included in.

Most likely, your client uses the "change address" paradigm. From your HD wallet, a new key pair and address are derived. This new address serves as a change address. You specify how much bitcoins you want to spend to an output(s), the remaining amount is then calculated from the subtraction of all the specified output amounts. This remaining amount is then subtracted further, using a fee estimate. The final value is paid to that change address, which you control. The fee estimate then becomes what is paid to the miner. All of these operations are automated by your wallet client, so you normally don't need to fiddle with these change addresses. However, it can be customized.

Following this logic, all you need to do to customize your fee is to increase/decrease the number of bitcoins sent to your change address. The higher the number, the smaller the fee, and vice versa. After calculating all these parameters, you can then create a custom transaction, serialize it (createrawtransaction), sign it (signrawtransaction), and broadcast it.


HELP ME WITH BITCOIN TIME STAMPS OK, so I had several backed up .dat files on google which I put in opentimestamps
I could see that these files had time stamp data...   so I uploaded and *****below is what the results were.
What does all this mean?
I just want the bitcoins that I know I have.  I had a wallet.dat from a gui miner I downloded on my pc in 2012.  This has been a nightmare.  I am willing to offer a % of the BTC to anyone who can actually help me.  And no python...  That just has frustrated me beyond my limits.  I have over 50k private keys even more addresses.  My Bitcoin Core Wallet was on my pc since 2012.  I have not run a full node and have since lost access to that pc as it crashed.  I have all the backups...  anyhow..  my question (sense the frustration yet?)
****** What do I do with this? Please use as much lamen terms as possible.  Talk to me as if I am in intro to bitcoin in the 5th grade...
Timestamp of d800xxxxxxx7
Document digest (SHA256): d80XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx6
Download this timestamp
Return to upload page
d800XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxb6 SHA256(Document)
d800aXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxef
Append(a4a414...)
92bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxa
SHA256()
Fork into 3 paths
Fork
1 92bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx9
Append(dbf1cf...)
1 f2d4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
SHA256()
1 5f030XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
Prepend(5f0304...)
1 5f03XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx4a
Append(1360d4...)
1 Pending attestation: server https://alice.btc.calendar.opentimestamps.org
Attestation
2 92XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx355
Append(e229a8...)
2 9f8XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SHA256()
2 6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXcecdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX62
Prepend(625692...)
2 c00XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX44
SHA256()
2 5f0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX44
Prepend(5f0304...)
2 5fXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX32
Append(9dd925...)
2 Pending attestation: server https://bob.btc.calendar.opentimestamps.org
Attestation
3 92bXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Append(270839...)
3 2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXf
SHA256()
3 3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX6e34aXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX68f
Prepend(3016ec...)
3 1ebeXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SHA256()
3 5f0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxc41
Prepend(5f0304...)
3 5f03XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx16
Append(326fc5...)
3 Pending attestation: server https://finney.calendar.eternitywall.com
Attestation

OK, so I had several backed up .dat files on google which I put in opentimestamps

Bitcoin core stores wallet data ina file named wallet.dat so that was one of your .dat files.
Opentimestamps is just a service that provides proof that a document existed on a specific date. It doesn't store the contents of the documents.
You therefore have proof that your wallet.dat existed but that is of no use to you.

I just want the bitcoins that I know I have. I had a wallet.dat

You need to find either

that wallet.dat and any password you used to protect it
or a written copy of the "private key" that the wallet contained.

Otherwise all the money that was in that wallet is forever lost and unusable.


Defense from Government Intervention What's to stop a government, say the U.S. government, from saying "Hey, it's okay if you want to use Bitcoins, but you have to use at least version 0.6.3".

And then a year later changing the law to "Hey, it's okay if you want to use Bitcoins, but we're going to make sure you're using the most up to date version of the Bitcoin client through the XYZ Act."

Then another year, a new bill: "Hey, you love Bitcoins, right?  How about this new bill that 'improves' security by requiring any Bitcoin clients to include features ABC."

Yet another year goes by and: "Woah, hey, we can't let you use a non-licensed bitcoin client, that wouldn't be very responsible!  Make sure you use one of the clients on this list!"

365 days later: "Hey man, how are you liking your Bitcoins?  Oh, great, well, we just wanted to let you know we're going to put out a client of our own.  Oh no, no major differences, we just want to make it more secure.  You can still use 3rd party clients, this just gives you more choices! GO USA!"

Another year goes by and Bitcoin is in large use by PayPal, Amazon, Ebay, NewEgg and thousands of other big name companies as well as millions of small-time mom-and-pop sites.  The government regulation and licensing requirements continue to develop and change the nature of the Bitcoin algorithm and blockchain (having the innumerable thousands of businesses using government licensed clients allows a higher than 51% control over the algorithm and blockchain rules).

Pretty soon the government dictates new code and rules that allows the easy creation of new coins by government machines.  It could also allow the insertion of a tax that strips a very small percentage away from each transaction that is sent to a central government address.  It could introduce anti-privacy changes to track geographical location or IP addresses attributed to each transaction and address.

My question is, what can we or the developers do to stop the slow year-by-year encroachment of seemingly "harmless, even helpful" laws and regulations?

If Bitcoin ever seems legitimate to Big Business and is used on very common basis, many business will gladly give in to government demands to use regulated clients if the law says they must.  A large scale switch to a government corrupted client could gain a greater than 51% control over the Bitcoin network.  All the government needs to do is wait for those willing to acquiesce to its demands to grow to more than 51%.

What can be done to prevent this?

The scenario you name would be great for cryptocurrencies as it would make them mainstream. As soon as people got sick of govt intervention with Bitcoin in such a scenario, it would probably be relatively easy to get enormous numbers of people to switch over to a very similar (but independent) Altcoin.

The nature of the cryptocurrency technology is such that it is very difficult to stop people running the software, but a govt could have success in closing down businesses that accept unofficial versions such as the fictional Altcoin. If that happened, it could however still thrive outside of the region being regulated.

Prevention would probably need to occur at a political level, but I'd hope market forces as I've just described will be sufficient prevention as long as no organisation gains too much power over international law. Agreements negotiated in secret like the TPPA are something to watch out for though.


Litecoin explorer that accepts M-prefixed segwit addresses? Just realized that the litecoin explorer I was using (blockcypher) doesn't allow me to input M-prefixed segwit addresses (more info).

Any other litecoin explorer that can do this?

Seems this explorer works fine:

https://chainz.cryptoid.info/ltc


How do you know that your private key has been stolen? How do I know whether my private key has been stolen?

If your private key was stolen, then the thief can provide you with definitive proof that he possesses the key---for example, by spending your funds.

But unless you have such proof, all you can do is guess whether your private key has been stolen.  There's no definitive way to prove that your key hasn't been stolen.

Usually, if you have enough evidence to worry that your key has been stolen, it's a good idea to take the steps you would take if you knew it was stolen.  For example, generate a new safe private key and address, and use your old private key to send funds to the new safe address.  That way your money is safe whether or not your old private key was stolen.


I have over 10,000 shares accepted. How can I find out how much bitcoin that is? I have over 10,000 shares accepted.  How does that translate to bitcoin?  How much bitcoin is 10,000 shares?  It says it will transfer to my wallet when I get .01 bitcoin.  But so far, nothing in my wallet.

The value of a difficulty one share is roughly the block reward divided by the difficulty. Right now, the block reward is 25 and the difficulty is 11,756,551,916. So 10,000 shares (assuming they're difficulty one Bitcoin shares) is worth about 0.000021 BTC.


Issues when creating Bitcoin Cash wallet I created a Bitcoin cash wallet on https://bcc-wallet.btc.com, entered the Bitcoin Cash address into Coinbase to transfer my BTC, and Coinbase shows the transaction as successful, but I am not seeing it in my BCC wallet. Could you guys please throw some light on it? Any help will be highly appreciated.

Probably you should retrieve the extended private key (or use the pass phrase you have remembered) from when you created the online wallet and create a new BTC wallet with the same information. You might want to do this with a wallet where you have more control on and which is local like Mycelium for Android. Then the address should be in that wallet and the funds as well.


Would it be possible to do atomic swaps with Monero and Bitcoin? Litecoin and Vertcoin is currently testing out atomic swaps with Bitcoin as of 2017-08. Would atomic swaps be possible with Monero?

To do an atomic swap, you essentially need two things:

The ability to do 2-of-2 multisignatures. Basically every cryptocurrency supports this, including Bitcoin and Monero, though with varying degrees of ease-of-use. In Bitcoin you can use CHECKMULTISIG opcode; in Monero (and eventually Bitcoin, I hope) you can do 2-party Schnorr signatures which are more private and compact but require interaction. In Ethereum you can do 2-party ECDSA signatures which are complex and annoying but perfectly doable (or maybe you can use a multisig contract, but these are non-atomic and have super weird semantics, so caveat emptor).
The ability to have timeout refund transactions, so that if one party disappears halfway through the protocol, the other party will get their funds back. This is done using Bitcoin locktimed transactions or OP_CSV.

Unfortunately Monero currently does not have a way to do refunds. I believe it has locktimed transactions, but these aren't usable since Monero does not let you spend unconfirmed coins, meaning you'd have to put your coins up before making a refund transaction, leaving a window for your coins to get stuck. I don't expect Monero to ever support spending unconfirmed transactions, unfortunately, because these interact poorly with their ring signatures.

On the other hand, something like OP_CSV, where coins' spending conditions change after a timeout without the need for explicit locktime transactions, naively seems impossible in Monero since their ring signatures require outputs be labelled with public keys rather than scripts. Further, every output can have at most one public key since it must have at most one key image to prevent double-spending.

Fortunately, there is a third solution, proposed by Pedro Moreno-Sanchez, and AFAIK, not written up anywhere. (I'd welcome comments linking me to a writeup, I heard of this through the grapevine so maybe I'm just out of the loop.) The way this works is that outputs may be labelled with two public keys, each with the same key image. How can two keys have the same image? Essentially, key images are computed by hashing public keys into other public keys and then multiplying the result by the original secret key. If each key's "hash" is defined to be the other key, the result of this process will be the same thing no matter which key is used (specifically, the Diffie-Hellman secret associated with the two keys). This means that one key can belong to the original party and have a locktime on it, while the other key is a 2-of-2 multisig key used for the swap in the cooperative case. When spending, it is impossible to tell which key is actually being used.

(OK, if the locktime has expired it's almost certainly the locktime key being used, and otherwise it must be the non-locktime key. Pedro had a solution to that using rangeproofs on the locktimes but my feeling is that the complexity-to-privacy ratio is too high, and in any case it distracts from the essential point.)

This is not supported in Monero today but expect to see it in a hardfork down the road, because the ability to do atomic swaps, and eventually payment channels, is something its developers and community are very interested in.


What Is the difference between the testnet and the mainnet? I have been seeing some questions about the testnet but what is the testnet?  Is the mainnet the one we normally use? What is the difference?

The testnet (test network) is an alternative Bitcoin blockchain, to be used for testing. Testnet coins are separate and distinct from actual bitcoins, and are never supposed to have any value. This allows application developers or bitcoin testers to experiment, without having to use real bitcoins or worrying about breaking the main bitcoin chain.

Mainnet: The original and main network for Bitcoin transactions, where satoshis have real economic value.

We're using the testnet alot for developing purposes, assume you are building a new feature and its require you to send and receive bitcoins and you don't have any real bitcoins or you don't want to waste with mistakes, here we use test network (testnet).

Testnet addresses and private keys have a different prefix

Testnet BIP32 private key   tprv    tprv8ZgxMBicQKsPcsbCVeqqF1KVdH7gwDJbxbzpCxDUsoXHdb6SnTPY

Testnet BIP32 pubkey    tpub    tpubD6NzVbkrYhZ4WLczPJWReQycCJdd6YVWXubbVUFnJ5KgU5MDQrD9

Testnet pubkey hash (m or n)    mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn


Does it make sense to "collect" smaller transactions balances into a single account during low activity? My understanding is that it's possible for extra bitcoins to be left in several accounts within my wallet.  The scattering of these coins into different accounts may cause future transactions to become larger in size (Kb), and therefore more costly in fees.

Does it make sense to prematurely consolidate these small accounts into a single "spend account" at some point? (perhaps while I sleep?)

In satoshi client, the "accounts" therein are only a convenience for labeling of receiving addresses. They don't matter for sending at all.

If you receive bitcoins, the balance is not added as in bank, but the amount is saved as "unspent output". Client only shows all these outputs together as one available balance. It doesn't matter whether one address has n unspent outputs, or these are on more addresses. When you send bitcoin, the fee is based on number of these outputs used and it is higher if they are very recent. So trying to consolidate them won't help much, only that you pay the fee sooner. And it isn't done "while you sleep", it's done by simply sending your whole balance minus fees to yourself.

In other clients, the fee algorithm can be completely different.


What is cs_main? Why is it called cs_main? What is cs_main? Why is it called cs_main?
This question was asked during the May 12th 2021 Bitcoin Core PR review club hosted by John Newbery on a Carl Dong PR to de-globalize ChainstateManager.
(The lock on cs_main was discussed in this StackExchange question.)

What is cs_main?

cs_main is a recursive mutex which is used to ensure that validation is carried out in an atomic way. It guards access to validation specific variables (such as CChainState and CNode) or mempool variables (in net_processing). The lock of cs_main is in validation.cpp.

Why is it called cs_main?

cs_main was the mutex ("critical section") that protected data in Satoshi's original main.cpp. In theory it could be renamed today as main.cpp has since been refactored into smaller files but every time you rename something in a header file, everyone needs to recompile any file that includes that header.
A long-term goal is to separate out those different bits of data that are protected by cs_main, so that eventually cs_main only protects the data inside validation.
These were answered by John Newbery and other participants of the May 12th 2021 Bitcoin Core PR review club.


Create a non-changeable bitcoin address? How to get a non-changeable bitcoin address. I tried to register on few bitcoin wallets websites but on each website btc address is changed after one payment is received and I didn't find the option to create a non-changeable one. I know that for privacy is much better to have a changeable btc address, but I need to create a non-changable btc address

With the majority of wallets, you'll be presented with a new address for each payment. As you mentioned, this is important for your financial privacy, so it is a standard practise.

That said, you can re-use an old address, and your wallet should detect the additional transactions received at that address, updating your balance accordingly.

In short: your wallet is a collection of addresses, it is not just 'the address that is currently displayed'. So you can re-use old addresses from the wallet if you so desire.


POW based blockchains systems Majority Attack TL;DR: With only 30% of network power a Majority Attack is possible and profitable. Am I missing anything?

Generally speaking, blockchains based on Proof-of-Work authentications are using amount of work as the weight of one's vote.

I will be talking specifically about bitcoin to simplify the discussion (Although I hate reading people who talks about cryptocurrency here).

A transaction is consider confirmed usually after 6 blocks have been mined above it. Mostly even 2 blocks are considered enough, but let's examine the secure decision of 6 block. Now assume I have 30% of the network power.

Me and the network have the same prefix of blockchain. At this point I'm beging to work and append to it my own blocks, ignoring the rest of the network. The chances I will manage to build a blockchain that is at least as long as longest chain in the network, by the time the transaction is "confirmed" - is roughly 15% (reference below).

That means I can revert my confirmed transactions 15% of the times. Now all I need is to earn more money on a reverted block than I'm paying for the total computing power. This is not impossible. If a "confirmed" block is even half-fulled with my transactions, the total amount of money can easily be 2 million usd (reference below).
Reverting at 15% success rate means at least one block every two hours (one block every ten minutes).

But 2 hours of work only cost me about 140,000 usd.

Or more importantly: playing fair doesn't seem necessarily more profitable.

Playing by the rules for two hours equals today about 1.2 million usd income (If you own 30% of the network power).

It seems profitable to attack the system every now and then, even with 30% of network power.

(Obviously I rather revert a lot of "small" transactions than a huge one, so no one will get susplicious and wait for more confirmations.)

What am I missing?

A few points:
- I rather not address issues such as "an attacker can be easily found". This may, or may not, be true. But it's not relevant for the question: Is it possible and profitable to attack the network with 30% network power.
- If you are stating I'm not mistaken and this is true (which I doubt), please do specify your amount of familirity with the protocol and the security of the system.

Refernces:

Success rate with 30% network power (math here is simple but clumbsy to write down rigorously)
https://pastebin.com/RhnGi04W
A single block carry a few thousand bitcoins (namely, a few million usd)
https://blockchain.info/
Bitcoin value in usd
https://coinmarketcap.com/currencies/bitcoin
Profits and costs of the entire bitcoin network:
https://digiconomist.net/bitcoin-energy-consumption

(I assumed one hour of my working profits roughly: total_bitcoin_mining_income/365/24*0.3
as I own 0.3 of the network power)

The attack you are describing is correct. This is an attack against the "Common Prefix" property of the blockchain, which roughly states that it should be hard for an adversary to cause two honest parties to adopt two different blockchains at the same time when they have diverged for more than k blocks, where k is a parameter. In your case, you have set k = 6.

In fact, the attack you are describing has been analyzed in Satoshi's original paper. If you look at the last section (11. Calculations), Satoshi calculates the probability of success of the attack you described. Specifically, he examines the probability of adversarial success for various values of the variable he calls q, which indicates the adversarial mining power. For your case, q = 0.3. Then he uses the variable z to indicate the number of blocks one waits prior to accepting a transaction as confirmed, in your case z = 6. In Satoshi's analysis, this follows a Poisson distribution and roughly the probability of adversarial success is indeed p ~= 0.15. In fact, Satoshi precisely calculates the case z = 5 and q = 0.3 and gets p = 0.1773.

In the original paper, there are certain z recommendations for how many blocks one should wait for to achieve an adversarial probability bound of p < 0.1%. For q = 0.3, the minimum z that achieves this is z = 24. So, if you want to be able to withstand a 30% adversary, you must wait for 24 confirmations.

Satoshi's analysis is a bit rough, because it only takes one particular attack into account. Subsequent analyses have allowed us to quantify these probabilities against arbitrary adversaries, even unknown. The primary reference here is the Backbone analysis. In this paper, the Common Prefix property is stated precisely and proven to hold against arbitrary adversaries.

The Backbone analysis is an improvement over Satoshi's for several reasons. I will mention a few:

The probability distributions are specified precisely (as Binomial and Bernoulli distributions) and not approximately (as Poisson distributions).
The adversary is arbitrary and does not necessarily follow a strategy that we have predicted or know about.
The security is proven and not simply intuitively conjectured.
The system is modeled and analyzed precisely using theoretical computer science tools down to interactive Turing machines.

To see the Common Prefix statement precisely, look at Definition 3 (Common Prefix) under section 3.2 (Desired properties of the protocol). The fact that bitcoin has this property is proven in Section 4.2 (Common-Prefix property) under Theorem 15 (Common Prefix). There, a precise formula is given for k, the number of blocks you need to wait to know that the chain cannot be reorg'ed back to that point: k = ηκf. The variables η, κ, f are made precise in Section 4 (Analysis) under Table 1 (The parameters in our analysis). It is difficult to give concrete numbers to these variables, as they depend on the network health and performance as well as mining difficulty. For bitcoin, we have that κ = 256 is the bit length of the (mining) hash function. I estimate round duration to be, optimistically, about 10 seconds (time it takes for a large portion, say 90%, of the network to learn of a newly mined block header) and so since a block is found on average every 10 minutes, we have that f is about 0.0003 for bitcoin. I do not know how to estimate η precisely.

The point is that the Common Prefix theorem is attained for k when "the execution is typical" (typicality is established in Theorem 10), which depends on the parameters ηκ. A prerequisite for typicality is that the sequences of consecutive rounds examined are at least ηκ in length. The assumption that this quantity is large is needed to apply the Chernoff bounds to the Binomial distribution: Typicality is attained with overwhelming probability in this number. If this number is small, the probability is no longer overwhelming, and the security of the system can fail.

Such analyses are typical in cryptographic systems, including digital signatures, encryption schemes, zero-knowledge proofs, and so on. The adversary is capable of succeeding with a probability which is bounded by a function with one free variable: That free variable is the security parameter (ηκ in backbone's case) and the function is negligible in that parameter, meaning that the probability drops off exponentially as the parameter increases. In Bitcoin's case, the probability of double spending drops exponentially as the blockchain size on top increases, but is not negligible for k = 6, especially when the adversary is powerful.

To address your more concrete point that this is economically feasible: You are right that you can transfer $2M in a single bitcoin transaction. However, I find it unlikely that the recipient for such a transaction would consider it safe after k = 6; a value close to k = 25 must be used. It is sensible to accept lower values of k for smaller amounts and require larger values of k for larger amounts. While the exact probability is difficult to calculate, still most exchanges and other automated services accepting cryptocurrency payments apply reasonable bounds and I expect that they increase them for amounts that are in the millions of dollars (typically this is done by requiring human approval of a transaction for extremely high-value transactions, which definitely gives plenty of time for proper proof-of-work on top). The economic cost of forking the chain to cause block abandonment is briefly analyzed in the paper On bitcoin as a public randomness source. Given that analysis, one can balance the cost of forking the blockchain against the potential gains one could earn by performing a successful double spend, multiplied by the adversarial probability of success calculated from Backbone. This can allow a party to precisely determine their desired value of k for various monetary parameters, given precise adversarial bounds such as q = 0.3.

I know this answer was a bit technical and did not give many concrete numbers, but I hope it shed some light into why the attack you're describing is indeed possible even though we still would call it "negligible". Since you asked for my credentials, I am a PhD student in Cryptography focusing on the foundations of blockchain protocols at the Computer Science department of the University of Athens. Aggelos Kiayias, who wrote the Backbone paper, is my advisor (I did not contribute to that paper). As he is my teacher, I am quite familiar with his work, especially because we're using the model developed in backbone for subsequent work. I am a research fellow at IOHK where we are building the foundations of a cryptocurrency we call Cardano and analyzing it from a mathematical point of view. Probabilities of adversarial success in attempts to perform blockchain forks as well as their analysis come up in my own work in which I'm trying to construct sidechains interfacing multiple blockchains. We often prove negligibility bounds in these settings.


Debug Bitcoin Core Mining I'm running the generate command on a bitcoin core fork (with difficulty = 1) and bitcoind running in another window and outputting the best/vs. hashes as it should when generate is running.

However, nothing has been mined yet; generate keeps returning empty brackets. A similar command worked on this machine so I know its powerful enough to mine at this low difficulty.

How do I check what's going wrong? Perhaps a verbose option for generate or something other than debug.log (this just outputs keypool return/keypool reserve throughout. I have also tried to mine in the debug console of QT client but with no luck either.

If you mean the generate function, which creates blocks on demand, it is only available for the Regtest mode. Use the -regtest option to run in Regtest mode.

If you mean the setgenerate mining function, it has been disable since the 0.13 version of Bitcoin Core, due to the fact that mining difficulty became too high for doing it with CPUs.

If you want to restore that functionality you will need to restore the mining functionality code from a previous version and try to integrate it again in the source code (you will need to recompile it).

debug.log is the reference log file. You can refine the log output through the command line options. See https://en.bitcoin.it/wiki/Running_Bitcoin


What is the max length of a public note when attaching it to a bitcoin transaction using blockchain.info? What is the max length of a public note when using this feature on blockchain.info?

Googling this, my first hit was the blockchain.info website FAQ. Under the point "How do I make a public note?" they show the following picture:

I'm gonna go out on a limb here, but I think it means that you can put "Anything you like up to 255 characters." into a public note.


Multi-signature with no address reuse . How coordination is done? I would like to have both 2-of-3 multi-signature and no address reuse.
For example,
3 BTC belong to multi-sig user1 (Officer),user2 (Manager), user3 (CEO) (2of3 multisig) with pubkey1,pubkey2,pubkey3.
They send 1 BTC to user 5. Assume zero fees. The change of 2 BTC should be sent to user1,user2,user3 (multi-sig) with pubkey1.1, pubkey2.1, pubkey3.1
Well, this is easy to say here! but
In real life, how do the users in multi-sig coordinate their next pub key? Would it be a coordination nightmare? What happens when one of the user (CEO) always not available for any communication? We will be stuck with an old Public Key for (user3)? Is there any automatic coordination like BIP32 ? etc.

Some multisig wallets use BIP 45 or otherwise do something similar if they aren't using those specific derivation paths. Such wallets will have the cosigers share their extended public keys with each other. From those xpubs, they can derive each others child keys by themselves. They then agree that all the keys derived at index 0 are for address 0, index 1 for address 1, etc.
They may then also use BIP 67 to determine the order of the keys. BIP 67 just sorts the keys so they are in lexicographic order.
Alternative to BIP 67 is to just have the pubkeys in a predetermined order. I.e. the key derived from person 1's xpub is 1st. The key from person 2 is 2nd. And so on.
This way the participants have determined which keys to use for a particular index, and the order to put the keys. They can now construct the redeemScript and thus the multisig address. All of this can occur without communicating again.


How similar is Blockchain (as a data structure) to double linked list? I came across this definition of Blockchain from Oleg Andreev , who is the protocol architect of @chain -

It felt like double linked list to me.

It's a single linked list. Each block points to the previous one. It's not possible to blocks to point the next one on the chain, cause 1)it doesn't yet exist 2)there will be possible multiple blocks in the future, every one except one will get orphaned.

The term 'blockchain' is somehow misleading, it's more like a tree data structure. Only most branches diverging from the principal one are ignored after some time, and called 'orphans'.


Can Bitcoin technology be leveraged to implement a decentralized trust system (i.e. a replacement to SSL)? Like Namecoin is intended to replace / augment DNS, can the Bitcoin principles / protocol be extended to support a distributed "trust" mechanism, in a way that no central authority will need to be trusted in order to verify public key authenticity?

This post is inspired by the recent hack of a Certificate Authority.

Clarification - I don't mean for this technology to be integrated within the main client or blockchain, just for the underlying technology to be used.

While it's certainly possible to implement a script to handle trust the way NameCoin handles DNS-like transactions there are a few possible "weak links" in such a system. First, since an individual can't usually be known the trust could only be tied to individual addresses, which would encourage the re-use of addresses and thus decrease the anonymity of the network as a whole since merchants would want to find ways to get around generating a new address for each transaction in order to maximize their trust rating. The only alternative is to implement a system of binding multiple addresses into one trusted "account" which would further compromise anonymity by making it known precisely who owns which addresses thereby tying at least one side of most Bitcoin transactions to a real person.

In short, it's possible but it kills the pseudonymous nature of the network and makes transactions far too traceable to real identities. It could be implemented, but given the private (and disruptive) nature of most Bitcoin proponents it's unlikely that it will be. An external "Web of Trust" type system carries adequate benefits without compromising Bitcoin itself and in fact, there has been a great deal of discussion on how to decentralize them.


How can I hold Bitcoins safely in the long term? Say I wished to hold a lot of bitcoins for many years as an investment. My worry would be about the long term safety of the different wallet mechanisms. If it's a website - what if it goes bust or goes down? If it's on my phone - then what if I lose my phone?...

Correct me if I'm wrong but presumably a bitcoin is essentially a long string of numbers, so presumably I could physically write this down on paper, make a few copies as backup and bury them in the garden (or whatever), then I wouldn't have to worry about the website going down.

I guess that my ultimate question is, how can I store some bitcoins for many years without having to worry about the security of my wallet?

You can store the bitcoins in wallet on desktop or mobile. As it's software, you can create multiple copies of the keys and keep it in different devices, say USB, email, desktop, mobile, drop box etc

Yes you can also store it as paper, but it would be humongous to do on your own.


Where are the non-scriptPubKey outputs in the chainstate leveldb? I read
https://bitcoindev.network/understanding-the-data/
and it explain that the leveldb of the chainstate contain transaction with at least one unspent output.

And it has "The scriptPubKey and amount for those unspent outputs."

But I read somewhere any OPCODE script is possible for an output.
Where are the non-scriptPubKey outputs?

They're the same thing. The scriptPubKey is the script in the transaction output.


Transact Bitcoin with no internet An issue I find when I travel is that I would like to visit a cafe that accepts Bitcoin but because I am abroad I usually don't have an internet connection on my phone.
I could use WiFi but what is the best way to transact Bitcoin without internet at a point of sale? i.e low value transactions.

To transact in Bitcoin you will need to broadcast the transaction to the Bitcoin network.  At this time an internet connection on your phone is going to be a requirement, a wifi hotspot at the cafe is all you need.

In theory there are other ways to get the transaction to the network for example sending the transaction directly from your phone to the point of sale system using NFC or Bluetooth. Search bitcoin over NFC or Bluetooth and you can read about these.

Sending the transaction over SMS is also a possibility in the future

Edit: As pointed out Bluetooth and NFC support is already built into some wallets. See Bitcoin Wallet or Airbitz for example.


Is it possible to get CPFP information from full node, without requesting full mempool dump? I want to get CPFP information out of full node - that is, ancestorsize and ancestorfees - in order to calculate the necessary fee for either CPFP, or RBF if possible.

Can I get this information through RPC without requesting the full mempool dump?

I need this to build tools for CPFP/RBF, that are connecting to full node via RPC. But I can only find the full mempool dump, which is inefficient for this (I don't need the full dump for one transaction information).

The answer is getmempoolentry.

https://chainquery.com/bitcoin-api/help/getmempoolentry


Eltoo channel - can opening be off-chain In Eltoo the set-up phase is similar to Lightning. You fund a n-of-n multisig (usually 2-of-2). Of course you don't want to publish this until you have a bail-out possibility - called "settlement transaction" here.

But what I found out is this "setup transaction" is exactly the same as later "updates" - you could also call it Tu0. So is there any need to even broadcast this first transaction to the blockchain (before doing further ones)? Or is it enough if both parties just keep the properly signed Tu0 (with both signatures)? What else do you need in case of an uncooperative close? You broadcast Tu0, latest Tui and (time-locked) Tsi ?
I guess one problem would be the other party trying to "double-spend" his input into the multisig?

I think you have answered your question yourself in the last question that you raised. The problem with not publishing Tu0 is that the funder of the channel could double spend the input of Tu0 and in that case "steal" all the money from the channel. so with eltoo we still need the bitcoin network / blockchain give proof of the existence of funds in the 2-2 multisig


Can i use the same hardware mining for bitcoin and Zcash? I use bitcoin hardware mining. Can I modify the hardware to mine Zcash cryptocurrency or I should buy Zcash mining hardware?

ZCash uses Equihash algorithm for proof of work rather than SHA256, so if it uses ASICs, the hardware would definitely not be compatible.


Which wallets support double spending? Which wallets support double spending? i.e. cancelling a transaction with 0 confirmations by using higher fees

Replacing an unconfirmed transaction with another one isn't really double spending, as Chytrik mentioned.

Several of the older wallets do support dropping unconfirmed txs, freeing up the inputs another transaction. In my experience, Bitcoin Core and Electrum tend to be the best candidates for such actions.

Newer, more consumer facing wallets, such as Ledger Live generally tend to not expose such functionality in the name of simplicity.


Merkle tree structure inside blocks - what are they for? I'd like to check if my understanding is correct. This is regarding the purpose of having the Merkle tree structure for all transactions inside a block. Is the only reason it exists so that thin clients can verify that a transaction exists in a block without being told about all the other transactions of that block?

Seems quite complicated to implement that (instead of just concatenation of transactions) for a rather special case. Particularly since the maximum size of a block is not very large - so there isn't really a problem with verifying all the transactions and ensuring that the hash of the block matches up to those.

There is no merkle tree structure inside of blocks. Transactions are just concatenated with each other. The order of concatenation does matter though. It is necessary to verify the merkle root, which is the root node of a merkle tree. The merkle tree is not encoded in the block, rather it is generated on-the-fly using the data in a block in order to verify that the provided merkle root is correct. SPV wallets will often request for a transaction and proof that that transaction is in the block, so a node will provide part of the merkle tree to prove that the transaction is in the block.


How can I turn off sending of bitcoins? I use Bitcoin Core v.0.17 on the server. I want to only be able to receive, and prevent sending. How can I turn off sending of bitcoins through bitcoind, bitcoin-cli or bitcoin.conf?

Stop send btc, only reciev

Bitcoin Core

So far as I know, there isn't really good support for this in Bitcoin core.

The safest way is to remove your private key(s) from the wallet.

You could archive your existing wallet (and test full recovery carefully) then set up a watch-only wallet using importaddress

However note that this does not generate new receiving addresses for you, If you use a new receiving address for each transaction (as you should) than you'll have to generate each address  externally and import it into the watch-only wallet.

Other wallets may have better support for this.

Offline Wallets

You don't actually need a wallet to receive payments, so long as you don't mind

the consequent loss of privacy from using a single receiving address.
the need to trust a third party blockchain explorer to monitor payments received.


What is the Bitcoin address to fill in under 'Pay to' I have a Bitcoin Core wallet. I do not know what address is required under 'Pay to'. Is it one I must create or what?

This should be an address belonging to the person or company you want to pay bitcoins to.  You have to get the address from them.

If you are trying to buy something from a company, usually they will tell you the payment address as part of the purchasing process.  If you are trying to send money to a friend, ask them for their address.

If you are not looking to pay money to anyone right now, then you do not need to use this screen at all.


How does the standard client prioritize transactions? I've heard that the standard client prioritizes which transaction to relay based on the Bitcoin Days Destroyed and the fee paid on the transaction, but what is the exact formula used to determine which transaction has higher priority? That is, how does the standard client prioritize which transaction to send to other nodes first?

The priority of a transaction is (the sum of (coin age in blocks * coin value in satoshis) over all the inputs in the transaction) divided by the size of the transaction in bytes.

Here's a random example transaction copied from http://bitcoincharts.com/bitcoin/txlist/:

It has 2 inputs (both of which have since been spent in other (confirmed) transactions rendering this transaction unconfirmable):

one for 0.1005 BTC from block 165774
one for 0.0995 BTC from block 165777

It is 439 bytes long, and has a priority of 432,232,688.

The most recent blocks in the blockchain is 175262 at the time of writing.

I sum the (age * values) for each transaction and divide by size.  The + 1 is because transactions confirmed in the newest block are considered to have an age of 1, not 0:

>>> current_block = 175262
>>> ((current_block - 165774 + 1) * 0.1005e8 +
     (current_block - 165777 + 1) * 0.0995e8) / 439
432232687.92710704

As you can see, the priority of a transaction will go up as new blocks are found.


Is there a mobile wallet that works with a Trezor? Is there a mobile wallet that support using a Trezor hardware wallet to spend coins? Is there an online resource that tracks features like this for thin-clients?

Is there a mobile wallet that support using a Trezor hardware wallet to spend coins?

You first need an OTG cable and a phone that supports acting as a USB host.

Trezor has not released a mobile version of their wallet.  However they have a Wallet Manager that can be used on your mobile (for Android). This allows you to manage the Trezor (but not spend money).

For wallet functionality they recommend using Mycelium (Android) with your Trezor which has support for this. Mycellium has an iOS client but it doesn't support Trezor.

  Is there an online resource that tracks features like this for thin-clients?

The only resource that I'm aware of is the Trezor documentation.

Trezor currently doesn't work with Apple iOS devices; it doesn't have MFi certification.


How does Multi-Signature Pay 2 Script Hash (P2SH) enable stronger security? Coinfloor says it will pay out withdrawals using Multi-Signature Pay 2 Script Hash.  What is Multi-Signature Pay 2 Script Hash?  I read What is "Script Hash" address exactly and how does it work? but didn't understand how it enables more secure withdrawals form cold storage.

Multi-signature is a feature to protect against theft.

From securing your wallet

  Bitcoin includes a multi-signature feature that allows a transaction
  to require the signature of more than one private key to be spent. It
  is currently only usable for technical users but a greater
  availability for this feature can be expected in the future.
  Multi-signature can, for example, allow an organization to give access
  to its treasury to its members while only allowing a withdrawal if 3
  of 5 members sign the transaction. It can also allow future online
  wallets to share a multi-signature address with their users, so that a
  thief would need to compromise both your computer and the online
  wallet servers in order to steal your funds.

Traditional Bitcoin addresses are secured with a single private key. P2SH addresses can associated with three private keys. Depositing funds into is the same as depositing funds into a standard Bitcoin address. However, withdrawing funds from the address requires at least 2 of the 3 keys to sign.


Trezor Firmware update just hangs indefinitely Trezor out of the box - first firmware update with the wallet not even set up and just hangs on "Installing...Please Wait". Read through all of the troubleshooting section on Trezor's website but no help at all. Can someone help me?

Try it again. If it does not work, contact support and ask for a replacement unit.


Let's take a look at this block, because it only has one transaction (the coinbase): 000000000000000000eb2d0ed97a7b2cff7f1408417dca83908004beb6fd9b95

Let's grab the raw hex data:

  0000002053f7ebc735f54ac8d4ebcc1eeb3d3bdea89603bdd27431000000000000000000ff964ec70ea5a5356a04fdb044ca6c59ffda2dd6be02c63d9ea58fb6d46e01991a22bb590b310118f6df26f801010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff3103b46707244d696e656420627920416e74506f6f6c6b2f4542312f4144362f4e59412f332059bb221ab8080000615c0300ffffffff02807c814a000000001976a914660371326d3a2e064c278b20107a65dad847e8a988ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000

There are 6 things which make up the block header:

First we have the version (4 bytes), 00000020, which is reversed bytes of 0x20000000.
Then we have the previous block hash (32 bytes), also in reversed byte order, 53f7ebc735f54ac8d4ebcc1eeb3d3bdea89603bdd27431000000000000000000 which is this block.
Next we have the merkle root of the transactions (32 bytes), in reverse byte order, ff964ec70ea5a5356a04fdb044ca6c59ffda2dd6be02c63d9ea58fb6d46e0199. Because there is only one transaction, the coinbase transaction, the merkle root is just equal to that transactions txid.
Then we have the time stamp (4 bytes), in reverse byte order, 1a22bb59 which is 0x59bb221a in hex or 1505436186 in decimal.
Then we have the reversed bytes of the 'bits' field (4 bytes), 0b310118 which is 0x1801310b
And then the nonce (4 bytes), f6df26f8 which is 0xf826dff6

Then after the header, we have the byte 01 which means there is one transaction, which follows. That one transaction is just the encoded coinbase transaction, as you can see here.

Of course, only the block header needs to be hashed, not the transactions too.


What is the largest password/passphrase size for a wallet.dat file? Suppose your wallet.dat file is copied to the wild.

I am working on methods for creating very strong (512bits, hopefully much more) passphrases that would make it unfeasible to either use rainbow tables or to try brute force it.

Ideally, even if:

i) one's passphrase is simple; and
ii) the wallet.dat file is copied...

...an adversary would have to employ giant computing power to try to unlock it.

Since I couldn't get it from the documentation, I wonder if anyone knows how large (in, say, bytes) a passphrase/password can be.

related question: How does the Bitcoin client encrypt the wallet.dat file?

So just like Nick said, If the encryption is done using 256 bits then creating a passphrase which is 512 bits long would be the same as creating a passphrase which is 256 bits long (as long as its random).

You should look into brainwallets as they provide a way to create strong passwords which are also easily memorable since all you have to memorize is a 3 line poem.


Error: connect ECONNREFUSED 127.0.0.1:8332 I get this error:

{ Error: connect ECONNREFUSED 127.0.0.1:8332
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 8332 }

when I use this code:

var bitcoin = require('bitcoin');
var client = new bitcoin.Client({
    host: 'localhost',
    port: 8332,
    user: 'Rohit',
    pass: '12345'
});

I hadn't started bitcored service ..that's why this error occurs
when I started, the error had gone

i followed these steps that given here

Anyway thanks**


Help needed with PyWallet and wallet dump using MacOS Could anyone please give me some guidance on how to perform a wallet dump using PyWallet on a MacBook (macOS 10.12 Sierra)? I’m not very savvy with this stuff at all. Have an old wallet.dat file from 2011 that I want to check all the keys from and was reading that doing a wallet dump would be an efficient way to do it without having to wait for the entire blockchain to sync on Bitcoin Core. Having a really hard time trying to figure out how to do it with almost no computer programming knowledge. So far I have Python 2.7 downloaded but am pretty stuck after that. Any help would be greatly appreciated. Thank you!

Install Xcode

Install MacPorts from https://www.macports.org/

Run these commands:
sudo port install python27 py27-twisted py27-pip py-bsddb python_select
sudo port select --set python python27
sudo easy_install ecdsa


multi coin solo mining I'm wondering about switching coins while solo mining?

Does switching before I block is mined effect the odds of getting a block reward, or is it always essentially chance??
For example, if I mine for 30 minutes on Feathercoin, then jump to Litecoin, when I come back to Feathercoin will there be any accumulated value in the wallet?

Am I ever starting over, or is it always chance?

By the way, I'm using a node stratum pool, so it's direct connect to the wallet.

Every single attempt at mining a block is independent of every other attempt and has precisely the same chance of succeeding. There is no intermediate work to save or lose.


What does bitcoin.org mean when they say about Coldcard Wallet "the final software was not built deterministically like Bitcoin Core"? I am looking at hardware wallets to store my Bitcoins, and Coldcard Wallet Mk3 seems like a great option. However, at looking at info about it at bitcoin.org, it says that the software is not built deterministically like the consensus Bitcoin Core protocol.
I just want to know if this is true, or the info is outdated. Because in the Coldcards page, I have not found such thing.
Coldcard even claims extreme compatibility with clients such as Bitcoin Core, Electrum of Wasabi Wallet. And it seems to be easy to use it only trough ones personal Full Node.
The other option as a Hardware Wallet I am looking for, is BitBox02.
Thank you in advance,
Ander

Some security sensitive pieces of software like Tor, Debian and Bitcoin use deterministic builds to increase the safety of binaries for end users. Typically a piece of software will be built from source code by a maintainer, signed by them, and then uploaded to a repository. Small differences in the setup of the machine compiling the software, timestamps, and random values in the output mean that every time it is compiled the output is likely to be unique.
Deterministic builds replace this with a system called Gitian that produces identical binary output no matter who produces the binaries or when, allowing many people to independently compile the software and come to the same end result.
Deteminstic builds protect against:

Malicious software on the maintainers machine changing the behavior of the software, injecting a backdoor or other code
A single maintainer acting maliciously and altering the software
An innocent maintainer being accused of having made modifications they did not

The ColdCard product not being built deterministically means that even though the project is open source, you have no way of verifying that the binaries provided by the company completely match the source code.


How can coinbase charge less than the average transaction fee? As of this writing, the average bitcoin transaction fee is over $30, according to this chart.  However, I just bought $20 worth of bitcoin on coinbase, and they charged me a fee of $1.49.

My understanding of the fee for a transaction is that it is a function of market forces, the number of bytes in the transaction, and the time you are willing to wait for your transaction to be added to the blockchain.  Overall however, I had the impression that at a given time these fees are relatively constant per transaction.  So I would expect that coinbase would have to spend something around $30 in fees to give me my $18.51.

What don't I understand?

Coinbase holds a large amount of Bitcoins. When you buy Bitcoin on Coinbase, they do not need to actually send it to your wallet, they just need to say on their servers that you own X amount of Bitcoins. They charged you $1.49 because of the payment you used and/or to take a small profit. If you were to move your Bitcoins to a wallet you actually own at home, you would have to pay the miners.


What is the likelihood that an xPub child address is not owned by the same xPub address holder? Kind of an odd question, and I'm pretty sure the answer is, "extremely unlikely," but wanted to see what the community thought.

Secondary question: How sure can one be that the addresses walletgenerator.net and similar paper wallet generators generate are not all related to an already-in-use xPub?

If you assume that an address is generated from a xpub/xpriv keypair, then yes, it would be safe to assume that the owner of that address also owns the xpub/xpriv keypair that that address was derived from. The probability that someone was able to generate the same address randomly or that someone was able to generate another keypair which also has that address as a child is so low that it is effectively 0.


Freebsd Bitcoind doesn't read config correctly When I try to connect to my bitcoind server with the username and password in my bitcoin.conf I get a 401 error.
When I set an username and password in the bitcoind parameters(bitcoind -rpcuser=... -rpcpassword=... -daemon) it does work.

I also have prune in my config file. For some reason this does work.
Also the rpcallow works fine.
So it does read my config file?

When I add the -conf parameter with my config file I get this error:

Error reading configuration file: the options configuration file contains an invalid line '��
(I also can't read those last 2 characters)

I even get this error when the file is empty

Does someone know how I can fix this?

I don't know exacly how, but I got it working.
I do know that I used export LC_ALL=en_US.UTF-8 but I am not sure that is the reason it works.

I still have the same error with the -conf paramter. Even when permissions are 777.

I know this isn't a perfect answer. But my bitcoind server works now.


P2P MultiCoin markets are there any p2p markets for  different kinds of coins, like https://localbitcoins.com/ for bitcoins?

Thank you!

Yes!

Bitsquare.io is:

Decentralized – there is no single point of failure.
Safe – Bitsquare never holds your funds.
Instantly accessible – no need for approval from a central
authority.
Private -no one except trading partners exchange personally
identifying data.
Open – every aspect of the project is transparent.
Easy – we take usability seriously.

Many altcoins are supported:
https://bitsquare.io/faq/#altcoins

Here you can see the list of the currently supported altcoins:

“ETH”, “Ethereum”
“DAO”, “DAO”
“LTC”, “Litecoin”
“XMR”, “Monero”
“NMC”, “Namecoin”
“DASH”, “Dash”
“SDC”, “ShadowCash”
“NBT”, “NuBits”
“NSR”, “NuShares”
“PPC”, “Peercoin”
“XPM”, “Primecoin”
“FAIR”, “FairCoin”
“SC”, “Siacoin”
“SJCX”, “StorjcoinX”
“GEMZ”, “Gemz”
“DOGE”, “Dogecoin”
“MKR”, “Maker”
“BLK”, “Blackcoin”
“FCT”, “Factom”
“NXT”, “Nxt”
“STEEM”, “STEEM”
“BTS”, “BitShares”
“XCP”, “Counterparty”
“XRP”, “Ripple”
“XEM”, “NEM”
“ANTI”, “Anti.cash”
“VPN”, “VPNCoin”
“MAID”, “MaidSafeCoin”
“YBC”, “YbCoin”
“CLOAK”, “CloakCoin”
“EGC”, “EverGreenCoin”
“VRC”, “VeriCoin”
“ESP”, “Espers”
“XVG”, “Verge”
“MYR”, “Myriadcoin”
“MXT”, “MarteXcoin”
“GRS”, “Groestlcoin”
“IOC”, “I/O Coin”
“SIB”, “Sibcoin”
“CRBIT”, “Creditbit”
“BIGUP”, “BigUp”
“XPTX”, “PlatinumBar”
“JBS”, “Jumbucks”
“PINK”, “Pinkcoin”
“OK”, “OKCash”
“GRC”, “Gridcoin”
“MOIN”, “Moin”
“SLR”, “SolarCoin”
“SHIFT”, “Shift”
“ERC”, “Europecoin”
“POST”, “PostCoin”


Can new types of transactions be included the current block chain? I was putting an answer for this question together when I realised my idea would require a new type of transaction to be invented and included in blocks.

Then I wondered how that could work. There are many mining rigs out there which would have no way of validating my transaction type.

Even if some miners do recognise my transaction and even included it in a winning block, all the other miners would not accept that winning block and instead continue mining on the previous block.

What would happen if we wanted to devlop Bitcoin this way? Would we instead have to establish Bitcoin2 with a new block chain?

Miners will accept block with transactions they don't understand, so long as the transactions don't attempt to create Bitcoins out of thin air. They won't include transactions they can't validate in their own mined blocks though.

There is active effort at the top levels of the Bitcoin developers to get new transaction types into the client. M-of-N transactions (transactions that require a set of signatures), for example, are close to obtaining a consensus.


Howto scale thousands of bitcoin accounts properly with bitcoind deamon? It is said in the bitcoin wiki that:

  The accounts code does not scale up to thousands of accounts with tens of thousands of transactions, because by-account (and by-account-by-time) indices are not implemented.
  So many operations (like computing an account balance) require accessing every wallet transaction.

so my question is, what solution would be acceptable to implement a program who would be in charge of thousands of account (like an e-wallet).

My first guess would be to run multiple bitcoind instances, in order to keep the account by daemon ratio under a certain limit.

Any other idea ?

Several options:

Don't use bitcoind
Use bitcoind to interface the p2p network but ignore accounts and other abstractions
Hack bitcoind to use by-account indices


Do you need to download the entire blockchain in order to mine bitcoins? Do you need to download the entire blockchain in order to mine bitcoins? I'm downloading bitcoin-qt, and I'm afraid it will take up too much memory on my computer. Also, I just read that when another node downloads the blockchain from me, that will also tie speeds. Is this true?

If you are solo mining, then you need the entire blockchain since each block you mine references the hash code of the last block in the chain.  If you don't have the last block yet, then the network will reject your mined blocks since there will already be later blocks in the blockchain.

If you are mining in a pool, then you don't need the blockchain or bitcoin-qt.  Just point your miner at the pool and start mining.


Difficulty target representation in bitcoin wiki The bitcoin wiki describes difficulty target representation as follows:

How is difficulty stored in blocks? Each block stores a packed
representation (called "Bits") for its actual hexadecimal target. The
target can be derived from it via a predefined formula. For example,
if the packed target in the block is 0x1b0404cb, the hexadecimal
target is
0x0404cb * 2**(8*(0x1b - 3)) = 0x00000000000404CB000000000000000000000000000000000000000000000000
Note that the 0x0404cb value is a signed value in this format. The
largest legal value for this field is 0x7fffff. To make a larger value
you must shift it down one full byte. Also 0x008000 is the smallest
positive valid value.

Why 0x008000 is the smallest positive valid value?

To explain that, let's look at the code that unpacks the compact format into a 256 bit int.

arith_uint256& arith_uint256::SetCompact(uint32_t nCompact, bool* pfNegative, bool* pfOverflow)
{
    int nSize = nCompact >> 24;
    uint32_t nWord = nCompact & 0x007fffff;
    if (nSize <= 3) {
        nWord >>= 8 * (3 - nSize);
        *this = nWord;
    } else {
        *this = nWord;
        *this <<= 8 * (nSize - 3);
    }
    if (pfNegative)
        *pfNegative = nWord != 0 && (nCompact & 0x00800000) != 0;
    if (pfOverflow)
        *pfOverflow = nWord != 0 && ((nSize > 34) ||
                                     (nWord > 0xff && nSize > 33) ||
                                     (nWord > 0xffff && nSize > 32));
    return *this;
}

The first 8 bits here are the exponent. The next bit is a sign bit, with 1 being negative. The next 23 bits are the mantissa.

So, 0x00800000 is equal to 0x00000000.


How is wallet at official client encrypted? What encryption it use? How is wallet at official client encrypted? What encryption it use?

What encryption does Bitcoin-qt use and what encryption is used at Multibit?
And how strong that encryption is compared to other methods?

Both bitcoind and bitcoinj use AES-256 encryption for the private keys in their wallets (this does not mean that the wallet formats are compatible though).

Bitcoin-Qt is just a GUI on top of bitcoind and Multibit is using bitcoinj internally, so the same should apply to them.

References:

comment in the bitcoind source code
bitcoinj documentation


Manually extracting ledger nano s wallet public / private keys using "Mnemonic Code Converter" from ledger I have the following example seed:

  morning twist board pelican denial retire middle inherit evil
  ritual omit fade general toddler grace evoke recipe
  sad minor destroy public dawn scissors cube

I'm trying to generate the same addresses on the ledger site which is showing up on my device: https://www.ledgerwallet.com/support/bip39-standalone.html

My intial pin was 5555 and my first bitcoin address is: 12mCn27...

I also set a "passphrase" of just the letter "a" which generates btc address: 1NSXBid...

I then did an attach to pin with the pin: 4555 which generates btc: 17Dn62...

I then added a passphrase to the 4555 pin with just the letter "b" and I get the following btc address: 1HBPpj...

When setting up ledger nano s initially is the address randomized? And what deviration path does it start from?
I tried pasting the example seed into https://www.ledgerwallet.com/support/bip39-standalone.html and I can't find the initial pin 5555 setup of address: 12mCn27
If I'm able to set different pins, where do I type this pin on the Mnemonic Code Converter page? It's not the passphrase field thats for sure.
If I wanted to recover all those private keys with the above scenarios with different pins  and passphrases. How can I?

Right. PIN just protect the configuration. It is not an input in the calculation.

The first normal address should be m/44'/0'/0'/0/0, the first *change address should be m/44'/0'/0'/1/0.

If you use segwit-p2sh m/49'/0'/0'/0/0 and m/49'/0'/0'/1/0. Native segwit: m/84'/0'/0'/0/0 and m/84'/0'/0'/1/0. And so on

Use the command line utils in pycoin. Pretty up-to-date. You have to somehow start from the seed though. They don't support BIP39.

EDIT: The Master Public given by ledger wallet is already derived so: to obtain the first 10 addresses with ku (pycoin) this work for me (segwit):

ku -j -s0/0-9 xpubYourMasterPublicKeyHere |jq '.p2sh_segwit'

If you don't use segwit it's much easier:

ku -s0/0-9 -a xpubYourMasterPublicKeyHere

DISCLAIMER: Don't send money on a derivation you have obtained like this unless you know exactly what you're doing!

Check that the addresses produced are the same AND you have to use the address try first with a small amount to test and check the landing on Ledgerwallet.


Valid fork in regtest - Change blockchain via RPC? I've created a regtest network consisting of 2 nodes - node0 & node1.
I'd like to have a fork on the common blockchain and seemingly achieved it by doing so:

nodes start
node0 adds node1 via addnode
node0 generates 1 block with hash 4dac...
node1 generates 1 block with hash 5d8b...
node0 invalidates node0's block with hash 5d8b... via invalidate <hash>
node1 stops
node0 generates 1 block with hash 64f2...
node1 restarts
node1 generates 1 block with hash 5sfg...
node0: getchaintips returns an array with invalidated block's hash 5d8b... with status

Now my questions:
a) How can I achieve a "valid-fork" status in the output of getchaintips for the previously invalidated fork? [SOLVED]

b) Is it possible for a node to "conciously"/via RPC give up its own chain and switch to the competing chain?

The longest valid chain is always chosen automatically. Thus the way to make it forcefully switch is using the invalidateblock hidden RPC.


What properties does the DNSSeed list at bitseed.xf2.org attempt to have? According to bitcoinstats.com:

  Except for bitseed.xf2.org the seeds aim to return nodes that are currently online and reachable.

If the nodes are not aimed to be currently online and reachable, what qualities (if any) are they aimed to have?

That DNS server in particular does not exist anymore and is not used by Bitcoin Core.

I believe for a while it returned stale results which is what that comment would have been about.


If there a formula to decide when more decimal places will be added to Bitcoin? I know it is possible to allow for more than 8 decimal places in Bitcoin. We all hope that Bitcoin will become extremely valuable one day and increments smaller than 0.00000001 BTC will be helpful.

Has the decision of when this will occur already codified? Is there any reason why it cannot be decided now a long time before it matters?

It would be nice to solve a potentially important issue like this now in code instead of one day needing to debate the issue after it becomes contentious (like the blocksize today).

To the best of my knowledge this has not yet been codified and it is hard to imagine there being a need to smaller Bitcoin increments anytime soon.

At this point smaller increments would suffer transaction relay problems without the addition of a miners fee far in excess of the Bitcoin being sent.

This could be settled now by scheduling the change based on Bitcoin valuation. However to do that we would need to agree what to measure BTC valuation against?

Gold perhaps?
World GDP?
International wire transfer volume?

Setting the benchmark to trigger the change to adding more decimals may lead to more debate.


In NXT, how long do you have to wait for 1440 blocks to be mined? I see this referenced in many places with NXT for 1440 blocks. How long is that exactly?

1440 blocks in nxt is about 24 hours. Since nxt blocks are generated every minute, thats 1440 minutes.

1440 minutes / 60 minutes = 24 hours

NXT block generation isnt exactly 1 minute as some blocks are solved once every few minutes, but on average its about 1 minute. Hence the 1440 block mentions you see everywhere.


Bitcoin client behavior in event of a fork What happens when a forked chain becomes longer than the main block chain?

Let's assume the forked chain that just became longer has no transactions in it, so it is as if every transaction in the last n blocks never happened.

As I understand it, the official Bitcoin client will recognize that any recent transactions it sent no longer exist and will re-broadcast them. By question is,

What age transactions will be re-issued? Will a transaction that is years old still be reissued? What's the cutoff?
Does the exact transaction get reissued or does an equivalent transaction get created? i.e. will it attempt to send the exact same Bitcoins (which, due to the fork, might no longer actually be owned) or will it create an equivalent transaction based on Bitcoins that it still owns? What if the client doesn't have enough Bitcoins?

Edit: Since I can't find where I first saw it anymore, I guess I should also ask: does the official client, in fact, reissue transactions in the event of a block chain fork?

In the case of a reorganization, the transactions that were 'lost' in the previous longer chain are moved back to the memory pool, under the condition that they are valid in the new chain. This means that if the inputs do not exist anymore in the new chain, they are lost. This is precisely how a "double spend attack" works: try to fork the chain, and spend the coins in both branches.

The effect of moving transactions back to the memory pool is only that the client does not forget them (it will not reannounce, or download them from peers when told about them), and if the node is a miner, they will be candidates for inclusion in the next block created.

In general, this means that there are no retransmits: miners and the rest of the network try their best to not forget about these lost transactions. If that fails however, and for some reason (too little fee, for example) the transaction does not survive, it is the responsibility of the node that originally sent the transaction out to rebroadcast. So yes, there are retransmits as well, but only by the original owner, and only when it detects the transaction is not or no longer in the block chain.

It's always a byte-for-byte identical transaction, not an equivalent using different inputs.


Where are the Diablominer Config Settings stored in Mac OSX? I can't find them any where.  Note, I'll admit I'm a new Mac user, so I may be missing an obvious location, however, I can't find it in my personal folder.  Any suggestions?

Correct locations might be either ~/Library/Application Support/Diablominer or ~/.diablominer

Of course it might be in in an incorrect location. Super Meat Boy, for instance, stores its configuration inside the .app itself (brrr). To check there you have to right click the app and "show package contents".

The best way to find this configuration file, if you already know at least the file name, is casting find ~ -name filename, hoping at least it is somewhere in your home directory.


A NodeJS implementation on creating addresses from a Bitcoin (zpub, xpub) address I'm looking for a lightweight node package which can handle creating btc receiving addresses on the server using an extended public key (segwit).

Like this one: zpub6nYqvTejCbqMTRTGz9rHkJnrJKbLsx36LqLnUJChDdJ6a5NA7hBumEpn9HTSDgWpNTNCponkPCBL5VKeAaScVxbXa1H4RPmA4j19rzgJPRp

I tried using https://www.npmjs.com/package/bitcoin-receive-payments
But I don't want an OpenExchangeRates account to use this.

There is this guide on PHP https://freedomnode.com/blog/58/generate-bitcoin-wallet-addresses-from-extended-public-key-with-php

But I can't find any equivalent for JS.

I would also be very thankful if there is any explaination for non Math people, as I am just looking to generate addresses on a server based off an extended address.

Someone knows?

I would suggest using a library such as the bitcoinjs-lib library.

Here's a very stripped down example usage:

let bitcoin = require("bitcoinjs-lib");

function fromXpub(xpub, acctNumber, keyindex, callback){
    let address = bitcoin.HDNode.fromBase58(xpub).derivePath(acctNumber+"/"+keyindex).getAddress();
    callback(address);
}

let myxpub = "xpub6C6RXXtdbxSnfB78Y4WjJSjQuChKqHXh9JCZPeKtdGeWRiptL9oJePPtrYKPWaoem9W3Wvp8eEh8dFFuN7u4zT6x6A1H6D67bVVvufv3uJ1";

fromXpub(myxpub, 0, 0, function(cb){
    console.log(cb);
});

    13eX3ohuXCa93YgLCkuQF6NmJk8vUwqa8p


How do SPV clients apply a new block? SPV (lightweight) users do not have a chain. (Well, some SPV users have a fraction of the full chain, but some SPV users only have block headers. Am I correct?)

If a block is created by a miner and a SPV user receives this block, he must append this block to the existing block chain, but this SPV user does not have the blockchain in this case, so what does SPV user do with a block when he receives it?

Do they just attach its block header to what the SPV user has at that time?

SPV (lightweight) users do not have a chain. (Well, some SPV users have a fraction of the full chain, but some SPV users only have block headers. Am I correct?)

SPV clients only keep track of the block headers, usually rely on other nodes to do the block validity verification, and do not keep any full blocks around. This may seem similar to a pruned node that only keeps a portion of the latest blocks, but is entirely different. Full nodes need the complete blocks to update the state of their ledger (the UTXO Set), pruned node fully verify each block and later discard part of the original chain. This only means that they cannot serve all blocks to other nodes and that they have to download the blocks again if they reindex, but they always have verified the full blockchain themselves. SPV nodes only track the block headers, and when they're interested in a block consume that block fully. Only then do they do some sanity checks like verifying that the block is well-formed. However, it's impossible to verify a single block fully without verifying all of its predecessors, so SPV nodes inherently trust their peers to serve them the correct blockchain.

  If a block is created by a miner and a SPV user receives this block, he must append this block to the existing block chain, but this SPV user does not have the blockchain in this case, so what does SPV user do with a block when he receives it?

SPV clients don't keep track of the full ledger, they only track the state of transactions that they created or that got sent to them. SPV clients use one of multiple methods to find out whether a block includes any interesting transactions such as delegating this completely to third parties (e.g. wallet service, Electrum server), requesting full node peers to run the SPV client's BIP37 bloom filter on any new blocks, or searching the fairly new BIP158 Compact Block Filters. Once the SPV client has identified that they're interested in a block, they either request the full block to get the actual transaction data, or they ask for the Merkle branch and the transaction.

  Do they just attach its block header to what the SPV user has at that time?

Yeah, SPV clients keep a chain of all block headers, and for any transactions they're interested in, they keep the Merkle branch that ties the transaction to the block.


How is a Transaction protected from tampering before inclusion in a Block? Using the terminology from: https://en.bitcoin.it/wiki/Protocol_specification#tx

What prevents an attacker operating a rogue client from replacing the tx_out[] of a transaction with values that assign the output of the transaction to the attacker?

The tx_in[] is unchanged (and presumably valid), but the outputs now benefit the attacker.

A new hash can then be calculated and announced by the rogue client using the inv message.

If nothing prevents this occurring, how does the Bitcoin network prevent this rogue transaction from being included in a block?

[Not having anyway to comment at this point]

Thanks David, that clarified greatly my [mis]understanding of the documentation at:

https://en.bitcoin.it/wiki/Script#Crypto

The OP_CHECKSIG description says in part:

  The entire transaction's outputs, inputs, and script (from the most
  recently-executed OP_CODESEPARATOR to the end) are hashed.

I'd thought "the entire transaction" was the preceding transaction, not the redeeming transaction, that was signed as you describe.

Thank you again for helping me out.

The entire transaction (except for the signatures) must be signed with the appropriate key for each transaction output it claims. Tampering with any of the outputs with invalidate all the signatures.


Why do I have to update my node version if I am up to date? So a few months ago I unplugged my bitcoin node when it was running perfectly. So when I connected it again this week I had to let it sync to the blockchain again. Now you can see it's synced but I have several issues.
It tells me to update the version when v0.19.0.1 is totally up to date. And if I need to update, how do I do it?
Secondly I don't know but it says that my node is unreachable (I cropped out the IP address). How can I fix it?

Thanks

Your node is not up to date: the latest release of Bitcoin Core is 0.19.1 which is a newer release than 0.19.0.1.

You appear to be using a RaspiBolt. The RaspiBolt project's FAQ addresses your question here: How to upgrade Bitcoin Core?.

Regarding the reachability, your best bet is likely to raise an issue on the project's GitHub page (which it appears that you have done already).
There are some issues asking about nodes being unreachable on the project's github page, but I don't know more about that.


What is the format of the value of a transaction in the litecoin ledger Feeling a little silly here, I can decode the entire rest of the data in the blockchain, but the "value" field of a transaction output makes no sense.

[0,-14,5,42,1,0,0,0]

This decodes to "50.00000000" but I can't see how.

The remainder of the block decodes correctly, so I am fairly sure I'm looking at the right data. It doesnt seem to be in the same format as the bitcoin value (/10^8)

The transaction format was never altered in the clone Tenebrix or its clone Litecoin. The bytes you have posted are correct, and do indeed decode to 50 BTC when read out as an unsigned, little endian, 64 bit integer.

~> python
>>> import struct
>>> struct.unpack("<q","\x00\xF2\x05\x2A\x01\x00\x00\x00")[0]
5000000000