text:
How are OP_CSV and OP_CLTV backwards compatible
I am not able to see how older nodes prior to BIP 68, BIP112 and BIP 65 are able to prevent adding Transactions to their mempool when the newer rules are deliberately breached. I want to separate two cases I don't understand:

OP_CLTV. Lets say an UTXO Output is locked by <30Blocks OP_CLTV OP_DROP HASH160 PKH CHECKSIG>. Nodes following the new standard will check the nlocktime field of a transaction so that it is earlier than the time in the encumbrance. But if I publish this transaction to older nodes, for them the ScriptPubkey is not TimeLocked. So how are older miners prevented to mine on such invalid transactions

OP_CSV. For this OP_Code I could see, that older Nodes will not include transactions with a version number >=2. Otherwise we would have the same problems, that older nodes would include those transactions in their mempool without being able to check whether they are breaching the relative time lock.

With the new Script Versioning introduced by Segwit, these cases got easier. But using NOPs backwards compatibility seems very hard.

When it comes to soft forks, backwards compatible does not mean that old nodes will follow the new rules - that would mean that the new rules are already implemented. Rather backwards compatible means that following the new rules does not make previously invalid transactions valid, i.e. old nodes will still see those transactions as valid.
So what ends up happening is that, yes, old nodes will consider some invalid transactions as valid because they are valid under the old rules and not under the new rules.
It is for this reason that soft forks are only activated when it is likely that almost every miner (and hopefully every node) has upgraded to software that will follow the new rules. This is done by having miners signal inside of their blocks that they have upgraded and are ready to validate under the new rules. The soft fork only becomes active only when a certain threshold of signaling blocks is reached.
For OP_CLTV, the new rules were only to be enforced after 750 out of the previous 1000 blocks signaled by using a block version number >= 4. Even so, the rules were only enforced in blocks which have a version number >= 4. Once 950 out of the previous 1000 blocks had a block version number >= 4, then no blocks with a version number < 4 were allowed, and so at that point, all miners had to be enforcing the new rules.
For OP_CSV, the new rules were only to be enforced when 1915 out of a 2016 block difficulty period signaled by having a specific bit set in the version number. This also had a built in grace period of one difficulty period (2016 blocks) to allow for upgrades after the threshold was reached. So when the threshold is reached in one period, the next period the soft fork is not activated to allow for everyone to upgrade, and then the period after that is when the soft fork became active.
Through these deployment mechanisms, we can be reasonably sure that miners will not mine a block that includes a transaction that is invalid under the new rules. Miners should be upgraded when they begin signaling.
Furthermore, transactions using these new features are typically considered non-standard to old nodes. This means that old nodes will not relay those transactions, and so any miners using an old nodes will not accept them into their mempool and thus not include them in blocks. This is an additional protection as any miner who is following the standardness rules (and most are) will not include any transactions using the new rules (valid or invlaid) as they consider them to be non-standard.


text:
Bitcoin Transactions Detailed distinction between TxHeader TxInput TxOuput
Related to post Murch Explanation of Segwit Tx Fee Rate he breaks a TX down into:

TxHeader
TxInput
TxOutput

To calculate the weight and the final virtual size of a transaction (P2PKH,P2WPKH,P2SH-P2WPKH)
My question relates to what is the TxHeader in detail. I haven't heard about this classification in any articles.

When I look at the following Transaction Description Transactions I see the following distinction so I conclude:
TxHeader:

Field
Size (in bytes)

Version no
4

Flag
2 (optional only for segwit v0 right now)

In-counter
1 - 9 bytes (varint)

Out-counter
1 - 9 bytes (varint)

lock_time
4 bytes

TxInput:

Field
Size (in bytes)

list of inputs
(in-counter)-many inputs

TxOutput:

Field
Size (in bytes)

list of inputs
(out-counter)-many inputs

Can somebody confirm ?

The header can vary. You are nearly right. Basically it starts with version and inputCount. If the inputCount = 0 then the inputCount is the flag and the inputCout follows. If the initial inputCount is > 0 then its the inputCount and the inputs are following.

FYFI I coded exactly that data reading: https://github.com/mrqc/bitcoin-blk-file-reader/blob/master/analyze.py

See the readTransaction(...) function there.

Ok so what your are essentially decribing is, how the algorithm is implemented,got it, but I think looking at your code when the 5 th byte is 0 then the next byte is the flag (not the already read inputCount) and the 7th Byte is the inputCount. Thanks for the Code Snippet very pratical for understanding

Yes, but be aware: Inbetween those values the inputs' data is there, so you maybe dont want to include this data in a "header".

source: Stack Exchange

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

sort: votes


text:
How do I recover/use an old wallet from 2011/2012
I heard about Bitcoin from the Security Now podcast back in 2011 and downloaded and started playing with the Windows client at the time from Bitcoin.org.  I think I updated the client a few times, but never really did anything with Bitcoin.  I did get a few partial Bitcoins from the old FreeBitcoins.appspot.com website and from others.  It looks like the last Bitcoin client I might have ran was v0.8.3 and my wallet is backed up from February 2012.
Can I somehow import this wallet (wallet.dat) into a current Windows client? I gather that the blockchain(s), etc. will need to sync up and it will take a lot of time.  I'm a newbie and haven't stayed involved in Bitcoin over the years.  So, I need a serious point in the right direction.
Thanks in advance for any/all help.
-0.NRG

It just works fine with the modern versions of the software with no changes necessary. Sync will take anywhere from a few hours to a few days depending on your hardware and connection speed. Make more backups than you think are necessary.

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


text:
bitcoin-cli decodescript wrong output
If I try to get info in genesis block, there is 1 tx:
  "scriptPubKey": {
    "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
    "hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
    "type": "pubkey"
  }

bitcoin-cli decodescript gives me this address:
{
  "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
  "type": "pubkey",
  "p2sh": "3BgShGBxRQrczVD6Ftj4z51FfgJ761FdSX"
}

However any block chain explorers show address 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX.
The same problem with 2, 3, 4... blocks. Why?

Some of the earlier transactions on the bitcoin network use a raw public key in a p2pk script, instead of the now-common p2pkh format.
Only the p2pkh format is representable as an address. The raw p2pk script has no corresponding address, and must be worked with as a script directly. Some explorers and other tools will attempt to show it as either a p2sh address for the hash of that script, or as its p2pkh version, but that is not accurate to the actual on-chain data.

Moreover, if you sent money to the "address" that's generated by the blockchain explorers, the wallet in question would never see that money as it isn't looking for P2PKH scripts. It's a really bad "feature" that many of them have implemented.


text:
where can I get on chain data?
I'm trying to make some On chain data analysis, but almost all providers are not free
so the question is if I set up a full bitcoin node will be able to extract real time data from it?
seems like stupid question but I just want to make sure if I'm right here

Yes, you can have a lot of data from a full node. Transaction history, fees paid, hashrate (indirectly), address use and history, etc.

Thanks, I downloaded the bitcoin core and got my hands on the data :)


text:
access QR from a month ago
First of all, I am clueless about using bitcoin.
I sent money to a friend in Japan. I used a QR that I had used before. I did not see that he        wanted me to use a new QR. Apprently he cannot access that previous QR that I used by mistake.
He says  "There is a login info and password I need to access the main account online" and he does not have that. I have the long number underneath the "bar code".
I do not believe that he cannot access that QR from just a few weeks ago.

The QR code your friend sent you encodes a bitcoin address, which your wallet will use when creating a transaction that will pay your friend. So if you re-used the old QR code, that just means you sent BTC to the same address your friend wanted you to use in the past.
If your friend no longer has access to the private key for that old address (ie, he is locked out of the wallet for whatever reason), then they will be unable to spend the BTC you sent. The only way to recover those BTC, is to get access to that wallet/private key again.

I do not believe that he cannot access that QR from just a few weeks ago.

You'll have to decide whether you trust this friend or not. It's difficult for me to say what the nature of the issue is on his end, but given the level of responsibility a bitcoin user must have in order to  secure their funds, it is not exactly routine to just 'lose access' to a wallet. Normally, it is recommended that every effort be taken to ensure you can securely maintain access to your wallet. If you don't, and access is lost, then your coins too will be lost forever.


text:
What does it mean I have 1.33 bitcoin?
Is it a specific id for each bitcoin that refers to my wallet address, is it an id? or we don't have a unique id for each bitcoin, instead, we use transactions like this:
From address 24*** to address 43***, amount 2 bitcoins. It's just a simple number in the transaction (not unique, the sender and receiver's addresses make it unique, not the bitcoin itself)
Could you please shed some light on this ambiguity for me?

Technically, there is no such thing as a bitcoin. There is only a ledger (the blockchain) that contains transactions. A transaction refers to outputs from previous transactions, and specifies new spendable outputs.
A transaction output consists of a Bitcoin address, and an amount. And for practical purposes we pretend as if these amounts represent actual "bitcoins".
So if I send a transaction to your address for the amount of 3, we say "I sent you 3 bitcoins". But all it does is adding a transactions to the ledger that says 3 from my address to your address, signed with the private key that corresponds to my address.
Just like you say, it's just a number in the transaction.
Now regarding if bitcoins have IDs: no. Say I have 10 different addresses with 1 bitcoin each. I can now spend all these 10 together, in one single transasction, to one new address. This will create one new spendable output of 10 bitcoins. At this point it's impossible to distinguish the previous 10 separate coins. The new spendable output for 10 bitcoins is "atomic", I can only spend that 10 in its entirety. If I want to spend only 0.5 of that 10, I would send 0.5 to the recipient and 9.5 back to an address of my own.
Similarly, I can also have 1 bitcoin and divide that into 20 parts of 0.05 BTC each, all on different addresses, in one single transaction. I can then mix up one or more of these 0.05 BTC parts with other fractions of other bitcoins, merge them, et cetera.
So no unless a (fraction of a) bitcoin has moved completely separately from any other bitcoins, you can typically not track bitcoins to their origin, or associate them with some ID.
P.S. this model of a transaction is actually a gross simplification, more complex constructs are possible, but for sake of simplicity and clarity this basic interpretation should do.


