text:
What actually caps Bitcoin's supply at 21 million?
I have seen everywhere that the total BTC supply is permanently capped at 21 million. I understand blockchain, cryptography, SHA256, etc... generally, but where/what is actually capping the supply at 21 million? Looking this up online usually leads to generic 'its written in the code' and this stack question seems to point to the code, but I do not understand it. Is the supply cap really just some hard code in the original protocol? Is this modifiable?

What actually caps Bitcoin's supply at 21 million?

Consensus rules
The supply is capped by the so-called consensus rules that every Bitcoin node enforces.
New coins are minted as block rewards by miners. Every node that receives the new blocks checks that the block reward is not greater than the current limit per block. Any block that exceeds this limit is deemed invalid by every node that receives it and is discarded and not passed on. Any node that passes on a block with an excessive mining reward is in danger of being ostracized by other nodes.
Nodes are made to distrust any other nodes that seem to be acting contrary to the established rules.
One of those consensus rules is the halving of mining rewards every four years approximately and it is this halving that causes the total supply to converge toward 21 million.

Note that many Bitcoin terms are arguably poorly chosen and misleading. This is one of them. These rules are Bitcoin rules or hard rules. Don't get hung up on the word consensus or dictionary definitions of that word.

Is this modifiable?

Rule changes can result in a fork. This can result in the creation of an altcoin. An altcoin is a cryptocurrency that is distinct from Bitcoin and seen by some as an alternative to it (hence the alt in altcoin). One example would be the altcoin "Bitcoin Cash" (BCH) which is the result of rule changes made by a small faction of Bitcoin (BTC) users. The proponents of this change had originally hoped that almost the whole Bitcoin community would adopt their rule changes. If they had succeeded, Bitcoin would now be using the rules of Bitcoin Cash and Bitcoin Cash would not exist. They failed in that original goal.
It is possible to make some rule changes in a way that doesn't trigger the distrust of other nodes that are still using the older rules.
This is a bigger topic than I can cover here but there will be good answers to existing questions on this subject:

What is a soft fork? What is a hard fork? What are their differences?
Would it be possible to create a soft-fork for reducing miner reward?
How do we know which soft-forks were implemented using User-Activated Soft Fork or Miner-Activated Soft Fork?

Tangentially related questions

Transaction blocks vs bitcoins (convergence toward 21M)
Why was the upper limit of 21 million bitcoins put in place?

There are many theories on this, but I'm inclined to believe that Satoshi wanted to pick the maximum number allowed in 32-bit (which is 2147483647); however Satoshi admitted in an e-mail to Mike Hearn that the value was somewhat arbitrary as well.
Below is a visual of that 32-bit int max.

That number (max 32-bit) is 2.1 billion, not 21 million. I'm not sure I follow your reasoning here.


text:
Zpub vs xpub not matching between seedsigner and sparrow?
Generated a multisig xpub via Seedsigner. Loaded this to sparrow via camera-reading of seedsigner's QR code. Sparrow & Seedsigner fingerprints match, as do derivation paths, but Seedsigner displays Xpub as: ZpubXYZ while Sparrow displays Xpub as: XpubABC. Why is this? My cursory understanding is just that these are different formats of the same thing, but how can I verify that Sparrow has correctly imported this information if the displayed Xpub's don't match? Just verifying the fingerprint match is sufficient?

It is simply a different format. Sparrow can toggle between zpub and xpub configuration (as a display) and you can thus verify the xpub in this way as well.

source: Stack Exchange

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

sort: votes


text:
Snap Install Bitcoin Core on WSL Ubuntu 22 doesn't add binaries to PATH
I'm trying to install bitcoin-core on my WSL Ubuntu 22. I've already snap-installed bitcoin core on my bare bone Ubuntu 22 and once completed it adds to the path the binaries bitcoin-core.{cli,daemon}, and everything works fine.
When Installing on WSL Ubuntu 22, I do snap install bitcoin-core, it says everything is fine, but the bitcoin-core binaries aren't added to my PATH. I've tried restarting my shell session, searching in /usr/bin, /usr/local/bin and other known binary paths but I'm not able to find out the bitcoin-core binaries location. Any hint?

Please take a look at what to do when someone answers.

Did you look in /snap/bin/? That's the normal place snap installs to

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


text:
Spending paths for subset of n-of-n multisig
I would like to achieve the following.
A group of N people come together and create an n-of-n multisig. Each of them funds this multisig with a custom amount of bitcoin. At some point in the future, they decide to spend these funds, however a subset K of the initial group has disappeared or is not reacting anymore.
Is it possible to achieve the following behavior:

The K people who are not reacting are getting their initially contributed funds back
The remaining (N - K) people, who are available to sign, agree together where the remaining funds are sent to. Basically as if the multisig had been an (N-K)-of-(N-K) to begin with.

I thought one possible way (please correct me if I am wrong) would be to use some taproot functionality and include various spending paths in the merkle tree that allow all possible subsets of users to spend as described above. This would be achieved by presigning a bunch of transactions upon the creation of the multisig that use these different spending paths. These transactions are signed in a way that outputs returned to the non-reactive users are defined ahead of time and for the rest of the funds, the remaining users need to decide and agree unanimously where they want to send them to when the time for it has come.
Would this work? Even if the answer is yes, with a growing number of users N, the combinations of subsets explodes which makes this infeasible, so maybe there is a better way.
Thank you very much for your feedback!


text:
Long Vanity Addresses
Just stumbled upon this address:
https://www.blockchain.com/explorer/addresses/btc/1HELPAKUTA4n4YdpYQSEK2Rhot6ZnL5P8Y
It sent a small amount of Bitcoin to some well known Bitcoin wallets on 2nd of December 2023. I think generating such an address should be computationally feasible.
However, this address sent Bitcoin to addresses like: https://www.blockchain.com/explorer/addresses/BTC/11PLEASExHELPxNEEDEDxASAP11tvgYg5
Such an address should be impossible to generate, correct? Do you agree that no one should have the private keys for that address. They just sent some BTC to it and they are now forever lost.
What is this all about?

Impossible in the non-theoretical sense, yes. If you have a closer look at the transaction spending to the 11PLEASE... address, you also see an OP_RETURN with text begging for donations to the 1HELP... address. There are also some other impossible/unlikely vanity addresses involved, and lots of other outputs. I'm pretty sure this is just spam.


text:
Security Of Public Bitcoin Nodes / Servers
I have been wondering about the security of using public bitcoin nodes with your wallet. E.g. sparrow wallet offers three connection options (public nodes, your own bitcoin core node or a private electrum server with bitcoin core) and the docs recommend to use your own bitcoin node / electrum server if you are storing larger sums.
I see the point that using your own node offers more privacy (which in turn can offer security in the sense that no one knows your addresses which could make you a target), however, I don't see how using a public server is inherently less secure from a cryptographic standpoint.
I mean, I am still signing my transactions with my private key. Sure, the public node could just not broadcast my transactions or even show incorrect balances to me but it cannot fake or alter my transactions.
Do I see something wrong here? Would be curious to hear in what way a public node could be problematic from a security standpoint. Is there some detailed guide explaining the possible attack vectors that a private node mitigates?

I mean, I am still signing my transactions with my private key. Sure, the public node could just not broadcast my transactions or even show incorrect balances to me but it cannot fake or alter my transactions.

This is all correct.

Do I see something wrong here?

No, but I think you're missing that only you being able to sign transactions over your coins is just a small aspect of using the currency.
If you trust another party to determine your balances/payments/coins, they can make you believe you were paid while you weren't. If that happens, your transactions (which indeed, only you can sign) will be spending non-existing coins.

Public nodes can potentially link your IP address to your Bitcoin addresses. This might not be a significant issue for everyone, but for those who prioritize privacy, running your own node helps in keeping your transactions more private.
When you connect to a public node, you are trusting that node to provide accurate information about the state of the Bitcoin blockchain. While most public nodes are run by reputable individuals or organizations, there is a level of trust involved. A malicious public node could, as you mentioned, selectively choose not to broadcast your transactions or provide incorrect information.
If the network connection between your wallet and the public node is compromised, it could potentially be exploited. Running your own node locally can reduce the attack surface.

Thank you for your comment. Could you elaborate how a compromised connection between me and the public node can be exploited? Aside from the mentioned censoring and providing incorrect blockchain state data, I don't see other potential attack vectors. As long as I sign my transactions with my private key, worst case is that they are not broadcasted.

If an attacker can intercept the communication between your wallet and the public node, they might attempt to alter your transactions or gain information about your wallet's activity. And Potential exposure of your IP address, Manipulation through the setup of fake nodes, Analysis of metadata revealing patterns in your wallet activity, etc. many users may not encounter such issues with reputable public nodes.

I don't see how an attacker could alter my transactions. He can censor them, yes, alter no.


text:
Electrs server setup for local network
I have a machine (192.168.1.66) on a local network serving Electrs that's syncd to the tip (netstat -ntlp shows that electrs listening on 127.0.0.1:50001). But I have another machine (192.168.1.68) using SparrowWallet/ElectrumWallet that cannot connect to the machine hosting Electrs (e.g ./ElectrumWallet --server 192.168.1.66:50001:t will not connect/ SparrowWallet shows connection refused), what could be the problem? I am also wondering if using electrs as a trezor backend requires encryption or it can be running unencrypted

You might need to add this into your Electrum Server config file:
electrum_rpc_addr="0.0.0.0:50001"

I assume you meant the config file provided when you start up the electrs binary (which is in my ~/.electrs/electrs.config) but I did make that change and it didn't seem to help

@BillyT Did you restarted the electrs after the change, right? Weird, I had a similar issue and this fixed for me. What is the output of this command on the other machine $ telnet 192.168.1.66 50001?

Unable to connect to remote host: connection refused for telnet on a different device. Though on the same machine hosting electrs I can telnet 127.0.0.1 50001 and connect

Sure, on the same machine it should work. Are you running any firewall like ufw or something like that? If so, enable the port

I do not have ufw installed, I just have a fresh ootb installation of debian12. I installed ufw and sudo ufw allow 50001/tcp but it made no difference