text:
Is there any logical way that a "cloud Bitcoin mining" operation could be anything but a scam?
A few years ago, I paid (don't remember now if it was in Bitcoin or fiat) for a subscription to this "Cloudhash" scam. Basically, they claimed that I was "renting" a miner in their big facility, or more likely, they used my money (together with many other customers' money) to buy a bunch of miners that they put into a data center or some sort of facility, and then I could "watch the Bitcoins roll in".
As you can imagine, the amount in my control panel never reached above $2, far below what was allowed to be withdrawn. I never made a single dime. As far as I'm concerned, that was a scam. But does it necessarily have to be a scam? Or is there some way that somebody could legitimate run such a thing and actually pay out any kind of meaningful amounts of Bitcoin to the customers?
I read so many stories of people never getting their miners from China, or getting them so late that they had already become obsolete when they arrived. I realized that the power would go out in my apartment even if I did buy one, got it and hooked it up here. Not to mention the noise and heat generated would've driven me insane. It simply was not practical in my situation (which has not changed) to mine myself. That's why that service seemed so attractive to me, requiring me to do nothing but let them mine for me and I would get at least some coins.
I will say that I was skeptical, but I assumed that I would at least get back the money I had put in. Nope. Not even that.
Is there something which mathematically prevents this from ever working out?
Is there such a thing as a non-scam project that does this? Somebody who perhaps has rented a big basement with free power next to their uncle's nuclear power plant or something like that? Wouldn't it make sense for them to use my amount to buy another miner (or part of one) and then I would regularly get "my share worth" of satoshis?
Or am I pipe-dreaming here? Am I a naive fool who fell for the oldest trick in the book? And you all find it funny that I could ever believe that such a thing could exist?

If you found yourself in a situation where you owned a machine which, when running, would create a profit for you, what would you do?

run that machine
set up a business to rent the profits of running that machine to others

The only way the second choice really makes sense, is if you rent it out for more money than you'd expect the machine to make for you on it's own.

Wouldn't it make sense for them to use my amount to buy another miner (or part of one) and then I would regularly get "my share worth" of satoshis?

Mining is very competitive. As a miner you have to minimize your costs to remain profitable, and so I find it hard to believe that any miner which is depending on renting out their hashrate to others will be competitive. There would be a lot of extra work involved in running such an additional operation. Maybe it is possible, but personally I wouldn't bet on it.
If you search around online, you'll find lots of stories of users that have lost money on cloud mining purchases, but are there many that talk about big profits? Not that I've seen at least. That isn't a perfect measure, but it is perhaps telling.

There are a few legitimate such services, like NiceHash, that let you purchase hashpower from other users. You have to put in your own mining pool credentials on it, and it will mine using your credentials, so it's not exactly that "you just watch Bitcoins accumulate on the cloud hash operator's website".
I can't imagine it being extremely profitable for the buyers. The sellers have an interest to sell for at least what they would earn from just mining on their own, otherwise they'd just mine on their own. You'll probably be running at a slight loss if you tried to use it to just mine regular Bitcoin on a regular pool. I've heard of people buying it to try and take advantage of mining on small altcoins that are slightly more profitable than Bitcoin that the hardware owner might not want to put the effort into researching. Also, sometimes mining pools might buy it to test new features on their pool.


text:
How do the various bitcoin roles interact?
I think I've reached a reasonable (-ish) understanding of blockchain and bitcoin as it works just below the surface, but I still don't get that surface view. So, from the umpteen videos I've watched, I can see that there are at least three roles -- i.e. kinds of people/companies -- involved:
A. End Users -- people who just want to use bitcoin. For example, I might have BTC in a bitcoin wallet on my smartphone and I use it to buy a pizza via Lightning. And then transaction ends up correctly residing in the blockchain
B. Miners -- people who bundle up a bunch (two to three thousand I believe?) of End User transactions like mine, do the POW "stuff", and package the whole lot into a new block to be offered for acceptance into the blockchain
C. Chain Maintainers - I made that name up 'cos I'm not sure what to call them. But they are the people/agents responsible for accepting the newly mined blocks from the various Miners and deciding if/when to fork, which forked chain is longest, when to discard a branch deemed to be dead, and so on. In other words, they are the ones who make decisions on which blocks are accepted, based on the Proofs of Work done by the various Miners.
So my questions are:

How, and in what form, do my End User transactions between me and my pizza purchase say get out into the world and eventually reach the Miners? Do they go directly -- but that would mean gazillions of pizza purchases etc flying about? Or do they all go to some kind of aggregator -- one of the "Chain Maintainers" perhaps -- who bundles them up into batches and sends those bundles out to the Miners?
Once my transaction gets to the Miners, and they have then packaged it and others together into a POW'ed block ready to be offered to the "Chain Maintainers" for acceptance, exactly what does it broadcast? Is it just the new block itself? Or is it the entire chain with the new block appended? BUT SPECIFICALLY:
How does the Proof of Work information itself get from the Miners to the Chain Maintainers? I don't mean the hash itself -- I mean the fact that Miner A expended 4 GigaOodles of Work to produce its version, whereas Miner B expended 800 TeraOddles of Work to produce its version? I presume it's in the newly mined block itself, but where and in what form? AND FINALLY:
Where, exactly, does the famed Blockchain actually reside? Or rather, who maintain copies? Since it's currently several hundred GB in size and growing, I know I don't have a copy in the wallet in my phone, so who does? Is it just the various people/organizations in the "Chain Maintainers" group; every single Miner as well; someone else; who?

Thx.

The role that you call "chain maintainers" are actually referred to as nodes. A node receives blocks and transactions, verifies them, and forwards them onto other nodes. An important thing is that all miners are also nodes - this allows miners to also receive blocks and transactions.

How, and in what form, do my End User transactions between me and my pizza purchase say get out into the world and eventually reach the Miners?

Your end user software will connect to one or more nodes and send your transaction to those nodes. Those nodes will verify your transaction, and if it is valid, they will send your transaction on to other nodes that they are connected to. In this way, your transaction is spread throughout the network of nodes. Because all miners are also nodes, they will eventually learn of your transaction as some nodes will eventually relay the transaction to them.

Once my transaction gets to the Miners, and they have then packaged it and others together into a POW'ed block ready to be offered to the "Chain Maintainers" for acceptance, exactly what does it broadcast? Is it just the new block itself?

It is just the block itself, and the relay is done in the same way that your end user transaction was relayed, but with a block instead of a transaction. So once a miner finds a valid block, it will send it to the nodes that it is connected to. Those nodes will verify the block, and if it is valid, they will forward it on to the other nodes they are connected to. In this way, a block is spread throughout the network. Eventually, all nodes, including the other miners, will learn of the new block.

How does the Proof of Work information itself get from the Miners to the Chain Maintainers? I don't mean the hash itself -- I mean the fact that Miner A expended 4 GigaOodles of Work to produce its version, whereas Miner B expended 800 TeraOddles of Work to produce its version? I presume it's in the newly mined block itself, but where and in what form?

The block header itself is the proof of work. There is no need to know how much hashrate a specific miner has. That is completely irrelevant. The mere existence of a block header which has a low enough hash is proof that work has been done. When a miner sends their blocks to other nodes, the block header is their proof that they have done work.

Where, exactly, does the famed Blockchain actually reside? Or rather, who maintain copies?

Many nodes will maintain a copy of the blockchain. When a new node is started, it obtains a copy of the blockchain by asking nodes it has connected to for all the blocks in the blockchain.
Some nodes will have enabled pruning which allows them to delete old blocks for storage. Obviously those nodes will not have the full blockchain, but they will have verified every block prior to deleting it.


text:
Having Address format, infer derivation path or BIP used
Hello fellow Bitcoiners.
While studing bitcoin, I came across an issue, I wanted to ask if someone knows how to know which derivation path a 1xxxxxxxxxxx address was created with.
I know that bc1xxxxxxxxxx addresses uses BIP84
3xxxxxxxx addresses uses BIP49
but 1xxxxxxxx addresses could have use BIP32 or BIP44.
Is there a way to know which method (BIP32 or BIP44) was used by only having the address ? My guess is not, but wanted to ask anyways.
Thanks in advanced

Does this answer your question? Most common derivation Paths, accounts and indexes

Thanks for the link. I just want to know if is possible to tell BIP32 & BIP44 apart. But as I suspected. There is none

No, you cannot.
One issue is as you pointed out that some address types have multiple standard derivation paths/methods associated with them, and the data encoded inside the address is indistinguishable from random (apart from the version number/type of address used).
But even beyond that, nobody is required to follow such standards. Many wallets have their own conventions.

Thank you very much for the explanation Pieter.


text:
How to leave the Bitcoin testnet?
My BitcoinCore client says it's on the testnet. I've done nothing to configure this. How do I change it to do real Bitcoin transactions and wallets?
Also, every time I shutdown my PC the client had to rebuild the entire Bitcoin transaction history. Is that because it's on the testnet? It seems unworkable to me if I have to do an entire rebuild every time I want to shutdown my PC or install an update.
I haven't been able to find any information on the purpose of the testnet and the differences between the main Bitcoin network. Although I can make guesses.

@Prayank Bitcoin doesn't have a folder in AppData, while lots of other programs do. I also looked in other AppData folders. While searching for this file I found that 2 clients have been installed. 1 testclient (green) and 1 real Bitcoin client (orange). Having started the real one it's almost finished updating the transaction record :) I also have access to the wallet I created. Apparently the first time I got the right client, but later the OS found me the testclient, so it never downloaded the same transaction history again.


text:
When was proof of stake theorized?
Hi l've seen a while ago that Proof of stake concensus mechanism was theorized a while ago (before proof of work) in distributed systems. But I can't find any source of that, while searching 'proof of stake' on internet can only see Ethereum related stuffs. Was proof of stake theorized in 2011 or before that ? Thanks a lot

According to https://academic.oup.com/rfs/article-abstract/34/3/1156/5868423, the PoS was first introduced alongside Peercoin in around 2012.

According to King & Nadal 2012 "A concept termed proof-of-stake was discussed among Bitcoin circles as early as 2011." However King & Nadal seem to widely credited with the term.


text:
Speed of Merkle Root proofs in SPV
Is it really more efficient to use the Merkle Root proofs system to verify that a transaction is included in a block for SPV clients compared to Download the block and check if the transaction is included in it and discard the block afterwards ?
(Both case does not sync the full Blockchain)


text:
Creating transaction with using blockcypher

https://api.blockcypher.com/v1/btc/main/txs/new?token={{TOKEN}}
To use BlockCypher's two-endpoint transaction creation tool, first you
need to provide the input address(es), output address, and value to
transfer (in satoshis). Provide this in a partially-filled out TX
request object.

From where can I get input addresses to create transaction?

It's simply the address(es) that you want to send Bitcoins from.

I thought these were the addresses from which input transactions were sent.

I think you need to use the Address API with the Address Balance Endpoint. If you set the flag unspentOnly to true the response will only include unspent transaction outputs (UTXOs). Once you have a list of unspent transaction outputs you could use them as input for Create Transaction Call. I hope this helps.


text:
Options for accessing my BTC after host went down
Years ago I had put BTC into a store wallet. The store went bust and I didn't get to transfer my BTC into another wallet before I lost access to it.
I can still see the balance on blockchain.info and I have the PIN code provided to me by the store to verify my ownership of the coin, but I don't know if I can access it, and if I can, how would I go about it?

I don't know if I can access it

You can't.

I can still see the balance on blockchain.info

That means you probably know the Bitcoin-address associated with some amount of money. However, knowing an address doesn't give you any control over that money.

There's a common phrase in the Bitcoin world:
Not your keys: not your Bitcoin
The only important information stored in a Bitcoin wallet is a secret number known as a private key. It is knowing that private key that makes it possible to spend Bitcoin money. Without that key you have no control over the money.
An account with a store is almost always a custodial wallet meaning the store has custody of the keys and you don't. Your PIN just tells the store who you are. That PIN is now useless.
This is why many people recommend non-custodial wallets, not custodial wallets (accounts). Especially for long term storage of money that isn't being actively traded.
You need the private key or the seed-phrase (also known as a recovery phrase or backup phrase) from which the private key can be derived. These phrases are typically made of 12, 18 or 24 words from a standard list of about two thousand words. It seems you don't have this.

Thanks. That's about what I expected.


text:
Is it possible to derive bitcoin adress from blockchain.com id?
so here is the situation: my friend lost password to his "blockchain.com" wallet. He opened it in 2015 approx. And asked me to help get access again to it. He even doesn't remember are the funds in it. He had 3 blockchain.com accounts. To one of them he collected bitcoins from faucet freebitco.in
we have email and blockchain id (which is sent to email). support does not help.
so the question is: Is it possible to derive bitcoin adress from blockchain.com id? so we could check are there bitcoins in it and know is it worth of finding password to it or just for fun to that he lost to access to n number of bitcoins)

No. The Blockchain.com ID is simply a random ID number that points to an encrypted copy of your wallet. Their support will not be able to help you find the addresses or gain access to the wallet even if they wanted to.
Unfortunately, if you've lost your password and your recovery key, and you can't find any backup copies of them, you're probably out of luck.


text:
Trusting only the proof of work to receive payments
I understand that a pruned node needs to download all the blockchain in order to verify the blocks and construct the UTXO set.
But wouldn't be possible to download the headers only?
Let's say if the current block is 100
we download 100 headers and we consider the 94 first headers as valid.
(100-6 = 94 , 6 is arbitrary and can be changed to prevent reorg)
We download blocks 88 to 94 and consider their data as valid.
And when receiving a transaction we check if this transaction is included in the blocks considered as valid.
And we constantly update that when a new header is added to the header chain.
If the server is down then it won't notice the payment but that's another problem.
Can it work to receive payments ?
I understand that as long as we never construct the UTXO set we can't create transactions and can't verify blocks. But does this idea of trusting proof of work only can work to receive payments?
or am I missing something ?

That's certainly possible, but this type of validation is called "lightweight verification" or "simplified payment verification" (SPV). There are several wallet implementations that use this principle, and it is in fact explained in section 8 of the Bitcoin whitepaper.
That is however not what a (pruned) full node does. The point of a full node is to fully validate every block and every transaction. Without full nodes, there would be no incentive for miners to construct honest blocks, and thus indirectly, this would also impact the security of lightweight clients.

Wow I did not made the link in my head with SPV.
My bad
Thanks for this clear answer !


text:
Offline Bitcoin Wallet
I would like to have bitcoin and store them as safely as possible. I want bitcoin data to be stored on my disk -- I don't want to some online service to manage my wallet. I also would like to have ability to easily backup wallet data so if my disk fails I can then recreate my wallet from backup.
Nice thing is to have ability to transfer wallet from one program to another so if some program ceased to be developed I can import my private/public keys to another program.
Can you recommend any application like that?