No luck either with iptables sudo iptables -A INPUT -p tcp --dport 50001 -j ACCEPT still gives me connection:refused

I found the problem, such a stupid mistake. The systemd service I had was running arguments in the execution path which overwrote the config I supplied so nothing was changing, it works fine with 0.0.0.0:50001, however now I am trying to connect but it's taking a very long time and ends up with Retries exhuasted at least for sparrow wallet, the machine is pretty horrible (old random laptop that even lags when rdp'd into) I assume this is just a hardware problem?


text:
Bitcoin Clients Backward compatibility
wondering if I ran a 0.1.0 version of bitcoind today, would it sync and would it operate as normal?
As I understand at the time it was only using P2PK, would 26.0 reject it?
Also, many changes occurred such as OP_RETURN change from 80 to 40 bytes, how is it a soft fork then?
Thanks

Does this answer your question:  Does a 2009 node sync the whole bitcoin blockchain also see What is a soft fork...

I think the linked answers mostly address your question, but if not, let me address the specific examples you bring up.

wondering if I ran a 0.1.0 version of bitcoind today, would it sync and would it operate as normal?

It won't, but not due to block/transaction validity rules that have changed, but because the P2P protocol has changed (the initial packet has a checksum now since 2012, which pre-0.2.10 nodes don't support). I believe it's possible to write a simple proxy to address this (which just adds the checksum in one direction, and removes it in the other), in which case a modern node would be able to talk to very old Bitcoin code.
Another issue is that peer discovery has changed completely. A 0.1.0 node simply won't discover any IP addresses of peers to talk to. This can be addressed by manually connecting.

As I understand at the time it was only using P2PK, would 26.0 reject it?

This is not correct. The "1..." address format corresponding to P2PKH outputs was supported already in 0.1.0. Furthermore, the Bitcoin script system has existed since 0.1.0 as consensus rules. All modern address formats are valid scripts according to the very first release. Also in the other direction, the addresses and outputs the built-in wallet in 0.1.0 uses (P2PKH and P2PK) are still perfectly valid and standard by modern software, so it would be able to receive payments from modern software.
If your question is whether 0.1.0 would be able to transact (as in create transactions that are accepted by the network), it's a bit more tricky. A number of consensus and policy rules have changed. I don't think any of these actually matter, except for the BIP62 low-r policy rule. This would result in only a small percentage (25% or less, depending on circumstances) of transactions created by 0.1.0 to be acceptable to modern rules.

Also, many changes occurred such as OP_RETURN change from 80 to 40 bytes, how is it a soft fork then?

That was just a policy change, it didn't affect consensus rules, and thus has nothing to do with softforks.
There have been softforks (and hardforks, in very early days) since the 0.1.0 release, however none that actually impact the current chain. So to be clear: my belief is that the current Bitcoin blockchain would be entirely valid according to 0.1.0 (but see the linked answer, it would be extremely slow, and would need configuration changes to not trip over).


text:
Formatting an external ssd
2 questions about bitcoin core
i formatted the ssd and used exfat, i'm using windows, should be ok, right??  or should i cancel my block download remove Core reformat the drive to NFTS and start again
second question i put the default directory to the E: drive, the ssd, but the installer still created a folder called Bitcoin in my c:/ program files
i don't suppose it's a big deal i just want the node to work and not be pruned, so i bought a 2 tb samsung T7

Well, I think the folder on C drive was from the old installation I removed 4 days ago, so I just shift-del, didn't seem to affect the block download, so there'


text:
How can I know the Bitcoin Transfer Transactions on Bisq?
I am trying to get some blocks from Bisq.
I used their API to get the blocks. Then I discovered that blocks are missing some inputs, so I used their API again to get these transactions.
But, I discovered that these transactions contain just the BSQ transfer, and the fee payment transactions (in BTC). I was not able to see the transactions related to the Bitcoin Transfer. How can I get the Bitcoin Transfer Transactions from Bisq block.
To give an example:
Here is a Bisq transaction (012ffb03e13a50902b8cc898dbad984cb6f4055cad97e33f2d1a627facf3fabf).
I used Bisq API to get it. The height of this transaction is 713592, When I looked for this transaction of Bisq (here) I found that it has 0 transactions.
This is a MultiSig transaction, but I do not have any transaction like that on Bisq blocks, even when I get the blocks or transactions by Bisq API.
Is there a way I can get the Bitcoin Transfer Transactions (MultiSig) from Bisq blocks, or another way to get them?

Since other blockchain explorers show transactions in that block - you should probably ask customer support at Bisq why you get the results you do.


text:
Is there an API for getting the balance of a Wallet Descriptor?
I want to automate the process of getting a balance from a multi-signature wallet within my web application and am looking for a way to derive it from a wallet descriptor. The information I am provided is the descriptor so my current approach is to parse the descriptor, find the public keys and then generate addresses with a gap limit of 20 for those master keys using an API call for each of the keys to find the balance. However that is extremely tedious and I would like to outsource that work to an API.


text:
What are ALL the consensus rules?
I asked this question before, and it was quickly locked and pointed to a thread about mempool policy... yet my question remains unanswered.
Let it be known, I don't want to know what policy is [or is not], any further than understanding why policy is included in the Consensus code as seen in the following locations:
https://github.com/bitcoin/bitcoin/blob/master/src/consensus/
https://github.com/bitcoin/bitcoin/blob/master/src/consensus/amount.h
https://github.com/bitcoin/bitcoin/blob/master/src/consensus/consensus.h
https://github.com/bitcoin/bitcoin/blob/master/src/consensus/validation.h

TX_INPUTS_NOT_STANDARD,   //!< inputs (covered by txid) failed policy rules

TX_NOT_STANDARD,          //!< otherwise didn't meet our local policy rules

TX_MEMPOOL_POLICY,        //!< violated mempool's fee/size/descendant/RBF/etc limits

TX_RECONSIDERABLE,        //!< fails some policy, but might be acceptable if submitted in a (different) package

(1) If policy is defined as "everything that isn't consensus", yet those policy checks are included in the consensus files... what exactly are they doing there?  Are they deprecated?
(2) Are ALL of the consensus rules included somewhere in these consensus files?  I'm assuming not.  So, I ask...
(3) Could we compile a list, perhaps, of everything that a valid block would need in order to be accepted as valid that is NOT already included somewhere in these consensus files??

(1) If policy is defined as "everything that isn't consensus", yet those policy checks are included in the consensus files... what exactly are they doing there? Are they deprecated?

No, not deprecated. There isn't a clean dividing line in the Bitcoin Core file system where say one file only checks policy rules and one file only checks consensus rules. (See this StackExchange post from Suhas Daftuar discussing consensus and policy subdirectories). This is for various reasons. One is the inheritance of the codebase from Satoshi who created a large bundle of code that although refactored and cleaned up over a decade by Core contributors still bears a resemblance to what they inherited from Satoshi. Perhaps more importantly it is really difficult to outline what all the consensus rules actually are because there are edge cases where you think the code you're touching isn't consensus related but then it turns out you introduced a consensus bug that results in a potential chain split. Pieter Wuille discussed this on the Chaincode Labs podcast in 2020:

One of the things I think learned from that is specifying what your consensus rules is really hard. That doesn’t mean you can’t try but who would’ve thought that a configuration setting in the database layer you are using actually leaked semantically into Bitcoin’s implicitly defined consensus rules. You can attribute that to human failure of course. We should’ve read the documentation and been aware of that.
There could be a bug in your C library. There can be a bug in your kernel. There can even be a bug in your CPU.
We can talk about the boundary in trying to abstract the part of the codebase that intentionally contributes to consensus but it is very hard to say clearly this code has no impact on consensus code because bugs can leak. I think one of the things to learn there is you really want software that is intended for use in a consensus system where not only you have the requirement that if everyone behaves correctly everybody accepts the right answer but also that everybody will disagree about what is an invalid piece of data in lockstep.

(2) Are ALL of the consensus rules included somewhere in these consensus files? I'm assuming not. So, I ask...

No. There have been attempts in the past to create a consensus library (libbitcoinconsensus) and more recently libbitcoinkernel that Carl Dong has discussed and contributed to but it is really hard. Consensus is a really slippery concept in Bitcoin.

(3) Could we compile a list, perhaps, of everything that a valid block would need in order to be accepted as valid that is NOT already included somewhere in these consensus files??

If you mean like an exhaustive list in the English language then you're going to struggle. You can try and you can probably include most of the obvious things but it is the edge cases and things that seem they are entirely non consensus related that turn out not to be which will be missing.


text:
NBitcoin -- How do I just check the balance of my wallet from my seed phrase?
I've looked through the docs, I've Googled, I've searched here, and it all just seems like Greek to me... I must not be using the right keywords, because I just can't figure out what I think should be the most dead-simple thing...
How can I use NBitcoin to open my wallet from my 12 word seed phrase and look at the balance? I feel like if I can just get some help getting that far, I can probably go from there to do more...
Also, does NBitcoin have an API reference guide?
Thanks all!