The only thing you need to spend bitcoins is a Private Key, I recommend that you create a Private Key beeing offline, then import it to Bitcoin Core wallet or Electrum Bitcoin wallet (if you don't want to download the complete blockchain) these are the most secure protocols.
First you need to create a Private Key, it consist on a 32 byte array on HEX format(64 characters), you can use SHA256, for example: ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
Its highly recommended that you make this process offline and the input of the SHA256 should be as random as you can.
Then convert it to Wallet Import Format (WIF) following this guide: https://allprivatekeys.com/what-is-wif.
Then import WIF to the wallet:
Bitcoin Core: https://en.bitcoin.it/wiki/Help:How_to_import_private_keys_in_Bitcoin_Core_0.7%2B
Electrum: https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/


text:
how to get private key from passpharase in php?
i have a passpharase bitcoin, but i don't know how to get private key from my passpharase. I tried using blockchain and electrum and it worked. but here what I need is to find the private key using php.
please help me how to find the private key?

Do you mean you have a mnemonic seed phrase (generally 12 or 24 words long)? This is different than a password/passphrase.

if you have mnemonic seed phrase
use offline
https://iancoleman.io/bip39/

The question asks how to do this in PHP though.


text:
How to find Reused R values
I use software from  https://github.com/ca333/rng-scanner , I try to find r that is reused. from the software I found results
Bitcoin Address : 1GQdrgqAbkeEPUef1UpiTc4X1mUHMcyuGW
In Input NR : 141 ~ 220020a271a0897f1b7a7f0db9acb517ae2b6d53dda3833808d02c6a1cc21dc1a68680
Resued R-Value : a0897f1b7a7f0db9acb517ae2b6d53dda3833808d02c6a1cc21dc1a68680

How do I find the s and z of the reused r value?

Does this answer your question? Recovering private key when someone uses the same k twice in ECDSA signatures or this: https://bitcoin.stackexchange.com/questions/73622/how-do-you-derive-the-private-key-from-two-signatures-that-share-the-same-k-valu

The one of the best way (I do it by that way) to find reused R values is to parse the raw blockchain database with my blockchain parser with extracting only Input script and TX hash values and then cut off from script strings all except R value. So you get all R values ever generated. Then you can check those data for reusing R and easily find those TX's full data using it's hash.
This is the universal automated method for making such research for blockchain. I think this way is not the way like getreusedr > result.txt but I think it also can help you very much.


text:
What does sigscript and witness mean?
I tried using the R scanner from the following link https://github.com/ca333/rng-scanner/blob/master/rscan.py, then I got results like this
Bitcoin Address : 3EZ5yV5FARDqEZTXzwWNt33XLVhv7hqAS2
R: 09a8bcef1c9f806b7ba1f6f07d2ac45469a0e860fb14e3e151ce1e710483
TxId : 9ae7ce79fa8501dd92ade347fae7c1737ccefa6db204a2fae485634c265d5494

then I open the transaction link and see the sigscript and witness of the transaction
https://www.blockchain.com/btc/tx/9ae7ce79fa8501dd92ade347fae7c1737ccefa6db204a2fae485634c265d5494

What does sigscript and witness mean of the transaction? Why are the sigscript and witness forms different from the transactions below?
https://www.blockchain.com/btc/tx/c525f9a78b92a1082ef690ef538c803fa4ed2f4b1c008a8effc3cba3ac6773d3

The scriptSig is a script that is used to satisfy the conditions of a scriptPubKey. Usually, the scriptSig pushes values such as a signature and public key onto the stack which are popped by opcodes such as OP_CHECKSIG in the scriptPublicKey that return a boolean.
The witness data is found in Segwit inputs and has the same information in the scriptSig, except it is interpreted as a stack rather than a script, because the scriptSig is supposed to only push values onto the stack in the first place. The rationale is that the scriptSig can be modified after the transaction has been signed, presenting malleability issues. It is actually changed just once by walle software, after replacing the dummy scriptPubKey script stored in that location with the real scriptSig after the transaction is signed, but there is a potential for it to be misued.
For Segwit inputs, the scriptSig is supposed to be empty (or a push of the redeemscript if it is nested inside a P2SH script) as specified in BIP 141. This is part of the reason why old wallet software can't receive bitcoins from Segwit addresses.

See: https://en.wikipedia.org/wiki/SegWit#Segregated_Witnesses_as_a_solution
The first transaction you linked is a Segwit transaction the second is a standard/legacy p2pkh. You can notice that the p2pkh is more expensive in sat/B fees.
As explained in the above link, witness means signature data. It is further explained here: What is "Witness"?
Basically Segwit or p2wpkh inputs require a field called witness which can be used to derive public key spending conditions that are just locked to the pubkey hash in p2pkh txs.
scriptSig is the name for the signature data of the tx for a p2pkh script in this case. This gives info about the scriptSig in p2wpkh txs: What is the size and weight of a P2WPKH input?


text:
I want withdraw from BitPay and send USD to bank account in Puerto Rico. I reside in Argentina. Is that possible?
I want to withdraw/sell bitcoins that I have on my BitPay wallet. I need to transfer the results USD to account in Puerto Rico. I reside in Argentina.
I have already tried with Skirll, but does not allow Puerto Rico bank account.

If a US Exchange does not let you withdraw into your PR USA account, have a look at Wise used to be TransferWise

You might need to list them for sale on a site like Coinbase (?) to convert them to USD. Then you would use your PR account to deposit the funds into. From there its a regular bank transaction of USD to Argentina or wherever.


text:
Trouble deriving a BIP 32 Child Key
I have a small Python program I'm writing to generate BIP32 keys, including child keys. I've gotten to the point where I can correctly generate a master extended key pair, but I'm not able to correctly derive a child private key and chain code. I've copied my code below:
import hmac
import struct
from hashlib import sha512

def CKDprv(chain, data):
  data = data.to_bytes(33, 'big') + struct.pack('>L', 0)
  return hmac.new(chain.to_bytes(32, 'big'), data, sha512).digest()

def split_key(key):
  length = len(key) // 2
  return key[:length], key[length:]

pub = 0x0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2
chain = 0x873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d508

digest = CKDprv(chain, pub)
new_prv, new_chain = split_key(digest)
print(f'Chain code: {new_chain.hex()}')

I am using some BIP32 test vectors and trying to derive m/0' from m.
I am deriving a child key with index 0, so I am hashing the parent compressed public key appended with the index represented in 4 bytes.
According to the test vectors, the new chain code I should be deriving is:
47fdacbd0f1097043b78c63c20c34ef4ed9a111d980047ad16282c7ae6236141

but the chain code I receive from my function is:
d323f1be5af39a2d2f08f5e8f664633849653dbe329802e9847cfc85f8d7b52a

I've tried variations such as changing endianness, but nothing seems to get me the correct hash. I know I've probably made a small programming error that is throwing me off completely, and I've been staring at this problem with no progress for a few days now. If anyone can point out the flaw in my algorithm I would be greatly appreciated.

Ended up answering my own question! If anyone else runs into a situation like this, the problem is that the code is deriving a non-hardened child key but checking for the hash associated with a hardened child key. According to the BIP32 docs, to derive a child key you hash the private key prepended with a single zeroed out byte and appended with a hardened index (greater than or equal to 2^31). So in this case, I only needed to swap out the public key for the private key, prepend it with a single 0x00 byte, and use the first child hardened integer 0x80000000 instead of 0x00000000.


text:
Is it possible that Lightning Network payments may someday replace all Bitcoin transactions, rendering the block chain obsolete?
To tackle the scalability problem of Bitcoin the lightning network was introduced, which (if I understand correctly) adds an additional layer to the blockchain, allowing users to create a payment channel between any two parties on those layers. Transactions on this channel will be fast and cost little or nothing.
Now my question is: Is it possible that Lightning Network payments may someday replace all Bitcoin transactions, rendering the block chain obsolete?

In order to join the lightning network, you will generally need to create and publish a bitcoin transaction.
Likewise, to reposition your funds in the lightning network, or to move bitcoin out of the lightning network, you will need to create and publish a bitcoin transaction.
So it doesn't really make sense to say that the lightning network will 'make the bitcoin blockchain obsolete'. Even if every single payment happened on the lightning network, the bitcoin blockchain is still required, as it's liveness is what underpins the security of funds on the lightning network. If the bitcoin blockchain disappears or stops functioning, then lightning too will cease to work.


text:
How to send BTC amount from one specific address in Bitcoin Core
I canceled one transaction that was in the memory pool, now I would like to make sure that this transaction will not be sent anymore sending all BTC amount of the original address of this transaction to another address, but when I go to send BTC in Bitcoin Core, I can't choose one specific address to send the amount. So what Can I do to "empty" the bitcoins of this address using Bitcoin Core?

If you run Core with the command line flag -zapwallettxes it will forget transactions in its mempool.

I did that following the steps in this answer:https://bitcoin.stackexchange.com/questions/9046/why-is-my-transaction-not-getting-confirmed-and-what-can-i-do-about-it
But in that answer I should also send the bitcoins from this address to another address to make sure this transcation will never be completed.

New update about that: Even after I cancel the transaction with -zapwallettxes, the transactions was completed, and the other one that I made it is with the status "conflicted". That is strange to me.

Do blockchain explorers show both as unconfirmed @LucaBlight

no, I have both TXIDs, but just the txid of the first one is showed in block explorer, the second one does not exist in the block explorer. And now the first one is confirmed.

If it's confirmed unfortunately it can't be canceled.

Yeah, but there is no problem about that. I just think that using -zapwalletttxes is not the safest way to cancel one transaction in mempool, it would be better use zapwalletttxes + spend all Bitcoins in that address, but I couldn't find one way through Bitcoin core to select one specific address to spend the Bitcoin in this address.

Have you tried creating a new wallet and sending the funds to an address outside of your wallet because you can send them to an address outside of your wallet, right? And then, import the new wallet with the transferred funds.

Yes I could do that but I think that would be a little bit annoying because I would need to pay 2 fees and I think it should have a way to do that only using the Bitcoin core.


text:
See the balance without load the transaction history
Let's say I have a wallet.dat with several transactions, is there a way to see only my current balance without load all transactions in the wallet.dat?
I would like to achieve something like this because that would be lighter to load on my computer.

Sure, if you know the addresses of your wallet, you can look it up in a Bitcoin block explorer, and find the current balance of each address. There are also wallets, like Electrum, that will use third party nodes to track your balance, but cryptographically verify everything to ensure the third party node cannot lie to you.

But I need to use the Bitcoin core, I would like to load only my balance without the transaction history in Bitcoin core.

Then that isn't possible, because in order for a full node to calculate your address balance it has to load your transaction history to add up your transactions.

Yes, but unfortunately when you have a wallet.dat with too many transactions, that is a problem, because the wallet.dat will be very slow, and therefore it takes too much time to load it.


text:
Bitcoin Wallet Empty after importing using key phrase
I've recently tried to recover my Bitcoin wallet after changing phones however after importing the wallet using the 12 word keyphrase my wallet is empty (there was Bitcoin in the before). I've scanned the wallet for transactions but none are found.
Any idea what has happened and if/how I can recover my Bitcoin?
Thanks

Do you still have the old phone?

Which wallet did you use?

yes I still have access to the old phone, although the phone was wiped and restored to factory settings sometime ago

I've been using a bitcoin.com mobile wallet first setup in 2017

Any idea what has happened and if/how I can recover my Bitcoin?

First of all, try to find out what software have you used originally. Was it a desktop/mobile wallet? What was the name of the application you set up the wallet through?
Please check out this website and check the column Paths. If your original software wallet supported path like m/0' but due to software upgrades the new version supports a new path like m/44'/0'/0' or it's maybe a completely different software wallet that supports other paths like m/49'/0'/n' - in these cases new wallet won't show you any balances as addresses are being derived differently in these different paths.
If you know your addresses from a previous wallet you may also try the Iancoleman tool, remember to use it in offline mode and I would personally not use it for bigger amounts anyway.


text:
Multisig synchronization
I understand what the multisig wallets are but I need help understanding what exactly this script does:
https://gist.github.com/gavinandresen/3882537
If I understand correctly, bitcoinds are bitcoin daemons but I'm not sure what daemons should be used in this script and how it all works.

In order to set up a multisig transaction, your bitcoind needs to know the public keys that make up that multisig address, and the order that those public keys are listed in. The address itself doesn't contain this information. If you already have 1 bitcoind set up with this information, you can use this script to copy that information to a second bitcoind.
Then, once you do that, you can craft a multisig transaction, then distribute that transaction to each of the signers.

I'm not sure what daemons should be used in this script and ...

You first run two bitcoind daemons locally and then specify their ports as arguments to the command along with other information such as authentication credentials:
# Example usage:
#  multisigsync.py \
   --connect1=http://abc:123@127.0.0.1:9000 \
   --connect2=http://abc:123@127.0.0.1:9001 \
   2MsrtHjVXGdT7RuTEiUWzec87Cik1rPpmyD

In this example one bitcoind has been configured to listen on port 9000 the other is listening on port 9001
It looks like this should also work with remote bitcoind instances.

... how it all works.

It isn't clear what part you want help with.
The ServiceProxy stuff seems to be described at https://www.jsonrpc.org/archive_json-rpc.org/python-json-rpc.html


text:
Spending transaction output with only xpriv key
Is it possible to spend a P2WPKH transaction output, with only knowing the xpriv key and not knowing the specific private key that corresponds to the public key of the transaction?

No, you need the private key that the address in question was derived from.
There is no mechanism for the wider network to determine that an address was derived from a private key, that was derived from a specific xpriv. The transaction signature must be created using the private key that is related to the address in question.

is there a way to recover the required private key using the xpriv key?

Yes, the xpriv key is the piece of information needed to derive the child priv keys in question. You just need to know which derivation path to take; there are a few different standard paths used by most wallets.

The extended private key (xprv) can derive all the individual WIF private keys associated with that HD account. So technically it is possible to parse through the xprv keychain until you find the individual WIF private key that corresponds with the output you want to spend from.
For example, if you know the output address you want to spend from you could write a script that loops through each private key.
Psuedo code:
var myxprv = "xprv1234....";
var outputaddr = "bc1wqSomeAddress....";
var notfound = true;
var index = 0;

while(notfound){
    var eachPK = fromXprv(myxprv,0,index);
    var details = wif2Address(eachPK);
    if(outputaddr===details.p2wpkh){
        notfound = false;
        return "found";
    } else {
        index++;
    }
}


text:
Bitcoin Core resume
iam downloading the 350GB Core database via slow network.
iam not shure, if an correct resume occurs, if i need to breask the transmission.
my question:
is there any risk for inconsistence of bitcoin database, when i start multiple times?
has bitcoin core the ability to resume after stopping download?
That would be an great help to give a clear hint for that
thanks
lutz

No, it should continue at the same speed once the connections are made after it is launched.
Force quitting Bitcoin would harm the database. You will be fine as long as you respect the "don't shut down your computer before this window disappears"


text:
Is there a service that shows up used addresses containing a substring?
Is there a service that searches the blockchain with a string or possibly a regex to find out a set of possible addresses, say if I only know a half of a public address?


text:
Cannot remote to regtest node with curl cmd - Empty reply from server
Hi I'm new to rpc curl cmds and having some issues connecting to my regtest node.  I'm getting "empty reply from server" which makes me think it is connecting but something is misconfigured.
Looking through various threads here I found similar things but nothing that quite fit the bill, but apologies if this is something that has already been covered.
bitcoin.conf settings
# Options only for regtest
[regtest]
# datadir
datadir=/mnt/mydisk/regtest
# Listen for incoming connections on non-default port.(default: 8333 or testnet: 18333)
port=18444
# RPC allow all IPS (shouldn't have this on mainnet)
rpcallowip=0.0.0.0/0
# RPC bind IP
#rpcbind=192.168.86.30
# RPC port(default:8332 or testnet:18332)
rpcport=18443

my curl cmd returns
curl: (52) Empty reply from server

curl cmd
 curl --user xxxuser:xxxcookie --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;'  http://192.168.86.30:18444/

I'm also seeing this in the debug.log but not sure what it means or how to fix
UPnP: ExternalIPAddress = XX.XXX.XX.XXX
AddLocal(XX.XXX.XX.XXX:18444,3)
AddPortMapping(18444, 18444, 192.168.86.30) failed with code 718 (ConflictInMappingEntry)
UPNP_DeletePortMapping() returned: 606

Also worth noting I have another regtest node and the 2 nodes are connected without issue.
Any help appreciated.

You are defining RPC port 18443 and attempting to connect to 18444 in your example.
There's no situation where you should attempt to rpcallowip to anything but localhost, don't get used to doing that or making systems which require it. There is no situation in which this is safe to do, even regtest can cause damage to your system.

when I change the curl cmd to IP:18443 I get connection refused curl: (7) Failed to connect to 192.168.86.30 port 18443: Connection refused

You will still be binding the RPC port to localhost irrespective of what the rpcallowip value is set to. The software doesn't make this easy because it's such a poor configuration option, you would have to change rpcbind as well.

ok so I should change rpcallowip to this rpcallowip=127.0.0.1 ?  and rpcbind to the local IP of my node?   I originally had that but it looked like it was causing issues.  should I also  rpcallow my local node IP like here?  link

ok that got me connected thanks!  this is my updated bitcoin.conf config which works
`[regtest]
Listen for incoming connections
port=18444
RPC allow all IP
rpcallowip=127.0.0.1
rpcallowip=192.168.86.30/24
RPC bind IP
rpcbind=127.0.0.1
rpcbind=192.168.86.30
RPC port
rpcport=18443
`

sorry I know I already accepted this answer, but any insight into the debug.log ConflictInMapping errors? I'm still getting them

That's very unrelated to your concerns at all, that's to do with port forwarding for P2P communication which is not essential (and especially irrelevant for a regtest node).


text:
Unable to find a directory where to put wallet.dat file from my old wallet when I am on my Mac
I am on macOS 12 on (MacBook Air M1) with the latest updates applied.
I have installed Bitcoin Core from the bitcoin org website and currently it is downloading the whole blockchain and it will for a few days according to the sync pop up.
The problem is that I have an old wallet.dat file but I don't know where to copy it so I can select it from the menu of the Qt Bitcoin-Core app when selecting File > Open Wallet. Currently I see only my test-wallet I have created jsut so there is something while the app is downloading the blockchain.
Google search suggested to go to Library > Application Support > Bitcoin but the problem is that I don't see any Bitcoin folder there. I have tried to clean up by name in that folder but nothing has changed. Here is my screenshot:

Any idea how can I tell Bitcoin Core app to use my old wallet.dat file on my MacBook Air?

Does this answer your question? Where is Bitcoin information (wallet.dat) stored on OS X?  -- note the mention of a hidden folder.

No,, could it be that I have it downloading to my exterrnal harddisk? Because I see a test-wallet folder that contains wallet.dat file there. Should I create e.g. "old-wallet" folder on the same folder level as "test-wallet" and upload my old wallet.dat file there? By the way where I can find some guide how to do these importing of old wallet.dat file without reading some blog posts full of adds? Is there a wikipage for that? Also should I cope cahinstate, database, db.log, debug.log peers.dat wallet.dat from my old folder or just wallet.dat?

I would download Bitcoin core from https://bitcoincore.org/en/download/ not from bitcoin.org. I would follow the instructions at https://bitcoincore.org/en/download/ for verifying the software. I can't comment on your other questions.

@RedGrittyBrick thanks, :D seems like Bitcoin domain-parasite things is even a bigger anarchy in 2022 than in 2014. How can normies use it is beyond my understanding. It's so difficult. In 2014 I was told it will improve, but it the opposite. It's deception and fog on every BTC google search.


text:
Spending UTXO recieved in same transaction
Is it possible to spend UTXOs received in same transaction? Or we need to issue a new transaction for spend those UTXOs?

Outputs spent by a transaction simply reference the txid of a previous transaction and the index of the output being spend. There is nothing preventing you from referencing the same transaction multiple times with different output indeces.
However, this doesn't sound like something that will often happen in practice. If a transaction is spending multiple outputs, they are more than likely controlled by the same entity, which means someone previously had to send a transaction with multiple outputs going to the same entity. There are few reasons to do that and not send one larger output.

Although the case is uncommon but it is legal to reference same transaction, right?

Yes, there is nothing in the Bitcoin protocol preventing some outputs to be spent with some other outputs in the same transaction.


text:
What does getnewaddress return
The address generated by getnewaddress RPC is associated to a wallet that the user possesses or is it a random address not necessarily belonging to user ?

It returns an address you can use, not merely some useless random number.
It generates a new pair of public and private keys, stores those keys in your wallet and generates the address from the public key.


text:
I made a withdraw from my crypto wallet to extern wallet. After few days they haven’t got the transaction
I have triple checked address, it is the right one. I used BTC chain. My crypto.com says that transaction was complete. What is wrong? Why they haven’t got the transaction?

Are you sure that the external wallet is synchronized with the network? If you want someone to help investigate further, you may need to reveal more details such as what software the external wallet is, and perhaps the address you were trying to pay.—Also, you tagged this question with bitcoin-cash, but you are saying that you used the BTC chain. Bitcoin Cash (BCH) is an altcoin that has its own blockchain and network, so if your external wallet is a Bitcoin Cash wallet that would be an explanation for you not seeing the transaction.

Maybe he made a mistake and didn't want to tag bitcoin cash?

I guess we'll never know, because they never returned to follow up.


text:
binance on site data and api data doesnt match
When I collect say 1 minute historical kline data through the API, I see differente close times to what I see on the site checking the same time's candle. (I am matching data to UTC time that is not a factor here.)
Do you have any tips what might be the cause?

I have realised that the site doesn't refresh correctly, and I only needed to reload the site to match the one that gets returned through the api

Yeah, the JSON API used by the web interface seems to just fall asleep after a few hours, and stop refreshing.


text:
how can i access my private key on the BIP39, if i only got my public address?
actually, i can not access my private key of my wallet after a fire incident in my house. After which i realized i cant access my private key, i have gone to the bitcoin balance checker, checked on my last transaction info, then copy the hash addresses, and try hashing on BIP39 site. i paste the hash addresses i got from the bitcoin balance checker site into the BIP39 Seed to hash out either a corresponding root key, or identifying the address from the Derived Addresses details i got on the last transaction with my wallet address, but no avail, i am so confused and frustrated, someone should please help me i have lost access to my entire fund.

Sounds like you are pasting a bitcoin address into a BIP39 calculator, that won't work. Do you remember how you created this wallet originally? You should have been given a group of seed words when you created the wallet, do you have that?

i created the account since, but didnt save it anywhere apart of my laptop, and after the fire accident, i can access the group of seed. God!! please someone should help me or i am finished

Does this answer your question? How can I recover the private key for my bitcoin address? or Lost private keys, Help to recover. or How to recover my money

If you don't have any private information, you can't access the funds for the same reason everyone else can't access the funds. You have to know something nobody else knows. What tool did you use the create the wallet and private key in the first place? What information did it give you? What do you still have?

sorry to everyone out here willing to help me on this, i am acting against doctors prescription just to meet up with all that could help me on this. back to all the questions asked,

regarding how i created this wallet it was on a Toshiba laptop. and for the private key address, i actually save the info on a notepad folder in the laptop

If the hard disk is destroyed, and you made no proper backups, your money is unrecoverable.


text:
transferring funds from bittrex to binance
I want transfer a btc from bittrex to binance but they are telling me that they are supporting only non segwit adress. I don’t know if my btc adress In binance it’s non segwit too.   Thank u

Are you asking how to tell if an address is a segwit address?

I'm answering this question under the assumption that you are asking how to tell whether an address is a segwit address.
Judging from some Reddit threads I've found, Bittrex does not support withdrawing to native segwit addresses. Native segwit addresses start with the prefix bc1…. If the deposit address you got from Binance starts either with 1… or with 3… and Bittrex accepts it in their withdrawal request form, you should be fine. If it does start with bc1… look whether there is some option on Binance to switch the address format for the deposit address.

Thank u for responding. My btc adress in binance it’s starting by 1Pn. it’s good ? And an other thing I tried before with the btc adress in binance (ERC20) and it stayed pending for hours and when I looked in the blockchain I didn’t find the the same amount that I sent. So I was little scared to lost it, then I canceled the transaction.

An address starting with 1Pn… would be a non-segwit address and should work for a withdrawal from Bittrex. Do not use the ERC20 address, ERC20 is a standard for tokens on Ethereum.


text:
What if a multibit classic private key is decrypted into garbled codes?
7 years ago I exported the multibit classic wallet and private key, both encrypted. Only remember the key password now. Problems occurred when I tried to decrypt the key in following ways:

installed MultiBit Classic 0.5.17 from web (might be dangerous).
Created a new wallet and tried "tools--import private key". Chose the old key, input the password and clicked "decrypt". The password seemed correct because there wasn't a fail note, which always appeared for other passwords.
Then, when I clicked "import private key", a fail note said "could not understand address in import file".
To compare I exported a new encrypted private key and followed steps above. It worked well. Though the new key had a wrong timestamp in 2014, it didn't hinder the import.

Used openssl in cmd to do direct decryption, found the only code:

openssl enc -d -p -aes-256-cbc -md md5 -a -in multibit.key  -out key.txt  -pass 'pass:myPassword'
that can decrypt the new key successfully. When decrypting the old key, it didn't show any error either, no "bad decryption". But the plain text was garbled like

?躠磱Q?39'ad"t鉼!?狡

_決[qp嗽雔紧鸘:?A濵彆r闞? &*绉i#唹B7鼞_z?

Tried lots of text-code-converter and they only gave different garbled text...
How would this happen? Was the old key exported incorrectly in 2013? Is there any hope?

I think what you are seeing is binary data being viewed using a program (or command) that expects ASCII or UTF-8 encoded character data.
I would add -base64 to the openssl command and see if that produces the results you expect.
If you need the key in a different encoding (like say base58 or WIF) you might have to do that as a separate step using a second command/program.

Decrypting keys from Multibit
I found some instructions for decrypting Multibit keys which don't say if they are for Multibit Classic, Multibit HD or for both. It may be they only work for one and not for the other.

This is the format of the MultiBit private key file
Keys are saved in an ASCII encoded text file.
There is one key per line (empty lines and lines starting with '#' are ignored).
\<Base58 encoded private key\>[\<any number of whitespace characters\>[\<key createdAt in UTC format\>]]

To decrypt a MultiBit private key export file use:
openssl enc -d -p -aes-256-cbc -a -in \<ciphertext file\> -out \<plaintext file\> -pass pass:\<password\>

Note that this command lacks the -md md5 option you used. I would try this version.
The OpenSSL manual page says

-md digest
Use the specified digest to create the key from the passphrase. The default algorithm is sha-256.

so this would affect decryption.
The results you are reporting suggest that either the instructions you used don't apply to the particular version of Multibit you used or that you don't have the correct data file or perhaps don't have the correct password.

Importing keys into Electrum
According to instructions for importing keys into Electrum, Electrum needs the key in Wallet Import Format (WIF) so you'll need to convert your exported Multibit key into that format. It looks like it is easiest to start with a hexadecimal representation rather than the Base58 Multibit and others use.
Note that you can't just import a private key into Electrum at any time. You can only do that when you first initialise and create the Electrum wallet, not subsequently.


text:
Is it possible to increase the prune size and get bitcoind to pull previous blocks?
for example, currently its:
  "size_on_disk": 32084546902,
  "pruned": true,
  "pruneheight": 650668,
  "automatic_pruning": true,
  "prune_target_size": 67108864000,

Is there a way to decrease the pruneheight? I need the prune height to be 630000.
I increased prune=64000 from prune=32000 but from what I can tell it will just store more blocks going forward?

Bitcoin Core doesn't have such a feature. The prune depth controls how many blocks are kept, and you can change that (-prune=N option on the command line or prune=N in bitcoin.conf), but once a block is pruned, it is gone. If you want to add blocks back, for now you'll need to resync from scratch.
There is no technical reason for this; it's perfectly feasible to implement a mode where desired old blocks are refetched and inserted into the blocks datadir again, but this simply isn't implemented at this point.


text:
How to send bitcoins from one address to another without wallet
I generated btc address and put some coins into it. Now I want to send coins to another address. I can't find any infomation about how I can do it. I don't have wallet, I only have address: public key and private key.

If you have your private key, you are able to import it into a wallet and send the coins from there. The trustless way to do this would be to start your very own Bitcoin and user the Import Private Key RPC call. You then would be able to use the Send To Address RPC call to send the coins.
Depending on your necessary security level, it may be easier to just use an online wallet service like BTC.com. They have instructions available for importing private keys as well: https://help.btc.com/hc/en-us/articles/360002934354-How-do-I-import-my-private-key-into-the-wallet-

Thanks a lot! Tell me please, why it is a trustless way to use bitcoin core? I thought it is the most trusted way)

@Oleg: By trustless mkaplan means without the need to trust intermediaries. Bitcoin was designed to be trustless in this sense. Trustless is different from untrusted or untrustworthy.


text:
How can I get address's balance that doesn't belong to my Bitcoin core wallet?
I have been looking for a way to see the address's balance that doesn't belong to my own Bitcoin core wallet.
I don't like to use an external API, I have this full node and I really wonder if this is possible.
I saw this Pieter Wuille's answer: How to get an address's balance with the bitcoin client?
But it is an old answer when Bitcoin core even didn't support addresses as watch-only.
What I can understand from his answer is I can't see this information on my Bitcoin core, but right now with Bitcoin core v0.20.1, is that still not possible?


text:
Selling Test bitcoin
I have a random and maybe crazy question. Can I sell test coins? Someone recently told me that Advanced Market Terminal is buying them. It is strange to me Since they should hold no value.

I don't think this should be voted as off-topic: OP hasn't asked about where to sell coins, they've asked about the possibility/viability of selling them. That question has an answer, which is not expected to change, as the functionality of testnet is dependant on tBTC having no monetary value.

Testnet coins are an interesting thing:

They are useful because they have no value
If they had value, they would be useless

Remember that the testnet is there to test out your code, and ensure that everything runs smoothly before you deploy that code to an environment which is holding actual value. That way, if something goes wrong, you haven't lost anything of value.
So you certainly could sell someone testnet coins, but I'm not sure why anyone would pay you for them.

If you want larger amounts of testnet coins (0.1 or more), you still need to run a miner to get testnet coins and the amount of testnet coins is still limited to 21 million like maininet. So I can see why someone might want to pay a small amount for testnet coins just so they don't have to wait for the mining process.
If no blocks are found on testnet in 20 minutes it will reset difficulty back to 1, which is the lowest difficulty making finding a block very easy.
So I suppose it depends on the patience of the person, if no patience then maybe you can find a buyer, but the difficulty reset is supposed to help keep the value at or near zero.

A developer wanting to test their code doesn't need to mine tbtc to get it, there has always been many active testnet faucets that give it away free and fast.

I should clarify I was referring to getting larger amounts to test with. There are very few faucets and they only give out small amounts.  If someone wants 0.1 tBTC or more a faucet is not an option.

Testnet coins do not have an official value. Most people will not pay anything for Testnet coins, and there are no markets that I know of that would exchange tBTC. However, if you have a large amount someone might pay for large volume. Testnet is supposed to be free though.

I guess the advanced market is also a trade security broker.. but they also focus on digital currency app development and this is why they buy Test coine as well. .... ♀♀♀ I did not think a place like this exist. But my source also could be wrong, who knows


text:
What is the electrum bitcoin wallet password encryption method?
What method does Electrum bitcoin wallet use for password encryption?
I want to check to see if the file encrypted with the password is secure. And what are the ways around to decrypt it outside the electrum.

https://electrum.readthedocs.io/en/latest/faq.html#how-is-the-wallet-encrypted

Electrum uses two separate levels of encryption:
Your seed and private keys are encrypted using AES-256-CBC. The private keys are decrypted only briefly, when you need to sign a transaction; for this you need to enter your password. This is done in order to minimize the amount of time during which sensitive information is unencrypted in your computer’s memory.
In addition, your wallet file may be encrypted on disk. Note that the wallet information will remain unencrypted in the memory of your computer for the duration of your session. If a wallet is encrypted, then its password will be required in order to open it. Note that the password will not be kept in memory; Electrum does not need it in order to save the wallet on disk, because it uses asymmetric encryption (ECIES).

see

https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme
https://electrum.org/#download

Having a password and file، Is there a way to decrypt the file outside of Electrum?

@Monero: as a software developer, my first thought is to inspect Electrum's Python source code, find where it reads and decrypts the file and cut & paste much of that into a separate program. Otherwise I don't know. Maybe there's some tool such as OpenSSL which supports the appropriate algorithm. You'd have to use a search engine to look for something like "ECIES decryption tool OR utility OR program". ... which finds things like https://pypi.org/project/eciespy/ (untested) - However the job may be not that simple.


text:
Why there are so many miners, if only one will be rewarded?
Why do we need so many miners, if we anyways only can add one block every 10 minutes? I mean if the current block height is x and we now need the block of height x+1 only one miner will be rewarded right? And all others who also tried, go away empty-handed.

It's all about expected value.  A small chance of winning something big can be worth paying for, if the odds are right.

One way to think about bitcoin mining is to phrase it in terms of a lottery. The bitcoin network essentially hosts a sequence of lotteries, and the protocol is designed (and enforced by nodes) such that, on average, the time between one lottery and the next is ten minutes.
Those who are interested in buying tickets for these lotteries (miners or prospective miners) are able to use their knowledge of the protocol to compute a valid ticket. The computation is the non-refundable purchase of the ticket.
However, a valid ticket is not necessarily a winning ticket. Naturally, miners want to acquire as many valid tickets as possible so as to maximize their chances of winning the lottery.
Alas they must balance this desire to win with the cost to acquire all those tickets and compare this cost to the miner's perceived value of the reward (block subsidy + fees). When the miner includes in this analysis the risk not winning even though they purchased all these tickets, many of them choose to join mining pools. Doing so reduces their likelihood of walking away completely empty handed, albeit they will not walk away with the entire lottery reward either (it is shared among the pool members).
Lastly, to address the first part of your question, bitcoin does not need so many miners. Just a handful would do. However, the reason why there are so many miners is simply because the expected value of winning these lotteries is such that it, in the eyes of those participating, it is worth the expected value risk/cost of participating in them. The difficulty adjustment algorithm essentially regulates the expected costs associated with winning the lottery. Ultimately, what we know is the number of lotteries that have been held (blocks), but the exact number of miners participating in any one of them is unknown.

We need more than one miner because ...

We must avoid centralisation as a goal of Bitcoin is to avoid the need for trusted third parties.
We need miners to invest sufficient work to make the Blockchain effectively immutable. Otherwise we lose any agreement about who has money. This requires a competitive set of participants who undertake mining. It requires that there be a set of miners participating whose combined computing power is sufficiently large that it is uneconomic for one of them to attempt to seize control and commit fraud.

We get more than one miner because it is necessary to provide a monetary incentive to those who do the work of ordering transactions and securing the Blockchain. In a purely peer to peer system this attracts multiple participants.

Because there's a new block every 10 mins in Bitcoin and even less time in other cryptocurrencies, ie ur a miner probability of winning increases with the number of blocks.
Also, many miners join mining pools where the pool divides the reward bet participants according to the no of hash Trials they performed (how much did they pay or work) not according to who solved the puzzle first (as it's purely a matter of luck). I think in this case miners r more guaranteed to get paid


text:
Configuring electrum wallet with command line only
I successfully installed electrum on an ubuntu server using the first ref from google search. But how I can configure it without GUI I didn't find.

how I can configure it without GUI

Maybe
electrum -o setconfig ...

For example,

https://electrum.readthedocs.io/en/latest/ssl.html
https://electrum.readthedocs.io/en/latest/jsonrpc.html

etc

Thanks for your participation. But i'm afraid i can't do it using official docs. There are not any real examples which i could adopt.

electrum setconfig <key> <value>

You can find a list of config keys here:
https://github.com/spesmilo/electrum/blob/033ad0feb9baf4dd080fadd784bad2bf8fd1e92b/electrum/simple_config.py#L840


text:
How to open Google Drive File with Coinbase Wallet Backup
How do I open and access the Coinbase Wallet backup file in Google Drive? I've been locked out Coinbase Wallet but I have that Google Drive back up file. The problem is that when I open it, it's completely blank. Any help would be greatly appreciated.

I didn't know coibbase offered non costodial wallets. What format is it in? Do you see 12 or 24 random words? Do you see a string of hex characters? I would say electrum wallet is a great open source wallets that allows you to import private keys from many different places.

I should have said don't post the contents of whatever backup you have in case it wasn't obvious


text:
BIP39 English Word List
Looking through the 2048 words on the English BIP39 list on GitHub, I could see there are lots of words that differ from one or more others by just one letter. This is inherently weak as it is too easy to mistake one word for another in the list. It's not fault tolerant either.  The German list readme.md appears to say the German list has been tested and constructed in a thoughtful manner.  The English list would fail the sort of tests the German list passes.

Is there a standard in BIP39?
Is there a set of approved compliance tests or an approved compliance testing tool that the English word list can be subjected to and subsequently made more robust and resilient against stains and fading?
Does BIP39 define a mechanism for evolving the word list?

As it stands, I'm not yet ready to trust an English seed sequence.

Is there a standard in BIP39?

BIP39 says:

An ideal wordlist has the following characteristics:
a) smart selection of words

the wordlist is created in such a way that it's enough to type the first four
letters to unambiguously identify the word

b) similar words avoided

word pairs like "build" and "built", "woman" and "women", or "quick" and "quickly"
not only make remembering the sentence difficult but are also more error
prone and more difficult to guess

c) sorted wordlists

the wordlist is sorted which allows for more efficient lookup of the code words
(i.e. implementations can use binary search instead of linear search)
this also allows trie (a prefix tree) to be used, e.g. for better compression

The wordlist can contain native characters, but they must
be encoded in UTF-8 using Normalization Form Compatibility
Decomposition (NFKD).

I don't think there's any conformance test specified in BIP39 itself. Since Bitcoin is (arguably) decentralised as much as reasonably possible, there isn't really any single person or body who can authoritatively or officially approve lists or tests.
In a List of BIP39 wordlists there are additional criteria that have been applied for some languages other than English.
I believe you could, with careful preparation, engage in discussion with the Bitcoin development community in their preferred fora and subsequently attempt to craft a BIP that is likely to get broad support among both developers and the broader community and submit your BIP to supersede BIP39. You'd have to be sure that others with lower expectations would be willing to go along with the disruption or make careful provision for compatibility with BIP39 and programs that use it.


text:
Is a channel's 'max_htlc_msat' setting only for outbound HTLCs, or for both sides?
I'm currently setting max_htlc_msat value of my channels to a value similar to their curent local balance, in order to get hints about the max it can curently route (outbound).
Indeed, this made disappear the routing error 'unsufficients fee to route HTLC' because remote nodes don't even try to route when it wouldn't go through (when my outbound channel does not have enough liquidity on my side to send to the next hop).
But now, i realized that when a route succeeds, there is a HTLC for it on each channel. So would'nt it make sense that my value of this setting for the other channel is also checked, regardless of the direction (meaning the max htlc is the smallest value for the param of the values of each peer of the channel)?
Consider the case where a channel has everything in local balance, and the other has everything in remote balance. By limiting the outbound channel to a very low max_htlc_msat value, am i not also limiting the HTLC that would go the other way, so i am actually getting the channel 'stuck' because it also wouldn't be able to route big transactions in the direction that would rebalance the channels?