Use var key = mnemoObj.DeriveExtKey(); then you can derive addresses as explained in this chapter (https://programmingblockchain.gitbook.io/programmingblockchain/key_generation).
mnemo = new Mnemonic("minute put grant neglect anxiety case globe win famous correct turn link",
                Wordlist.English);
hdRoot = mnemo.DeriveExtKey("my password");

thanks, this finally got me started


text:
bitcoind -daemon command error
Im trying to open bitcoin core withthe command
bitcoind -daemon
My node is working perfectly with GUI
But When trying to run bitcoind -daemon
error: Could not connect to the server
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.

Any help?
For some reason its showing i am in Prune mode?
Im not sure if this is the cause of the error if so please instruct me to fix this
Cheers

You should be using bitcoin-cli to connect to bitcoind. Can you also post your debug.log  file?

I have changed the bitcoin.conf file to prune=0 to correct the error tho now im getting this error trying to restard of prune mode.
You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain.
Please restart with -reindex or -reindex-chainstate to recover.
Error: Error opening block database
Any help here ?

Are you trying to run the GUI and bitcoind at the same time? How are you running the RPC client? Is the GUI running with -server? There are a lot of relevant details missing here.


text:
What literal thing is determining the price of Cryptos / stocks?
Yes, supply and demand I know. But what literal thing is determining the price. When I see the price changing every second on Coinbase or Robinhood, what is controlling that. Is it an algorithm? What information does that algorithm take in? Is it just one algorithm determining this price, or are there different algorithms and it’s just an estimation? I have never found an answer to these questions.
What I want to know is what physical place is an app like Coinbase getting this changing price from.

Does one of these three perhaps answer your question?
Is there some way to estimate the proper value of one Bitcoin?, How is the exchange rate for Bitcoin established?, Where do bitcoins come from and what gives them their value?

The "current Bitcoin price" from an exchange like Coinbase is simply the last price at which a buyer and seller agreed to trade Bitcoin at that exchange, also known as the "last price". Every time a new trade takes place on that exchange, the price is updated.
The current price from sites that aren't exchanges themselves, like Robinhood or Preev, are generally taken as the averages of the prices of all of the exchanges they connect to. Sometimes these averages are weighted, so that the price from exchanges with higher trade volume is weighted more heavily than the price from a very small exchange.


text:
Is one blockchain of one exchange place the same blockchain used in other exchange places?
Sorry if the title is confusing, here is what I mean.
I recently threw some fiats in Kraken and invested in Bitcoin, the first interrogation I had was "Can I see my transaction publicly on the internet if I could find the right block used for it?".
But on a large scale this interrogation translates to "Is each exchange platform implementing their own clone of the Bitcoin specs or is there a general blockchain that rules the entire decentralised financial system?"

As long as your Bitcoins are in Kraken and you haven't withdrawn them, then the Bitcoins aren't actually recorded on the blockchain -- Kraken just has a line in their database saying they owe you a certain number of Bitcoins. You wouldn't find this on the blockchain until you actually initiate a withdrawal of your Bitcoins from Kraken.
Every Bitcoin exchange, and every Bitcoin user in the world, when they do publish to the Bitcoin blockchain, publish to the same blockchain though.


text:
What prevent someone to not use the receiver address of one transaction as the sender in another one?
Title may be confusing you, and to be honest I am also confused how things work and I am new to this crypto world so sorry in advance if I am not using the correct words.
I try to explain :
Let say Alice wants to send cryptos to Bob.
A sends to B
(address of A) to (address of B)

Because blockchains are public, and both address will be known to each one, what process do prevent Bob from not using Alice address as the sender in another transaction ?
B pretends to be A
using A to send to B
(address of A) to (address of B) without A consent

The reason why I am confused right now about this question is because in Dapps you can use a wallet like Metamask to make some transactions, which means you only needs an address. So how is that secure.
If someone code a program using the same logic as Metamask, what prevents him to use another person's address in Dapps and to smart contracts? (Similar to changing the ip field in http requests, which was a popular hacking technique for man in the middle before https was widely used).
Thanks in advance for helping me to understand.

"... in Dapps you can use a wallet like Metamask to ..." That seems to be about Ethereum not Bitcoin. You can ask about Etherium in etherium.stackexchange.com. This Q&A website bitcoin.stackexchange.com, is for questions about Bitcoin specifically.

Did you read my whole question ? I used Dapp as an example, but my question is still relevant to this Q&A. Thanks for your suggestion though.

what process do prevent Bob from not using Alice address as the sender in another transaction

Bob doesn't know Alice's private key.

A transaction requires that a kind of digital signature be included with the amounts being spent (e.g. From Alice's address)  All other Bitcoin users (wallets, miners, etc) check the signature.
the signature is just a complex mathematical process that proves someone knows a private key without ever disclosing the private key. The private key is just a large number that is kept secret by the user (e.g. Alice).

Further reading:

Is it true that all the bitcoins in existence are on the blockchain (the ledge), but it just depends on who the owner (address) is?

Some other things worth remembering:

Bitcoin has rules but no rulers.
Bitcoin is electronic cash
There are no accounts in the Bitcoin network
Wallets don't contain money.
Addresses don't identify people, businesses or places.
Bitcoin isn't sent to, or from, addresses.
Bitcoin is never really in transit.
Bitcoins don't survive transactions.
Bitcoins don't exist as entities.
The blockchain is not a ledger (it's a transaction journal)
Miners don't have any special privileges (they exercise a role that has two special rewards).

The above are intended to guide readers away from misconceptions, not as a self-evident explanation of the points made.

But when you use an exchange platform like say Binance, you don't have the piece of software on your computer, does that mean technically they hold the private key of all the investors on the website, and hypothetically they could use them to force fraudulent transactions behind the curtain ?

@vdegenne yes they could do that. ”Not your keys, not your coins” is a popular saying for a reason.

@vdegenne: Yes. The inventors of Bitcoin wanted to create a currency that had no need for such trusted third parties. That was perhaps the major motivation. If you give your money to exchanges or other custodial businesses then, so far as the Bitcoin network is concerned, you control no Bitcoin -- which is the same as owning no Bitcoin.

In addition to what @redgrittybrick wrote, it is also relevant to understand that bitcoin uses what is called an ‘unspent transaction output’ (UTXO) system for keeping track of coins, not an ‘account system’.
So when a coin is spent, it cannot be spent again. There is no ‘from’ address in a bitcoin transaction. There are just inputs, which are consumed entirely in the transaction and thus cannot be spent again later.
This, along with the cryptographic signature that @redgrittybrick explained, make it so that you cannot steal funds simply by ‘replaying’ a transaction.

But if you can't "replay" you can make a new one, supposing you have Alice private key, right ?

@vdegenne yes, anyone with the private key can spend the funds locked to the associated bitcoin address. This is why private keys are to be carefully guarded, and transactions are affixed with a cryptographic signature made by the private key, not with the private key itself.


text:
I want to run bitcoincore-qt in private main net
I want to do mining with python to test my my python code.the mainnet difficulty is high and also the testnet dificulty is high and the regtest does not need pow.does anyone know how i can test my python code and submit the results in bitcoincre-qt? with minimum difficulty in the mainnet? or is there any other way to test my code full functionality ?

Regtest actually does need PoW, albeit at just a marginal difficulty. I suggest you use that.

my regnet works fine,but the mining is not getting done in my side and it is getting done by bitcoincore-qt .am I wrong?


text:
What is the max allowed depth for bip32 derivation paths?
Generally I see that bip32 derivation paths are something like m/1/2/3/4, etc
How deep is allowed? Is there a limit on how deep the tree can go?

A path can have, at most, 256 elements, including the master. This limitation comes from the extended public key serialization format's depth field. This field is a single  byte which means it only has 256 possible values.

I dont get it. What happens if I try to get 'm/44/0/0/666' address?

Nothing happens, that's a valid path. Depth is the number of elements; basically the number of /'s. The actual value of each element can be a at most 2^31 - 1.


text:
Developing omni USDT wallet APIs?
Is it me or does anyone find references to developing Omnicore USDT wallet REST APIs really hard to get?
I'm looking to develop 5 standalone APIs which are:
 1. POST: Send Transaction (signs and return tx hash)
 2. GET: Check Balance
 3. GET: Generate USDT Address & Private Key
 4. GET: Get Tx Hash Details
 5. GET: Get Address Transaction History (array object)
Any procedure to setting up node on AWS to developing the API in NodeJS and connecting NodeJS App with the node is much appreciated!


text:
Can you recover seed words with passphrase on bitcoin node?
I have a btc node (Bitcoin Core version v0.17.0.1 (64-bit))running on my Windows 10 computer, as part of regular backup I have realized I don't have the seed words but I do have the passphrase. It has a zero balance, wallet.dat is backed up - is there a way to recover the seed words in this scenario? I'm never going to use a Windows node to store any significant amount of coin, but I'd still like to know what my options are.

Bitcoin Core does not use a seed phrase. Your password is simply the encryption password for the wallet.dat file. No private keys are derived from the password. In order to recover your Bitcoin, you must have the wallet.dat file.

I'd like to add that the correct way to backup the wallet.dat file is using the functions provided by bitcoin core and not by simply copying the file from the data directory. Use the backup option in the file menu or the RPC command.

Can you update your answer to clarify it. There is confusion between seed words and seed key which can be used for recovery


text:
Can we get a fixed rate of kWH to USD through bitcoin?
Assuming the energy to bitcoin rate of your choosing, what is the cost of one kiloWatt Hour, in USD?

Assuming the energy to bitcoin rate of your choosing

Market questions generally go out of date extremely quickly, and Bitcoin mining in general varies hugely in efficiency and availability of hardware. It is not as clear cut as working out the hardware level of efficiency at the chip level as this is only a small portion of the total power cost.

At a chip level, the hash engines have a specific cost per hash, minus any amount of failure rate, which is generally in the order of several percent of the work wasted.
At a miner level, where it converts incoming high voltage AC mains power to a lower voltage for use with the mining chips. This varies greatly with the design of the hardware being used, from tens of percent to just a few depending on the complexity and cost of the conversion.
At a farm level, where incoming transmission voltage is converted to mains voltage. This varies massively depending if the incoming supply is already designed for residential use (120v/240v), industrial use (277v/480v), or commercial distribution (tens or hundreds of kilovolts), and the efficiency of the hardware used.

It's therefor pretty hard to define even a cost per hashrate in the wider network, but once you know it it's relatively straightforward to convert it to a USD cost.

what is the cost of one kiloWatt Hour, in USD

This is the simple bit. They're usually specified literally as this price, for example in parts of north america 4c/kWh is fairly typical, but it varies extremely widely betwene location and provider anywhere from 1c to 35c.

This question is a bit vague, however if you're interested in energy expenditure cost there are many good articles on the macro view of Bitcoin mining costs. I've linked one below that is quite comprehensive.
Digesting ‘Quantification of energy and carbon costs for mining cryptocurrencies’

Link only answers are generally discouraged because they go out of date, and don’t really give an answer as such.


text:
dyld: Library not loaded when running bitcoind on a mac
I'm having trouble running bitcoind on my Mac (Sierra). I previously had bitcoind installed, compiled from source, but had to remove it when I was running low on space. I recently installed Bitcoin Core again, but this time I downloaded a .dmg file. It installed fine and I can run Bitcoin-Qt. Now, when I try to run bitcoind from the command line, or use bitcoin-cli, I get the following error message:
dyld: Library not loaded: /usr/local/opt/miniupnpc/lib/libminiupnpc.16.dylib
  Referenced from: /usr/local/bin/bitcoind
  Reason: image not found
Abort trap: 6
I don´t seem to be able to fix this. I might be an easy fix, but I haven´t been able to take care of it.
Anyone out there with an idea of how to solve it?

The answer below is likely not complete for your situation, but will get things rolling if you take the initiative.
A compiled executable that is statically linked is 100% complete for a particular computer architecture, and are much larger in size than dynamically linked executable that tend to port better across computers with varying architectures.
Your improperly functioning executables are using dynamically linked libraries instead of using statically linked libraries. Your executable(s) are looking for a dynamically linked library (file) in the /usr/local/opt/miniupnpc/lib/ directory called miniupnpc.16.dylib.
If you have Homebrew installed, a "% brew list" will indicate if miniupnpc package is installed. A "% brew ls -v miniupnpc" will identify the path where are the files miniupnpc package files are installed such as the dynamically linked lib/libminiupnpc.16.dylib library file or the statically linked lib/libminiupnpc.a library file.
You will need to read about the HOMEBREW_LIBRARY_PATH environmental variable and the DYLD_LIBRARY_PATH environmental variable used on a Mac.
The path for your command line interface and the *.dmg file are different.  Use the UNIX "% which bitcoind" or "% which bitcoin-cli" to identify what the command line path really is set to within your UNIX shell.

Thanks for great information.  It now finds libminiupnpc, as per the answer by MCCCS. Hwever, now I get: dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent_pthreads-2.0.5.dylib
It seems the link /usr/local/opt/libevent/lib/libevent_pthreads.dylib already exists. Shouldn't this be working already?
I was researching the environment variables you mentioned and it seems none of them are set.

Don't forget to % brew update prior to each % brew install package_formula. You will also want to research the PKG_CONFIG environmental variable associated with the pkg-config package. There are numerous mechanisms to enable dynamically linked libraries to be discovered during runtime. In your case, look for this file /usr/local/opt/libevent/lib/pkgconfig/libevent_pthreads.pc that probably needs to be found when compiling bitcoind. - Cheers

Here is a partial example for how configuring enables *..dylib files to be located
% ./configure --prefix=$HOME/Projects/BFGminer --build=$architecture --host=$architecture --target=$architecture CPPFLAGS="-I$HOME/Projects/BFGminer/UThash/uthash-master/src" PKG_CONFIG_PATH=$HOMEBREW_PREFIX/$HOMEBREW/Cellar/curl/lib/pkgconfig:$HOMEBREW_PREFIX/$HOMEBREW/Cellar/jansson/lib/pkgconfig:$HOMEBREW_PREFIX/$HOMEBREW/Cellar/libmicrohttpd/lib/pkgconfig:$HOMEBREW_PREFIX/$HOMEBREW/Cellar/libevent/lib/pkgconfig  --enable-scrypt --enable-opencl  --disable-debug

It is possible to install Hombrew packages in non-standard unprivileged locations to minimize the of privileged brew commands: doctor, man, update, install, uninstall, pull, link, unlink, pin, unpin that normally impact privileged directories. See environmental variables defined at github.com/Homebrew/brew/blob/master/docs/External-Commands.md. This allows package deconfliction when building disparate code bases somewhat analogous to docker by tweaking the paths to where packages are found. Share a little love please by up voting.

I'll summarize skaht's answer. Run this and it'll solve your problem:
brew install miniupnpc
ln -s /usr/local/opt/miniupnpc/lib/libminiupnpc.dylib /usr/local/opt/miniupnpc/lib/libminiupnpc.16.dylib


text:
Lost 2 of 24 words (12th&24th) on TON SPACE
I have made bad screenshot of mnemonic phrase, and lost access from Ton Space, 12th and 24th words are missing, i know all other words in a proper order, so only 2 are missing. Do you guys know any options to recover it with Python or any other codes, as I understand it gets harder as its TON Space and not trust wallet for example.
Also I know wallet from Ton Space, maybe its possible to put it to the code so it will make no mistakes.
Appreciate all of your help

Welcome to bitcoin.stackexchange .com, your question doesn't seem to be about Bitcoin but about the TON crypto currency.

This is not relevant for this forum.


text:
Trouble with initial blockchain download for setting up full node
I am keen on setting up a full node to support the bitcoin network, however I am experiencing problems after initial setup when downloading the blockchain.
My PC specs are 3.2GHz CPU, 2x8GB DDR4 2133mhz RAM, 3.25TB of SSD + HDDs & Radeon R480 GPU
All of my hardware seems to be fine, but after running memtest86 multiple times with different combinations of RAM seated in all the different seats etc, ive realised that one of my 8GB sticks is failing. For whatever reason, my current setup seems unable to get through the full download without failing and requiring me to start over. I restarted the blockchani download process with just one of my sticks of RAM seated, and its been stuck after about 72 straight hours of downloading (however the process isnt autofailing and closing the client anymore, like it was when i tried with both sticks of RAM seated.
I am wondering if there is any less resource intensive way to download a current copy of the blockchain without doing it directly through the bitcoin core client. Or, if anyone has an idea of something else i could do to get this up and running id greatly appreciate it
Thanks!

Are you storing the blockchain on an external drive? R/W speeds of the disk can significantly impact the duration of the initial synchronization. Related: https://bitcoin.stackexchange.com/q/9277/5406

It's downloading to an internal drive, but it's a HDD not SSD. my OS and regular data is stored on a 1TB SSD that only has 400GB or so free so I can't use that, the other SSD is only 250GB so that's ruled out, so I was downloading to a 2TB HDD. Is it worth moving data over to free up my 1TB SSD? How much will it speed up the process? I've currently been at it for about a week with leaving my computer on 24/7 and it reckons it's going to take weeks and weeks. It's only something like 22% done

1-Address the Faulty RAM: Since one of your RAM sticks is failing, replacing it should be your first step. Stable RAM is crucial for such resource-intensive processes.
2-Use a Pruned Node: If you want to reduce the burden on your system, consider running Bitcoin Core as a pruned node. This reduces the blockchain data size, making the download and storage process lighter.
3-Alternative Sync Methods: You can also look into using a blockchain snapshot (UTXO Set) to bypass downloading the full blockchain initially. This can save you time and system resources.

Pruning means less data is stored but the download process still downloads and processes the entire blockchain, it is unlikely to reduce memory requirements much. Using a snapshot is insecure.


text:
How Can ARK Protocol Ensure Trust and Accountability in Instant vTXO Issuance with Delayed On-Chain Transactions?
A Scenario Question: If Alice sends UTXOs to an ASP to issue vTXOs for Bob, the vTXO needs to be instantaneous, but the ASP’s on-chain transaction may take a long time to confirm. What happens if the on-chain transaction fails (with funds returning to the ASP)? In this case, could the ASP act maliciously by issuing the vTXO to Bob without backing it up, leaving Bob with unredeemable vTXOs when he tries to cash them out later?
Possible Solution: Could the ARK protocol ensure that the ASP only uses Alice's UTXOs after the on-chain transaction for Bob is successfully broadcast and confirmed? Additionally, can Bob's vTXOs indicate whether they are backed by UTXOs or not, notify him of any failure, and maintain a "Not Backed" status until the ASP backs it up with a new UTXO transaction? This would ensure that the ASP can only use Alice's funds after successfully creating a UTXO for Bob, with the entire process being publicly verifiable while respecting user privacy.

What happens if the on-chain transaction fails (with funds returning to the ASP)?

Ark transactions are atomic (via Anchored transactions) so if the ASP's on-chain transaction (aka Round tx) fails, Bob never received his VTXO. Just like with Bitcoin, Bob only has a UTXO after Alice's payment is confirmed.
VTXO's are Bitcoin transactions that spent a part of an existing UTXO.
Having said that, Alice can send a VTXO to Bob instantaneously, by sending him a OOR (Out Of Round) VTXO. In this case, Alice is forfeiting to Bob the right to spend a part of an existing UTXO, i.e. Alice is forfeiting her VTXO to Bob.
The disadvantage of OOR VTXOs for Bob is that Alice (colluding with the Server) can double spend her VTXO, so there is trust involved. Bob can fix this by trading this OOR VTXO for a VTXO in the next round.
VTXOs are completely trustless, Bob can anytime broadcast it to mainchain and get a UTXO.
Know more about Anchored transactions, VTXOs and Ark in general here:
https://joaobordalo.com/labs/ark/


text:
Is there a resource that describes the RPC API in more detail?
I'm trying to understand the API as it is provided by developer.bitcoin.org, but I don't quite understand what some of the commands actually do and require.

The best documentation for Bitcoin Core's JSON-RPC interface is arguably the help command. For example, to get help on the getblocktemplate command, run help getblocktemplate.

this is helpful, but it's also basically the same as the api as provided by developer.bitcoin.org, just with less explanation than the website unfortunately. I'm using a few more sites for research too so hopefully i'll figure it out

You can find an overview of the Bitcoin Core RPC commands on bitcoincore.org.
Please open an issue if you find specific shortcomings in the documentation in the Bitcoin Core repository.


text:
Account change address is not showing up with `getaddressesbyaccount`
I have a tiny question regarding the Bitcoin JSON-RPC API. I have a transaction on Testnet which sends one coin to an other address owned by me (on an other account than the sender). The sending address, mtGaEd9zZU8B7aYSuQiDFZTo2wiS8dWb3c, is listed under the default account, running getaccount mtGaEd9zZU8B7aYSuQiDFZTo2wiS8dWb3c outputs indeed an empty string. The receiving address, mzcj8xYome3gmAWZG57yutv14sctPxbPV6, is listed under an account named test, as expected running getaccount mzcj8xYome3gmAWZG57yutv14sctPxbPV6 returns test. Both addresses also show up when I use getaddressesbyaccount, but the change that went to address mnUJRd9CL3GV1QbWFxJxLj2DgE1ADSB8oR, which also returns an emtpy string when using it as argument to getaccount, doesn't show up in the getaddressesbyaccount call output. Why is that? I can't sum the balances of each addresses now for a reliable account balance, only getbalance return the right answer.

It doesn't show up in the results from getaddressesbyaccount() because addresses are only associated with accounts by use of getnewaddress() or setaccount().

Why did they use this approach? It doesn't make sense to me. Also is there any other way to show all Bitcoin addresses?

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


text:
What methods are currently used to embed additional data into the Bitcoin blockchain?
Yes, I do understand that it is inappropriate to pollute the already large blockchain with data not necessary to make the currency work. But I know people are using Bitcoin as an underlying system for certain applications, like data storage or reaching common consensus about matters not directly related to the currency itself.
What methods are mostly employed to inject the blockchain with arbitrary data (like custom scripts representing data or payouts to addresses that represent data)? Is there a need to stop this in order to prevent an undownloadable large blockchain from forming in the future? If so, how can this be accomplished?

Related: https://bitcoin.stackexchange.com/questions/39347/how-to-store-data-on-the-blockchain

There's several ways this happens in many abstract ways.

The coinbase field of a mined block allows for hex data which can hold approximately 1 tweet worth of data.
Multiple outputs can be used for a transaction such that each holds hex data. This would imply dust value outputs (outputs of <5640 satoshis) and would be frowned upon for bloating the Blockchain.
Likewise, as a commenter noted, hex data from a multi-signature transaction could be used to encode information, but has similar implications to #2
Blockchain.info allows for messages which are linked to transactions but are not embedded in the Blockchain.
http://proofofexistence.com allows for a hash of a document to be imbedded in the Blockchain to prove an instance of an object (document/file) existed at a certain time.
Similarly to #5, sidechains allow for assets to be linked (though more abstractly) to a time/black in the Blockchain. So if one assumes a block height as a pointer to a sidechain's information, then the Bitcoin blockchain is encoding information/proof of assets
Assuming brute forced Base58Check, it is possible to send Bitcoin to public addresses which could double as hex encoded data, though the assumption of useful messages rests on owning the keys to addresses which have a checksum which appends meaningful data (which is random, hence brute force)

Could you clarify 6? +1 for the forced Base58Check. I hadn't though of that one yet!

@Jori Sidechains are quite abstract currently, but check http://bitcoin.stackexchange.com/q/32185/9382 and the whitepaper linked therein

The accepted method of doing this is by putting the data in the output script along with op code OP_RETURN which tells clients to mark the transaction as invalid. This way, it doesn't use up as much resources on clients who don't care about non-transaction related data.
There are two schools of thought regarding putting arbitrary data in the blockchain. Some believe that as long as the method used to put arbitrary data in the blockchain follows all the rules of the bitcoin protocol, there is no harm done and that it actually strengthens the network by increasing usage. Others believe that it is detrimental and that these kinds of data should be kept from using up resources on a network that is designed to process transactions and not designed to store arbitrary data.
In my opinion, it all really comes down to what miners think about these kinds of use of the blockchain and from their perspective , they really don't care. To a miner, it makes no difference what the transaction is as long as it pays a transaction fee ,and they can add it to their block. So I believe that this kind of usage of the blockchain is here to stay.

This answer could mention that there are other ways to put data into the blockchain, too, such as using an 1 of 3 raw multisig output, where 1 of the public keys is real and the other 2 are just data. Obviously hacks like this are not recommended, but there's no way for the network to know that the public keys given are not real public keys.

also OP_IF, OP_ELSE, OP_ENDIF - one of these clauses can contain arbitrary data for example

http://digitalcommons.augustana.edu/cscfaculty/1/
Academic paper explaining data insertion methods for Bitcoin's blockchain.

Please don't give a link-only answer, but summarize the information.

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


text:
Opening wallet.dat in python, using bsddb3
I'm trying to open wallet.dat using the bsddb3 module for Python 2.7.
db = bsddb3.btopen("wallet.dat", "r")

contents of db:
{'main': '\x00\x00\x00\x02'}

I have to Which is almost nothing.
ls -l wallet.dat -> 72K

I though I could view information about the wallet, is there problem with the version of bsddb or this line of code?

open the database like this:
from bsddb.db import *

db = DB()
r= db.open("wallet.dat", "main", DB_BTREE, DB_RDONLY)

print "%s" % (db.items())

This does not work under python 3.

@d-r yes, you need to use from bsddb3.db import * and parenthesis around the print


text:
I sent a BTC transaction from Bitcoin Core to an exchange, but it doesn't show up on the blockchain
yesterday I sent a BTC transaction from Bitcoin Core to an exchange, but it doesn't show up on the blockchain, and the funds have already been deducted from my wallet. What happened? How can I resolve this?

Double check that the address you sent the coins to was the correct one. If it is correct, it may just take some time for the transaction to show up in the mempool/be confirmed.

发送货币的地址是正确的，一般需要多长时间，谢谢您


text:
Bitcoin wallet not synchronizing
I'm waiting for receiving bitcoins to my Bitcoin wallet app version 10.16.
They have been sent but will not appear in app because its not synchronizing.
At startup the a popup says "security varning your unit is old and insecure. Only use it for small amount."
At the bottom of the app it says synchronizing:storageissues.
What could i do? Could I add my receivingadress in another wallet and receive the fynds there?

It sounds like your device’s disk is full. Perhaps try to free some space?


text:
Need an explanation as to why the exchange of BTC for USD is legal
Many have asked if the exchange of BTC for USD is legal, and they will cry "legal" and simultaneously cite FinCEN's regulations for a MSB.
However, they never explain if an individual trading BTC for USD (at, say, Mt. Gox or something of the like) is considered an MSB.
Could someone EXPLAIN why it is legal/illegal for an individual to exchange (not run an exchange, but be the customer) BTC for USD.
Thank you.

Explain why it is legal to soak marshmallows in blue food coloring. I bet you can't do it. My understanding is that it is legal because no law prohibits it.

Are you positive no law prohibits the exchange of BTC for USD? Wouldn't registering as an MSB be considered the condition/law, and since this is a grey area how would one know?

You cannot be an MSB if you aren't a business. I don't recall what the threshold test was, but it's pretty high.

So that would mean individuals acting privately on their own behalf would classify as "users" and thus be legally allowed to exchange currency?

That is my understanding.

Here is a good article series in Coindesk by a lawyer regarding the matter http://www.coindesk.com/bitcoin-law-what-us-businesses-need-to-know/ and http://www.coindesk.com/bitcoin-law-money-transmission-state-level-us/

Right now Bitcoin is the round peg in the regulator's square hole.
If Bitcoin is deemed to be a security, then certain restrictions might apply on how it is bought, sold, and held.  But Bitcoins themselves are not a debt, or a promise, or anything similar so it probably isn't a security.
If Bitcoin is deemed to be a commodity, then certain restrictions might apply on how it is traded, if delivery to the buyer is at some point in the future -- as is the nature of most commodity transactions.
If Bitcoin is deemed to be a foreign currency, then certain restrictions could apply there as well.   FinCEN has explicitly stated that it does not see Bitcoin as a foreign currency.
But almost nowhere is there a restriction about acquiring a good, such as like what Bitcoin exchanges provide.

Regulators have not yet really figured out how to deal with Bitcoin, so things can change in the future.
It should be noted, however, that a Federal judge in Texas has ruled that Bitcoin is a legal currency. This came about when a guy set up a Bitcoin ponzi scheme and then tried to claim that he couldn't be persecuted because Bitcoin isn't a real currency. Fortunately, the courts disagreed.
Another way to think of it is this: When you exchange for Bitcoin, you are basically buying Bitcoins. Generally speaking, you are only forbidden from buying things that are expressively forbidden by law (i.e. drugs).
Right now, there is no government regulation that says that you cannot buy Bitcoin. And most likely for the government to set up a regulation against buying Bitcoins, it would have to prove that Bitcoins are harming the generally public (as is their argument in regards to drugs).
Personally, I doubt the government could make that case, and even if it wanted to, there are far more important things on their books.
If and when the government gets serious about regulating Bitcoin transactions, it will most likely focus on drug purchases, money laundering, and things that are illegal regardless of the currency used.

The issue with FinCEN and Regulatory compliance is this- How do they know that the Bitcoin Mr X is trading, exchanging, using, purchasing etc was not just gained for the sale of child porn, drugs, internet gambling, etc. A credit card company can block internet gambling, it can disallow the use of its card to openly pay for illegal stuff like drugs, explosives whatever. So a credit card has a much wider use case than bitcoin.
It is the challenge we are trying to overcome when it comes to providing services for the btc industry. A key piece in MSB activity is being bonded. As of now no bonding company (that we know of) wants to assume the risk. So even though we are a licensed MSB, we want to provide btc services we cannot comply with the regulatory requirements. One of which is bonding. We also need banks to take on the FBO accounts and right now they don't seem to want to do it.
So right now btc can be used within a relatively small environment (in comparison to a credit card or cash) but it will never be widely accepted by commerce until some very real problems can be solved. So I am not even sure if legality or being able to define its legality is relevant right now.
The biggest boon and benefit to bitcoin will come when someone finds a way to substantially show that the btc in my wallet did not come from illicit activity. Once that happens btc will be much easier to use and will hopefully become commonplace.

Huh? Bitcoin being 'untraceable' (used lightly) is an inherent feature of cryptocurrency, not a problem that needs to be solved (or can be solved). The solution to the problem you mentioned is simple: treat it the same as cash. You can't trace cash. Instead you prove that you spent or gained the money with receipts and contracts. CC type payments shouldn't be considered the 'standard'.


text:
How does the most recently found critical vulnerability (CVE-2018-17144) work?
If you were a miner, what are the steps you would take to create the extra (21,000,012.5th) bitcoin?
Where in the source code is this exactly (link)?
Why can't this be done by a non-miner?
Also, which forks are/were vulnerable?

21 upvotes, very meta, good job everyone

If you were a miner, what are the steps you would take to create the extra (21,000,012.5th) bitcoin?
Where in the source code is this exactly (link)?

There are two components to CVE-2018-17144. There is a crash bug and an inflation bug. Both are triggered by almost the same scenario: a transaction contains an input multiple times.
In general, how this would work is as follows: lets suppose a miner has an unspent output A for 1 BTC. They create a transaction with that input in twice, so input 1 spends from output A and input 2 also spends from output A. The output of that transaction has a value of 2 BTC. Note how the output's value is larger than the value of output A, but if you had output A twice, the value is correct.
The miner would then take this transaction and include it in a block that he is mining. Once the miner find a block with his transaction included in it, he broadcasts it to the Bitcoin network.
When a Bitcoin Core 0.14.x node receives this block, it will validate the block, but it will skip the duplicate input check because of the false parameter on this line. So the transaction the miner made will pass this step of validation, and the other transaction validation steps, including input script validation, until it reaches this loop. In this loop, the inputs to the transaction are being marked as spent in the UTXO database. The first time the duplicated input is seen, it is marked as spent. But the second time it is seen, the coin is already marked as spent so coins->vout[nPos].IsNull() will be true. This means that it will go into this if statement and subsequently hit the assert statement that follows. The assert causes the software to crash.
For Bitcoin Core 0.15.0 - 0.16.2, the behavior is different. This is due to the change in how the UTXO database is structured. Everything is largely the same until the same loop is reached. Here, instead of returning whether the output was spent, SpendCoin actually returns whether the input exists in the database. So the first time, it will pass as expected, but the second time, instead of returning false, it still returns true.
Looking at SpendCoin, you can see that it only returns false when it is unable to fetch the coin (object representing a UTXO) from the database. With the new database structure, this makes sense as the output should be removed from the database when it is spent. But, if you look a few lines down, you see that it only deletes the coin when it is marked as FRESH. In the case the coin was FRESH, SpendCoin would delete the object on the first pass so the second pass the coin would not be found and thus it would return false. This triggers the assert following the function call causing the node to shutdown.
If the coin was not FRESH, the coin object itself is not deleted, but its contents are cleared. This means that the second time the input is seen, if the coin was not FRESH, SpendCoin would still return true as the object still exists in memory, which means that it passes the assert that follows the SpendCoin (which caused the crash when the coin was not FRESH). Then validation continues as normal, and the output this transaction created is added to the UTXO database, which means that money that shouldn't exist now exists in the UTXO database.
So now the question is, when are UTXOs marked as FRESH? They are marked FRESH when they are added to the UTXO database. But the UTXO database is still only in memory (as a cache). When it is saved to disk, the entries in memory are then no longer marked as FRESH. This saving to disk happens after every block (as well as at other times, but that is not important).
Thus, if a miner has an output that was part of a transaction that has already confirmed, and he spends the output twice in the same transaction (so the transaction has two inputs that refer to the same output), and this transaction is not broadcast to the network but instead included in a block that he mines, he is able to create a new output that has twice the value of the output that he spent, thereby creating coins.

Why can't this be done by a non-miner?

The reason that this cannot be done by a non-miner is because transactions that are received outside of blocks are still checked for duplicate inputs. The transaction will be rejected as invalid and not added to the node's mempool, so the transaction will never get into a block. It is only transactions with duplicate inputs that get into blocks that trigger this vulnerability, and thus only miners can do this as they must knowingly insert an invalid transaction into their block.

Also, which forks are/were vulnerable?

Any fork whose software includes commit eecffe50efc3944d713c701fa375dacbf17fb7cf. This would mean any software forked from or pulled in changes from Bitcoin Core after November 10th, 2016.

Would a node that receives the block as a compact block check for the duplicate?

No, it would not. The transaction with the duplicate input would not be in the mempool so it would be sent along with the block (as part of a blocktxn message). Such transactions are not run through the mempool acceptance code. Instead the block is reconstructed and run through the normal block acceptance code.

Great write-up, thank you! It seems to me having a bool flag such as fCheckDuplicateInputs seems pretty unfortunate. It is quite easy to set it to an invalid value. I'm just wondering if we shouldn't be more explicit and verbose in those critical parts


text:
Is there any centralized cryptocurreny?
Is there any centralized cryptocurrency? Is cryptocurrency a Bitcoin oriented concept only? From what i read almost all of the cryptocurrencies are derivatives of Bitcoin.

I like this question because there is a strong possibility that on the long run a centralised cryptocurrency will out-compete a decentralised one on transaction fees / energy cost. Yes, I know decentralised currencies will always hold a special place in the heart of the libertarian early adopters, but I wouldn't hold my breath the wider quadrillion-transactions-per-year community will tout freedom over speed or cost effectiveness.

Cryptography-based currencies predate Bitcoin by decades. The most well-known is the work of David Chaum on blind signatures, described in some papers from around 1985. The most accessible description of his and other methods is actually this document from 1996.
In 1990 Chaum went on to found a company, called DigiCash, to offer such a currency.
What they offered had a lot going for it - you could store money as data on your computer, and you could transfer it anonymously. However, what it lacked was a decentralized transaction synchronization mechanism - synchronization was done on the company's central servers. Because of this, it did not achieve the support Bitcoin did, and the company went bankrupt in 1998.
A more modern platform is Open Transaction which is inspired by Chaum's ideas but offers much more functionality.
So the reason you don't hear about centralized crypto-currencies is not because they don't exist, but because they're mostly pointless. Only with the advent of decentralized transaction synchronization in Bitcoin and its clones we saw growth in this space beyond just academia.

but because they're mostly pointless.

Curious about this assertion?

@pratnala: Cryptocurrencies such as Bitcoin gain their features and advantages from being decentralized. As long as it's centralized, there's very little to be gained from being cryptographic. If you can't use your money independently and you need the services of a central issuer (which can shut down or offer poor service, and is free to charge fees and restrict), what difference does it make if you sign a cryptographic message or log in to the issuer's servers?

I think you are correct that almost all of the cryptocurrencies are derivatives of Bitcoin.  From that fact it would follow that they would all be decentralized.
That being said, there are centralized aspects of cryptocurrencies, including Bitcoin.  For example, online wallets, exchanges and mining pools are all centralized.

As others have pointed out, crypto-currencies are not a new thing and have been around for decades.
One currency that might meet your criteria is litecoin.
Litecoin is still an opensource, community driven currency,  it's not quite a "centralized" currency.
That being said, the company developing Litecoin is taking a more hands on approach and trying to offer a bit more support for the currency. Whether that's a good or bad thing, only time will tell.

It depends on the nature of the cryptocurrency as to whether such a direction is advisable. If the nature of the cryptocurrency is to be equity and production based in support of debt and consumption based national currencies, then "yes" a cryptocurrency is certainly optional. The current regulatory environment is allowing the IRS to ask for all of the Bitcoin depositors and subject them to taxes through Coinbase. It is only a matter of time until this precedent is applied to banking regulators seeking to safeguard central banks. National governments such as the Bank of England and the Bank of the People's Republic of China are already engaged in the creation of their own cryptocurrency efforts that are still debt and consumption-based. Based on research, depositors still prefer centralized banking relationships over decentralized banking. People still want to know who is responsible for the safeguarding of their hard-earned money.

-1 most of this answer appears at most to be tenuously related to the question. Are you answering to another answer instead? Please focus on answering the question, as the order of answers on Stackexchange is not necessarily by posting time.


text:
Armory - Master Public Key
I'm looking into generating addresses outside of Armory using https://github.com/prusnak/addrgen. It requires a master public key which I can't seem find. Does anybody know where I might find it or is Armory not compatible such a system?

AFAIK Electrum is the only client that supports Master Public Keys as of now. Electrum uses a deterministic seed and also have an MPK that can derive bitcoin addresses that belongs to that seed. So people can generate addresses to receive, but can't spend from them; this is called a seedless wallet.


text:
How exactly does "Lend at Hodl Hod" work?
I've read though this carefully: https://lend.hodlhodl.com/faq/basics
It is extremely confusing.
It seems as if, to borrow 1000 USDT or whatever, I have to first register an account (e-mail address on centralized website required in spite of claims of "true P2P trading"...), then send the Bitcoin amount corresponding to 1000 USDT + the interest from the lender and the "Lend at Hodl Hod" (should I be worried that sometimes it's called "Hodl" and sometimes "Hod"?) fees, and if I haven't paid it back (how?) before a certain date, they automatically get what I sent in.
But how exactly do I pay it back? If I can paid it back that quickly, why would I be borrowing in the first place? It doesn't seem like my deposited Bitcoins "appreciate" at all in value -- it's me who has to pay money?
I was linked to this service when asking about how to "live off of" my Bitcoin without spending them, but this seems like I'm the one who has to pay -- not receive "free money"?
I'm very confused about this. Everything about it seems very fishy, from the typos to the fuzzy explanations of how exactly this is supposed to work and how exactly I'm supposed to pay back the "loan".


text:
I found a BTC hash. Now what?
I used a mining program written in python and after a lot of time, it found a hash that looks something like this: 0000de957fbfdfc77582e0d0b20c53d2d1d83d8bb8cfe3693521f672bf2a6021 except it has 19 0's at the start and all the following text is also different. What do I do now? How do I get the bitcoin in my wallet?

If you have found a new valid block at the network's chaintip, then you should submit that block to your network peers as soon as possible, so that they will hopefully add it to their local blockchain record. If other miners build upon your block, then it should become a part of the valid chain, and you will eventually be able to spend the coinbase UTXO in it (after it has matured 100 blocks).
As an example, if you are running bitcoin-core then you can use the submitblock command to submit your valid block to the network.

What data does your hash hash? It must be a hash of a valid block header, and the block header must satisfy consensus rules and it will have a merkle root of all transactions of the block, and the 1st transaction will be the coinbase transaction, and the coinbase transaction will have coinbase output(s) that are allowed to create BTC "from nothing" on the input side (coinbase input) i.e. claim the BTC block reward. Did your program create such outputs? If yes, then you did the setup ok, but you also have to submit the mined block to the network before someone else finds a block at the same height.
Then, if your block is accepted, your coinbase output(s) will become spendable after 100 blocks have been mined on top of it, see "coinbase maturity". If your program created those outputs right, and broadcasted the mined block which got accepted by the network, then your reward would just appear in your wallet as if you received some BTC.


text:
My BTC hasn't shown up in my Wallet
I transferred BTC to my wallet and it hasn't shown up. IT's been 6 weeks and still nothing. I transferred my funds from Binance and Binance is showing that the BTC has been send and received. Bitcoin Core is telling me that it needs to synchronize with the network and is 5 years and 4 months behind. Does anyone have any suggestions as to how to retrieve my BTC? Thank you

Yes you either need to sync or dump your keys and use them in a different wallet: https://bitcoin.stackexchange.com/a/102078/38618

It seems you have not let core sync up the the network. Click on the 5 years behind bar at the bottom and it will bring up details on the sync process. Check what the estimated time to sync is. If there is no estimate then give it a few minutes, it can take some time to find peers after starting sometimes. If still no estimate, go to window>peers and see if there are more than a few peers, then see network tab to see if it is receiving data from the network.
If you are receiving data and have a "Estimate time left until synced", then you just have to leave the program running. It can only catch up if it is running.
If you close the program it will stop downloading block data and not be able to catch up. Keep it running and just wait a bit.
If you are not receiving data or have peers then we might need more information to help you. I don't know what your setup is.


text:
What adapters should I use with my s19 and a dryer outlet?
I'm just getting into crypto mining and was wondering what adapters I should use. I see a lot of people using PDUs but I'm not sure if that's necessary here because I only have the one s19. I am using a 240V 30A American plug, so if anyone can help that would be great! thanks.


text:
Name of the country receiving the bitcoin currency
Can a country be determined to whom the bitcoin is sent?

No. Bitcoin has no concept of countries or other societal constructions such as laws.


text:
What is the difference between P2SH redeem script on Bitcoin and on Litecoin?
I am building a service that is based on multisig wallets. My current progress is so that I've implemented the multisigs for Bitcoin network and it works fine. Now I am on Litecoin and I am facing some issues and would appreciate any help or guidance on that.
Disclaimer: This may be related to how Electrum-LTC works, I am not sure. I am happy to hear experts oppinion on that.
On Bitcoin network your multisig wallet is composed of 3 parts:
ScriptSig
  Signatures
  0 <Sig1> <Sig2> ... <SigM>

  Redeem script
  M <PubKey1> <PubKey2> ... <PubKeyN> N OP_CHECKMULTISIG

ScriptPubKey
  OP_HASH160 <Redeem script hash> OP_EQUAL

And that works just fine with my implementation. I can generate 2-of-2 multisig with Electrum (btc) and sign it with both keys, both with my code and with Electrum wallets. Outcome transaction in both cases is correct and accepted by network.
Now, for Litecoin I am using Electrum-ltc and the process is exactly the same. I can successfully generate multisig address on Litecoin
Suppose I Have following  Redeem script
  2 028c895128a8113bb5d599b4f463df685220ba726fc664013b3df56cb0bae74dc4 02c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf435 2 OP_CHECKMULTISIG

The address I see in Electrum-ltc matches the one I generated myself which tells me I am on the right way.
However, when I sing a transaction with wallet a redeem script in the transaction hex looks totally different and does not match my manually generated redeem script
Manually generated redeem script
5221028c895128a8113bb5d599b4f463df685220ba726fc664013b3df56cb0bae74dc42102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf43552ae

broken apart
52 - OP_2
21028c895128a8113bb5d599b4f463df685220ba726fc664013b3df56cb0bae74dc4 - PubKey1
2102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf435 - PubKey2
52 - OP_2
ae - OP_CHECKMULTISIG

And here is a redeem script that I get from Electrum-ltc once I signed transaction with one key
524c53ff0488b21e0000000000000000006a88a8afff7c30e2adc4ebee877e842b7868f11c6fafe5635fecd85337366bd802f8ecc3fc0be1c7b7d7bf4968df349845ede9dd6044beb0bcf25145612fa3b4e4000000002102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf43552ae

broken apart
52 - OP_2
4c53ff0488b21e0000000000000000006a88a8afff7c30e2adc4ebee877e842b7868f11c6fafe5635fecd85337366bd802f8ecc3fc0be1c7b7d7bf4968df349845ede9dd6044beb0bcf25145612fa3b4e4000000002102c09fdcf2cd2281ac5d35dedb8b19499db847fad469c151428d28c9cf1aabf435
52 - OP_2
ae - OP_CHECKMULTISIG

So, what this thing the middle? And why it does not match my redeem script? Is this a bug with Electrum-ltc or I am missing something. Would appreciate any feedback.

If you signed your Bitcoin transaction with only one key, you would see the same behavior.
What you are observing is how Electrum handles partially signed transactions. It does not produce the correct scripts until the transaction is fully signed. What you see as the public key in your transaction is just how Electrum internally represents public keys.

It is not, as redeem script is the same regardless, whether you signed transaction or not.  Electrum for bitcoin works as expected. Electrum for litecoin does not and I wonder wither this is bug or protocol difference

Then this is an issue with Electrum. Litecoin works pretty much in the same way Bitcoin does. The script and UTXO systems are identical. Also keep in mind that Electrum-ltc may not be up to date with Electrum. At some point in time, IIRC Electrum itself exhibited this behavior.

Can you recommend any GUI based Litecoin wallet that support multi signatures?


text:
When transferring BTC, and it is stalled with the message "untreated" what does that mean?
I have $274.97 in an account with BCRPRO that I need to withdraw after making several attempted transfers to first cashapp,after it read successful operation it was reversed back into the BCRPRO account. I attempted to send it to my bank, it too said successful but was back in the original account.  It was restricted for 72hrs. And I was told by BCRPRO it would cost me $200 to withdraw $274.before the restriction is lifted. I spoke to support at coinbase where the funds will be received that everything is good to accept the payment. As well did support at cash app. Unfortunately cust.support at BCRPRO has not answered any of the many emails I've sent asking what UNTREATED means.Please I can not afford a loss of this amount of money. Does someone know the meaning of UNTREATED and how do I remove this status to be able to complete the transfer into my coinbase account safely.


text:
Someone sent all the money out of my wallet to another wallet. I did not make that transaction. Can I find out where it went
I just had money sent to my wallet from a Bitcoin ATM. As soon as it arrives it is being sent away. I did not send anything. Now it is all gone.

This question is similar to: Can bitcoins be traced to scammers. If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.


text:
If you're not powerful enough to add a block to the block chain, is there any financial incentive to run a full node?
Since there are many powerful computers now being used to compete in proof-of-work, a small operator has no chance of adding a block to the blopck chain. I appreciate the importance of having many full nodes to validate and maintain the integrity of a decentralized network. But is it true that there is no financial incentive for running a full node?

is it true that there is no financial incentive for running a full node?

Yes.
No direct financial incentive.
If you own bitcoin, you do have an interest in sustaining the bitcoin network.


text:
How data is searched in blockchain?
Alice has 500$ and bob has 1000$. Now alice wants to transfer 100$ to bob. Miners who got the chance to validate the transaction has to check whether alice have sufficient balance or not.
where are these alice and bob balances are stored? If they are stored in the block chain, how balance is retrieved? Does entire block chain is searched to find their balance and validate and update? or block where these balances are stored is kept track any where else?
Response really helps,
Thank you.

Alice has 500$

It is better to suggest "Alice has 500 mBTC" because amounts in the blockchain are not dollar-denominated.

Miners who got the chance to validate the transaction has to check whether alice have sufficient balance or not.

No they dont.
Miners don't care about balances.
Miners only care whether Alice has provided proof¹ that she holds the private keys required by the scripts in the transaction inputs.
Other nodes validating blocks also don't care about balances.
In accounting terms, the blockchain is a transaction journal, not a ledger. It does not keep track of balances held by people. By processing the journal you can calculate a current amount for each Bitcoin address. Note that not all transactions use Bitcoin addresses. These addresses are merely an artifact of certain commonly used scripts. Scripts don't have to contain data that is conceptually an address.

where are these alice and bob balances are stored?

Not in the blockchain.

how balance is retrieved?

It isn't, not by miners and no one other than Alice ever retrieves Alice's total balance.

Does entire block chain is searched to find their balance and validate and update?

No.

or block where these balances are stored is kept track any where else?

No.
Alice's wallet might keep a separate record in memory and committed to local disk in some proprietary form. That would probably be sensible for performance reasons but is not required..

Footnotes

Proof

When Alice uses her wallet to pay 500 mBTC to Bob, her wallet checks its list of unspent transaction outputs (UTXOs) for the bitcoin-addresses that Alice has contol of in her wallet. It uses as many of these as are needed to add up to 500 mBTC plus the selected transaction fee. It constructs a transaction which lists these selected UTXOs as inputs and lists outputs including a 500 mBTC output to one of Bob's bitcoin-addresses and an output to one of Alice's bitcoin-addresses for the unused "change". The transaction includes cryptographic "signatures" made using Alice's private key(s) which proves she controls those UTXOs used as inputs and which can be checked (validated) by other people's wallets by using Alice's published public keys. These signatures by ALice's wallet satisfy the Bitcoin-scripts that are part of the UTXOs which Alice's wallet is using to make the payment.
Note that there is no need to calculate a sufficient balance. When Alice pays Bob $17 using a $10 note† and two $5 notes, Bob doesn't need to know haw many other dollar notes Alice has in her purse. He just needs to check the notes she gave him look real. Alice needs to make sure she gets $3 in change.
† US: bill; Rest-of-English-speaking-world: banknote.

Thank you! One thing is not yet clear to me.. Suppose alice want to transfer 600 mBTC which is greater than his wallet balance to bob, still this transaction is added to the blockchain??(This might happen if miners don't check alice balance).. Then how this problem is overcomed??

In what cases blockchain need to be searched and if it is required how searching is done? Can you please explain with some example.. Thank you   @RedGrittyBrick

@ShirishaKollapuram: In this Q&A website, follow-up questions are asked as a new-question (with link to prior question if useful for context) using the "Ask Question" link at top right of page. But first search for existing answers. Comments are for requesting clarification of a question or suggesting improvements to an answer. Comments are temporary and may be deleted by moderators cleaning the system. Questions and Answers are intended to form a repository of searchable information useful to other people in future.

@ShirishaKollapuram: see new footnote in answer above.


text:
The scope of lightning channel fee
For the following setup:
         A   ----(HIGH Fee rate) ----  B  ----------------  C

B want to charge A for more fee, he raises the fee of the channel between AB

A pays to C
A pays to B
C pays to A

Does high fee rate only affects case 1 only??

No, only the third case is affected. And the reason for that is that channels are actually bi-directional and have two fee policies depending on the direction they are used.
For example, channel AB has a policy from node A, and a policy from node B. If B increases the fee - it will only affect the payments going from B to A, not the other way around.
That means that scenario 2 in your case is always controlled only by node A. Scenario 3 includes the payment from B to A, so fees will be higher. Scenario 1 can also be affected by node B, but it will need to increase fees on the channel BC, not AB.


text:
Sharing the lightning-rpc socket
I'm using user "lightning" to start the daemon, but would like to have user "bitcoin" to make the lightning-cli calls. How do I share the lightning-rpc file to do so?
Thanks!
Francois

Have the users share a group, and write a wrapper it even a plugin to change the group and permissions on the rpc file. That's the normal Unix way...

I thought that maybe I can set the default group and permissions of the created lightning-rpc file in the config, but writing a wrapper to change it makes sense. Thank you Rusty!

I am not sure if I get your question. So just some general remarks. Lightningd  opens as socket and this owns the rpc file. That is why a 2nd lightningd needs a separate data dir and rpc file. However many clients can connect to the socket. For example lightning-cli or other programs you write....
If it is just about use rights you could probably just start lightningd with the Bitcoin user. Or you could assign the rpc file to be member of the same group as the Bitcoin user

Just give everyone to read bitcoin directory and rw RPC file:
chmod a+rx .lightning/bitcoin/
chmod a+rw .lightning/bitcoin/lightning-rpc

And the hsm_secret would be widely readable ! Please don't do this.


text:
Lost my old-Electrum 12-word mnemonic seed order
I created my wallet some years ago, and wrote my seed phrase on paper, but unfortunately in a wrong order. Now I suddenly found my note and after some check I find it is in the old-Electrum wordlists. But still I couldn’t find the right order of it. So what can I do?

If you are certain that the 12 words are the correct words but merely in the wrong order, and you know the addresses from the wallet, it is possible to brute force: there are 479,001,600 possible combinations, which isn't too many.
Here is an example of a tool that can help you with this: https://github.com/3rdIteration/btcrecover/blob/master/docs/BIP39_descrambling_seedlists.md
https://github.com/3rdIteration/btcrecover/blob/master/docs/Seedrecover_Quick_Start_Guide.md

Thank you, I may need to look up for my addresses now.

@五点共圆 has this been solved?


text:
Is there a roadmap to lift the current limit of 220M transactions per year?
I've seen that Bitcoin just supports ~3 TPS. This is 220 millions transactions per year. If every US citizen wanted to perform a single transaction on a year, they simply couldn't.
I've also read a lot of "Bitcoin's vision" that is completely incompatible with that fact.
Is there a plan or roadmap? What do you think will happen?

Does this answer your question? What is the Lightning Network proposal? What problem is it trying to solve?

That doesn't solve the problem, to use the Lightning Network you need to deposit some funds first and still use bitcoin on-chain transactions like a savings account. Few people would accept less than 1 transaction per year even on a "savings account".

There is a distinction to be made between transactions (ie, transactions recorded on-chain) and payments (ie, a transferring of value between parties). Bitcoin can scale both by increasing the number of transactions per time, but also by increasing the number of payments per transaction.
The lightning network is a very interesting way of increasing the number of payments per transaction, the limit for number of payments is almost unbounded (there are channel liquidity considerations).
In any case, as a user what you should really care about is that you have some guarantee of ownership of your funds. You want control: to be able to spend those funds at your discretion, without any absolute dependance on or trust in a third party. Whether you get these guarantees through ownership of on-chain BTC, lightning-network BTC, or some other higher-layer solution is somewhat irrelevant  (though there are additional security considerations in using higher layer networks like lightning. This is unavoidable: you incur all of the considerations of the base layer, plus the considerations of the higher layer). There is no reason that users cannot be on-boarded straight to lightning network, without any need to ever move their funds off lightning. The infrastructure may not be there quite yet, but development is ongoing at a fast pace, I think it will be very interesting to watch how lightning grows over the next decade.
Additionally, I think it is important to understand that even if bitcoin cannot scale to allow every person on earth to make on-chain transactions each day (or month, or year), that does not mean it is a failure or not useful. It just limits the usefulness of on-chain transactions to be higher-value settlements, and the limit of scaling then starts to depend on how many payments per transaction we can build infrastructure to allow.

Of course, it's raised constantly. Have you read about Taproot? It allows more efficient use of the block space. With the efficiency increasing, the transactions per X time will increase.

I've also read a lot of "Bitcoin's vision" that is completely incompatible with that fact.

While Satoshi had on-chain scaling in mind, Bitcoin is now scaling mostly off-chain (With SegWit as an example to on-chain scaling). Both are valid ways to scale and both will require each other in the long term.
Which fact?

I've read that devs think that Taproot will provide a 30-75% efficiency savings and only on multisig transactions. Even assuming the best case scenario (75%), that still is less than one transaction per quarter for every US citizen, assuming 0 users outside the US. Source: https://www.coindesk.com/bitcoins-future-exactly-how-a-coming-upgrade-could-improve-privacy-and-scaling

The long term goal is getting Lightning to scale.

As said above: That doesn't solve the problem, to use the Lightning Network you need to deposit some funds first and still use bitcoin on-chain transactions like a savings account. Few people would accept less than 1 transaction per year even on a "savings account".


text:
HD Wallets, XPUB and child private key leaks
So some generalisations on xpubs and current wallet providers.

Ledger and Trezor wallets can create xpubs which can show all transactions of a wallet
When a passphrase is added, this counts as a new set of private keys along with a new xpub
The children public addresses created from sending/receiving bitcoin are bound only to the xpub from the mnemonic phrase + passphrase i.e. if you create a new passphrased wallet it will have a new xpub
Children created by these wallets are not hardened
If an xpub is leaked for a mnemonic phrase + passphrase, if you have any of the children's private keys, you can compromise the entire wallet linked to the xpub and all other children, hardened or non-hardened BUT the attacker will not be able to compromise any other meomonic phrase + paassphrase you have as it has a different xpub, and ultimately different children

My question, assuming the above is correct, it's becoming more commonplace for 3rd parties (i.e. tax tools) to make use of xpubs - I want to know how it's even possible to leak a childs private key on a trezor or a ledger as none of the outputs are able to leak these, unless I'm wrong.
Just want to make sure I'm not leaving myself too open.

If I am wrong with any of the above, please shout. Would love a comment as this is probably how the majority of retail access bitcoin.

Children created by these wallets are not hardened

They are m/44'|49'|84'/0'/0' for trezor one/T and m/49'|84'/0'/0'   for ledger X/S. All subsequent children aren't hardened.

If an xpub is leaked for a mnemonic phrase + passphrase, if you have
any of the children's private keys, you can compromise the entire
wallet linked to the xpub and all other children, hardened or
non-hardened BUT the attacker will not be able to compromise any other
meomonic phrase + paassphrase you have as it has a different xpub, and
ultimately different children

This is the explanation from bip32: "knowledge of a parent extended public key plus any non-hardened private key descending from it is equivalent to knowing the parent extended private key (and thus every private and public key descending from it). This means that extended public keys must be treated more carefully than regular public keys."

I want to know how it's even possible to leak a childs private key on
a trezor or a ledger as none of the outputs are able to leak these

Private keys should never leave hardware wallets without any extraordinary cause. Usually, only the master seed is transferable as a possibility from a hardware wallet device. And there are not many reasons to do so. If an attacker is able to backdoor your device and steal keys, the fact of sharing xpubs would be irrelevant.

Your last comment is exactly how I saw it. So it's almost safe (knowing the risks) giving out your xpub as the child keys are never leaked, therefore it makes no difference if a trusted 3rd party has it or not


text:
Accidentally sent Blockchain BCH to Coinbase BTC?
I have made a mistake by sending cash bitcoin from Blockchain to Coinbase bitcoin address ( instead of Coinbase cash bitcoin address)..
i want to retrieve the fund or send it back to my blockchain so i can input the correct address again ? anyone knows how ? please make it as simple as possible because i do not have a lot of knowledge about bitcoin since i am very new to this world..
I have emailed both Coinbase and Blockchain about this matter, it has been two days and no answer..
thanks for your time and help in advance...

There is no way to directly retrieve your fund since they are the one now owning your coins, maybe try to contact their support directly on their social network like twitter to accelerate https://twitter.com/coinbase


text:
bitcoin-cli getbalance does not match balance with bitcoin-cli listtransactions
version of bitcoin-cli 0.17.1
when I try

bitcoin-cli getbalance

I get balance 0.00010471 BTC
when I try

bitcoin-cli listtransactions "*" 1000000 >aaa.txt

and then calculate

SUM(receive) - SUM(send) - SUM(fee)

I get 1.18202354 BTC
WHY???

Do you have any unconfirmed transactions or have you imported anything as watchonly?

No, I have not unconfirmed transactions and have not imported anything


text:
Standalone Java Bitcoin Miner - Does it Exist?
I am a java developer, and currently am looking to create a standalone java class that will let people mine Bitcoin using CPU, but I have no idea if such already exists. I have found one for LiteCoin, but that's all

CPU mining for Bitcoin became infeasible many years ago. You are competing with high end ASICs each of which is probably 1000000 x faster than a high end CPU at computing hashes for Bitcoin mining.

doesn't matter, my machines do not have gpus in them @Red

@KyoungwanWoo using a CPU to mine, you will spend money on electricity, but not ever generate enough hashes to get paid out anything whatsoever. So in that regard, it probably does matter to most people.

Does it Exist?

No
This is because a Java app that uses the CPU to attempt to mine Bitcoin will not be able to mine Bitcoin. There is no good incentive for anyone to create such a thing.