Channel parameters (in some implementations called channel policies) are usually set for the outgoing channels. This may change to some degree with the way how some implementations try to push for inbound routing fees (which obviously have to be announced for inbound channels).
Also, on a more meta-level, I note that changing of your available liquidity in real-time may not work as peers will not forward that many channel_update messages. As the semantics of max_htlc_msat are clear and sending nodes respect those during the planning phase of payment routing, I have previously suggested to find a more stable pair of values that you and your channel partner negotiate to statistically produce a balanced channel. However, such a negotiation protocol has not been implemented yet as part of the protocol. Thus, you are back to square one with your observation that you cannot control the inbound value of this parameter.

Thanks! I was expecting the answer, but suddenly found it strange that if we ca set max htlc for our channel, we should be able to set it for both directions. My channel updates only update at most 1 max_htlc value for a single channel per hour, so generally the info is up to date enough. That article about valves was one of the few that motivated me to try tuning here, so thanks again!


text:
How to use unencrypted mkey to derive all private keys by BIP32 path？
The wallet is damaged, I only have the unencrypted master private key, How to recover the wallet?

Does this answer your question? Golang how to derive address from bip32's xpubkey?

There are tools like:

the BIP39 tool: https://iancoleman.io/bip39/
the BIP32jp https://bip32jp.github.io/english/

They take a so-called extended key (e.g. "xprv9tuogRdb5YTgcL3P8Waj7REqDuQx4sXcodQaWTtEVFEp6yRKh1CjrWfXChnhgHeLDuXxo2auDZegMiVMGGxwxcrb2PmiGyCngLxvLeGsZRq") as input and output corresponding private keys that can be copied to Bitcoin Core using RPC importprivkey in order to replicate a wallet.


text:
Sugar Daddy Bitcoin
I’m 19, some guy messaged me on instagram asking if I would be interested in an online arrangement with him for a weekly allowance of 600$, so basically a sugar baby, we then switched over to communicating through WhatsApp, and he explained that I would get $200 in 3 days to make it $600 weekly allowance for some cute pictures and also running “errands” for him, I asked what he meant by this and he said just normal pictures and the
errands  being that when my allowance is being sent extra money would be added for me to help him make a cash deposit at the nearest bitcoin atm. I know NOTHING about bitcoin or how it works and I’m wondering how to be safe and know if this is a scam and how I would know if it is a scam? If I make a cash deposit for him at the nearest bitcoin atm? what does this mean??

It is a scam.
He wants to get you comfortable with a process he can exploit later by sending you larger sums and getting you to pay an accomplice most. Maybe in a week or a month he will say he wants you to help with a property transaction.
In reality the money will be from a crime, maybe some older person's life savings he has tricked them out of. He will trick them into paying into your account so he can't be traced and so that you will be the patsy the cops come after. He will get you to pay his "realtor" (accomplice) using Bitcoin because bitcoin payments can't be reversed, however the payment routed to your account can be reversed days or weeks later, leaving you with huge debt to the bank and a criminal investigation for being an accomplice to fraud or worse.
Alternatively he will be satisfied with just bouncing a few $600 checks and picking up the hundreds of dollars you sent him by bitcoin. That's probably the best outcome you could expect - you end up with a few hundred dollars debt.
Maybe after a few "normal" or "cute" pictures he'll talk you into something more, maybe he'll then blackmail you over anything you send him which he thinks you wouldn't want your family, friends, neighbours, employer and colleagues to see.
The way to be safe is to cut off all communication immediately.
See https://money.stackexchange.com/search?q=sugar+daddy+scam

A general principle that will protect you from a large number of scams is this: Never accept money of any kind from anyone you don't know well and know personally unless you have actually earned it and are fully entitled to keep all of it.


text:
What is the alternative for an exchange which doesnt want to run a node of a coin traded?
It seems to be best practice for
an exchange to run a node itself for a
coin traded there.
But, is there an alternative?
A third party service? If yes, which are recommended and why?

Inevitably if you don't want to run a node yourself, you'll be relying on someone else's. Service recommendations are off topic here.

What is to consider technically/security-wise when selecting a third party service? Lets leave out naming 3rd party services, since this would be off topic.

My advise is: don't, and if you do, I hope you never have any customers that entrust you with their funds.

:) this is a straitforward answer :) if the exchange chooses to run nodes, if there a coin where running an node is not 100 percent necessary? or should really ever coin have a running node for the exchange?

Questions about other currencies than bitcoin are off-topic here, but I can't imagine the situation is any better for other systems.


text:
How can I install Bitcoin Core without having a 350GB harddrive?
I would like to run Bitcoin Core on my laptop with approx 100 Gb of HDD available.
From the installation instructions I understand that a full node must initially download the full approx. 350 Gb blockchain, but can then be pruned down to 5 Gb and still work fine for most use cases such as fully verifying incoming transactions.
Is there a way for me to install Bitcoin Core, and let it download and verify the entire blockchain but continuously pruning it in order to never require more than, say, 50 Gb of data simultaneously?
I cannot find anything about this in the installation instructions at:
https://bitcoin.org/en/full-node#initial-block-downloadibd
Thankful for your advice!
/bitcoinomnivore

Thank you, yes this answered my question!


text:
Port Forwarding for Bitcoin Core in order to allow incoming connections?
There is a rather good explainer on https://bitcoin.org/en/full-node#port-forwarding on how to do port forwarding for bitcoin core in order to allow incoming connections so as to support the network.
I have followed the instructions, set a fixed local IP for the Mac running bitcoin core and am now trying to configure the router for port forwarding.
Here I am facing the issue that I do not know what to write in the External host field. Please see attached screenshot. I am trying * since I do not know the IP of external host, but this does not seem to be allowed.  The instruction on the above link does not include the detailed configuration that my router requires.
Could anyone please identify what I am filling in wrong in the attached screenshot and suggest how I can change this so that my full node can start allowing incoming transactions?
Many thanks for your time and support!

External host is the IP of the host connecting to you. If you want to allow anyone to connect, you can just put 0.0.0.0.

Thank you very much @darosior for your answer. This helped me along, but unfortunately I am not yet fully there. The error message I get after having added 0.0.0.0 as you suggested is still: "Operation could not complete. Something wrong happened".
I also tried all the different options to choose from under "Service" Some of the options are: DNS, FTP, FPT-DATA, HTTP, HTTPS, ICMP. None of them worked however.  I also tried all options for "Protocol".
Is there something I am missing to prepare for the port forwarding?  I run bitcoin core on a Mac Mini with SSD drive.


text:
What's the mechanism preventing ASP to steal small virtual utxos on Ark?
According to https://www.arkpill.me/, a vUTXO owner is able to:

Send the vUTXO with ASP collaboration.
Unilaterally redeem the vUTXO using the pre-signed set of redeem transactions.

If the vUTXO amount is really small, the redeem transactions would be either invalid (due to dust output) or more expensive than the value redeemed. If the ASP is malicious, what's preventing him to ignore every send requests in order to wait for the end of the contract (and then claim the small vUTXO) ?
Is it a possible scenario ? Or something in the redeem path lets to redeem small UTXO ?

I don't think there is a way for the Ark protocol itself to make it safe to own very small vtxos. "Very small" meaning smaller than the cost to claim the vtxo on-chain.
An important first thing to note is that in the scenario where the ASP just disappears and thus starts ignoring all users at the same time, then all users will have to get their unilateral exist confirmed and naturally we can expect holders of larger vtxos to be the first to pay fees for their exits. This means that a user with a smaller vtxo will no longer have to pay fees for all of the txs in their unilateral exit branch, because part of that branch might already have confirmed. Thus in a mass-exit scenario, owning smaller vtxo values is not necessarily a problem.
There is a problem though if the ASP starts to selectively censor a certain vtxo with a small value. In that case, the owner of this vtxo would have to pay fees for all the transactions in his unilateral exit.
The main strategy we can use to avoid scenarios like this is game theory and incentives. If an ASP is earning money from the service it providers, it will have an incentive to provide a good service. If a user can proof that the ASP is censoring one of his vtxos, this would certainly hurt the reputation of the ASP and this might cause users to leave the Ark and join another one.
It is a hard problem to proof that you are being ignored or censored, though. This is definitely one of the active topics of research still being done on the Ark protocol.

"This means that a user with a smaller vtxo will no longer have to pay fees for all of the txs in their unilateral exit branch, because part of that branch might already have confirmed". if the vUTXO is below dust value, it won't block other users to broadcast the branch ? because of the change output containing small vUTXO, nodes will raise a "dust output error" isn't it ?

vtxos below dust value can obviously not exist, that is correct.


text:
Mining- New Supply of Bitcoin
Is new supply of bitcoin only brought about due to miners selling their mined bitcoins or does the mining process distribute bitcoin back into the system in addition to the miners reward/transaction fee?

It's not clear to me what you're asking about. Which bitcoin could be "distributed back into the system"?

Newly generated Bitcoin go only to the miners that find the blocks. In order for the new supply to be circulated, those miners will need to sell the Bitcoin that they have earned.

I was a little unsure on whether the mining process filtered supply back into the network in addition to their rewards so you have answered my question. Thanks Andy.

The block reward consists of two parts, the transaction fees that are paid by users to the miner that confirms their transaction, and the block subsidy, of freshly minted coins. The only way new coins were ever added to Bitcoin's money supply is per the block subsidy. Hence, all coins in the supply were at some point found by a miner and then put into circulation when they spent or sold them.


text:
How exactly can hardened keys work?? (HD Wallets!)
After reading Chptr 5, Wallets, from the Bitcoin Book, I have some questions:
So I understand that the leak of an xpub+child priv key = compromised wallet.
1)How compromised is the wallet? Just from that leaked child down the tree or??
To solve this, we have hardened keys. However, one of the major ups of xpub keys is the ability to generate a bunch of addresses online, for an eCommerce or etc. Then we can offline, generate the child priv keys using the xpriv derivation.
2)So do we have to choose between this method and hardened keys? Or rather, using the eCommerce example, would all generated addresses be on the same level in the tree? Therefore allowing all of them to come from a hardened parent?
I think in this scenario, it would minimize corruption to only that specific address correct?  Also if the children came from a hardened parent, then each child from that parent would need to create one child under it with the xpub derivation?
3) Is the xpub derivation method even used?? What's the advantage of using it if everyone is worried about a compromised wallet? As stated above, it doesn't seem to be useful really?
If anyone has any good links to diagrams, that are not from the Bitcoin Book, that would be very helpful!

How compromised is the wallet? Just from that leaked child down the tree or??

With unhardened derivation, knowing the parent xpub, a child private key, and the index of the child allows for the parent xprv (private key) to be derived. This then allows for all of that parent's child private keys to be derived. Thus all of the funds associated with those child keys can be taken.
Derivation of parent private key from non-hardened child explains how that is done.

So do we have to choose between this method and hardened keys? Or rather, using the eCommerce example, would all generated addresses be on the same level in the tree? Therefore allowing all of them to come from a hardened parent?

Yes. Really the choice is between whether you want private keys to be on the machine that produces addresses. Hardened derivation requires the parent private key. If you are okay with the parent private key being on the same machine that produces addresses, then you can use hardened derivation.
However this is generally not recommended for public facing things like eCommerce stores. The machine running a website shouldn't have private keys, so you will have to use unhardened derivation.

Is the xpub derivation method even used?? What's the advantage of using it if everyone is worried about a compromised wallet? As stated above, it doesn't seem to be useful really?

Unhardened derivation is commonly used, and actually recommended. The risk is only if the parent xpub is leaked (which should really only happen if you give it out) and a child private key is leaked (which should only happen if you give it out). So long as you never give out private keys, then there is no issue. There's almost no reason to ever give out child private keys anyways, so this is never really a problem.


text:
Unconfirmed transaction in memory pool
In February 2021, I sent some bitcoin from bitcoin core account. I choose a low transaction fee. The transaction is down as 'unconfirmed, memory pool'. The bitcoin has not appeared at the receiving address, and the transaction does not show up on tradeblock or on blockchain explorer. Can anyone advise on this? How do I get my bc back?


text:
How will censorship affect the lightning network?
If the Bitcoin lightning network were to become widely used, what will prevent regulators from cutting people off?
The lightning network provides participants with the topography for the purpose of union routing. Having these long-lasting channels between nodes in a high adoption situation means regulators can force major hubs and custodial services to shun parts of the network that allow connections to persona non-grata nodes, am I right?
Onion routing does not solve this, it just means regulators cannot know the exact route taken through the heavily regulated network of channels.
Hidden channels may help, but large hub nodes are open to pressure from regulators to have open books. Combined schnorr signatures replacing obvious 2-of-2 multisigs can probably help. But what more is there to make lightning more resilient?

Lightning network nodes can be brought online permissionlessly. Most Lightning nodes do not have identity information attached. The Lightning Network topology is multi-dimensional, since it is a scale-free network in which every participant can create a connection to any other participant. If "a region" of the Lightning Network gets split off, the affected nodes are free to create new channels with other nodes, easily healing such imposed segregation.
Onion routing means that each forwarding hop is embedded in its own encrypted package. Each forwarder only gets to peel a single layer of the onion. You cannot see where a multi-hop payment you are routing is ultimately headed. You can only see the next hop and learn which node forwarded the payment to you. The actual destination node can even be hidden from the sender by using routing hints.
So, to even find out which nodes are operated by a persona non grata and then whether a payment is intended for them would likely require the vast majority of nodes to comply with some KYC or surveillance procedures. Especially given the Lightning Network's international user base, it's not obvious to me that compliance of this invasiveness can actually be enforced on private users, let alone on nodes operated e.g. via the Tor network.
While "major hubs" and custodial services can choose not to send directly to nodes classified as part of a "restricted region", it would be almost impossible for them to know when they are forwarding a payment that is routed there. If they generally refrain from forwarding and only send and receive, that would prevent them from becoming "major hubs" in the first place, though. Thus, it seems that such regulation would directly impose economic disadvantages on the compliant nodes, giving an edge to alternative "hubs" operated privately or abroad.

Thanks for answering! A node is nothing without a channel, and my fear is that chain analysis would be used to perma-ban nodes from re-establishing channels into the "public" network. Any node who connects with banned nodes will themselves be banned.
Banning could be enforced internationally through FATF-type pressure on exchanges and other hubs, no?

Only if they were able to prevent the user from even spending their UTXOs. A channel will look like a single-sig transaction after Taproot, and an unannounced channel in combination with a routing hint is not identifiable.

Governments don’t have to be able to prevent users from spending on-chain. They only need to be able to track “tainted” coins going in to a shnorr-signed UTXO. Then they can ban any regulated channel being associated with that UTXO. There could be something to routing hints, but I’m thinking that mechanism could also be outlawed.