text:
When and who coined the term "mining"?
When was the term "mining" (the process of hashing, processing the transactions, adding blocks to the blockchain etc.) first used?
Was it there right from the beginning of bitcoin?
Who was the first to call it mining?
Are the other examples pre-bitcoin of the word "mining" being used in a similar manner (i.e. to mean some sort of computational/cryptographic work)?

From Satoshi's paper (my emphasis):

By convention, the first transaction in a block is a special
  transaction that starts a new coin owned by the creator of the block.
  This adds an incentive for nodes to support the network, and provides
  a way to initially distribute coins into circulation, since there is
  no central authority to issue them. The steady addition of a constant
  of amount of new coins is analogous to gold miners expending resources
  to add gold to circulation.  In our case, it is CPU time and
  electricity that is expended.

I don't know of any other examples where the word has been used in a similar manner.

Did the community always call it mining then even from the beginning? Or were a variety of terms used which gradually ended up with mining being the dominant one?

To answer my own comment above I went looking through the old threads on the bitcointalk.org forum from back in 2010 and found people referring to what is now commonly known as mining as hashing/minting/generating (e.g. https://bitcointalk.org/index.php?topic=721.0 or https://bitcointalk.org/index.php?topic=1831.0). Haven't found an  early reference to mining yet (apart from the quote in Satoshi's paper as mentioned by D.H. above)

Here's a reference to "mining" from June 2010 ("bitcoin mining servers"). Haven't found anything earlier than that though.


text:
How to change Bitcoin's proof of work? Then enable miner
I'm using https://github.com/jgarzik/pyminer/blob/master/pyminer.py to test a few different hash functions.  Instead, I'd like to try keccak, a few of them in some order like an "X5" and so on.
This is a toy project to try and change the proof of work in Bitcoin and recompile and test, either an old version < 0.10.0 since getwork() might be easier to test with, or the latest release - apparently bitcoin-cli can mine blocks if starting from a new genesis block and the difficulty is set so low that a CPU can mine as much as you like.
My problem is that I can't find in Bitcoin Core where the proof of work is. I've looked in pow and validation files for near a week now, but no luck so far, or I just can't see it for some reason.
I thought it might have been obvious in miner.cpp which I think is no longer used (but might be able to be enabled?), and the best I can find is CheckProofOfWork in pow.cpp.
It doesn't seem to check whether the PoW is sha256d. Does it?  I must be missing something.  So it looks like I can just change the miner code and submit a proof of work and if it meets the requirements, it will be accepted.
Is there a reasonably easy way to use a toy miner, change the PoW algorithm, and modify Bitcoin Core if necessary to try a different proof of work?

Edit: this is not altcoin development, it's an effort to understand Bitcoin's code in more detail.  Please stop begging the question. Also please consider downvoting only questions which are truly useless instead of those you just don't like.  Thanks!

Edit: Found https://github.com/BitcoinHardfork/bitcoin and what seems easier to implement with adding a few new files and adjusting a couple of bits: use Keccak from some date also by Luke DashJr https://github.com/luke-jr/bitcoin/commit/8d3a84c242598ef3cdc733e99dddebfecdad84a6  Still no real information on how to get it going and test it though, unless it's as easy as cloning the code to make an altcoin and using this proof of work from the beginning.

Why was this down voted?  Changing a proof of work not an interesting enough topic for our voting overlords?

Generally speaking, altcoin "development" questions provide little to no value. Basic code comprehension assistance for a financial product being akin to asking for help finding the ignition button in an aircraft, we can help you with the very specific question, but everybody knows you're not getting off the ground.

Altcoin development is useful to understand the guts of Bitcoin.  Why isn't writing and modifying code considered useful anymore?  If you believe in learning by doing, along with books like Programming Bitcoin, then it's possible to get off the ground.  This is a very specific question, changing sha256d to something else. Isn't it? Why do I need anyone's permission to try this?  That's what it seems like.

I’ve been involved in Bitcoin for the better part of a decade and have never seen an instance of someone producing meaningful understanding by producing altcoins. It is usually the complete opposite, with misunderstanding born from the misconception that the implementation of Bitcoin has a huge amount to do with its overall design. The same way disassembling a cake doesn’t tell you much about its ingredients, or why taking a spanner to a car unsupervised can lead to confusion rather than detailed knowledge.

While you don’t need to ask our permission, you also don’t get to demand responses.

How is asking a question a demand for a response?

How is this an altcoin anyway?  Whoever said this was altcoin development?  Why is it not useful to understand where this is and how it works?  Learning by doing something can be useful in understanding. I don't see the disassembling of a cake analogy. Disassembling code is always useful to understand how it works, recompile, run it, get to know it.  I got the same bizarre responses when I asked about the mempool when all I wanted to do was get to know how it worked.  That was, instead of RBF, try to drop all transactions that are >= 3 hours old.

Overall the code in Bitcoin will teach you absolutely nothing about the underlying concepts, other than the eccentricities of the implementation itself.

I understand enough of the concepts, and I would like to understand the eccentricities of the implementation.  Why not, if you're going to hack on the code?

This is altcoin development because the end result is that you will have created an altcoin.

I guess so, but I'm not releasing an altcoin.  I want to get into the guts of it and that's all.  The other fork thing was trying to understand how hard forks work.

The hash function used in the Proof of Work is not some variable or additional data in blocks that Bitcoin Core needs to check. Furthermore, the Proof of Work is not just something that you submit; in fact, it is not a separate data field at all. The Proof of Work is the hash of the block header, and checking the Proof of Work means computing that hash and comparing it against the current target value.
So to change the proof of work algorithm, you need to change the hash function used for hashing block headers. Keep in mind that doing so will also change how blocks are identified because blocks are identified by hash.
The function that is called to compute and get the block header's hash can be found here. This function itself calls a helper function which calls some other helpers. If you want to change the hash function used in the PoW, you need to change those helpers as well. Keep in mind that if you change those functions too, other things may break and more than the hash function used in the PoW will change.

source: Stack Exchange

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

sort: votes


text:
Can a bitcoin wallet be restored from the files on a drive?
Hard drive crashed and requires professional recovery (likely needs newly built heads by professionals in a clean room).  I don't recall what windows desktop bitcoin wallet software I installed and used about 8 years ago.
If I can recover the data files from the bad drive, can those recovered files be used to recover the bitcoin wallet by installing the bitcoin software on a new computer and then somehow copy some data files over from the recovered drive?  If so, how would I figure out which wallet software I had and installed / used when I look at all of the professionally recovered files?
Unfortunately,  I can't find my backup seed : (

If you used a wallet 8 years ago, you wouldn't have a backup seed phrase (BIP39/44 weren't created until 2013/14). So I have a feeling your timeline is off, or you never had a seed phrase in the first place. But anyways
Without additional info about what wallet you were using:
Generally, you'll want to find a 'wallet.dat' file (or similar), as it will contain the private keys to spend your coins. You will need to either find software that can read the wallet file, or find a way to extract the private keys from the file, and then import them into some wallet software. Private keys are not wallet-specific, but perhaps the wallet file could be. Without more info, it is hard to give specific advice.
Note: Considering the access to your device that the specialists performing the data recovery will have, you may want to consider the possibility of them finding the wallet files themselves. I don't have specific recommendations on how to approach that situation, but it is something to keep in mind.

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


text:
LedgerJS - How to P2SH sign multiple transactions from multiple wallets in 1 function call?
First some explanation
I have made 2 raw transactions via Electrum using my Nano S Ledger as seed and exported them to .txn files.
let rawTx1 = "02000000000101bf00f7aca2e0d393ad0a762224ad4cd5a10d9950804fbc5a22fe970918301179000000001716001400ce8131595e014b45ec6ca49495d547ab8bd872fdffffff02a08601000000000017a91457fd0d41e459a4227b8932327786cf512d99399987bc72ca...";
let rawTx2 = "02000000000101bf00f7aca2e0d393ad0a762224ad4cd5a10d9950804fbc5a22fe970918301179000000001716001400ce8131595e014b45ec6ca49495d547ab8bd872fdffffff02a08601000000000017a914a66dff1bf27dd1a5944b5bc9ff2b0f410efb64cd87bc72ca...";

Then I turned them into UTXO objects using the splitTransaction() function:
const UTXO1 = await btc.splitTransaction(rawTx1, true);
const UTXO2 = await btc.splitTransaction(rawTx2, true);

Next, I get the Wallet public keys I used for these transactions:
const wallet_1 = await btc.getWalletPublicKey("m/49'/1'/1'", false, true);
const wallet_2 = await btc.getWalletPublicKey("m/49'/1'/2'", false, true);

So transaction 1 was made with wallet 1 and transaction 2 with wallet 2. According to LedgerJS, I have to respect that order when calling the signP2SH() function:
btc.signP2SHTransaction([[UTXO1, 1, wallet_1.publicKey], [UTXO2, 1, wallet_2.publicKey]],
    ["m/49'/1'/1'", "m/49'/1'/2'"],
    btc.serializeTransactionOutputs(???).toString('hex')
);

Here,
[UTXO1, 1, wallet_1.publicKey]

are the Transaction object, output index, and redeem script in that order. And
["m/49'/1'/1'", "m/49'/1'/2'"]

are the derivation paths of both of my wallets.
My question is about the third line:
btc.serializeTransactionOutputs(???).toString('hex')

I know for a single transaction from a single wallet, I just toss in the UTXO1 in there:
btc.serializeTransactionOutputs(UTXO1).toString('hex')

But now that I have multiple UTXO's, I don't know what to fill in there anymore. Any ideas?
EDIT
Thanks to @Pierre Pollastri's answer I figured out the hashed script form.
So this code
const outputScript1 = btc.serializeTransactionOutputs(UTXO1).toString('hex')
const outputScript2 = btc.serializeTransactionOutputs(UTXO2).toString('hex')

produces the Output script for both UTXO's. Since we are processing two transactions we need to merge these output scripts. These scripts look as follows:
outputScript1 = 02404b4c000000000017a914c436f95c2ab5062dbc884a7c76ac805b58c00fe5879eaa7f000000000017a914429b7a8975c97dad6f90604faf732d9c7045279a87
outputScript2 = 02404b4c000000000017a914c436f95c2ab5062dbc884a7c76ac805b58c00fe587ee337e000000000017a914284c4c58d659cd485a283b48b4dc79da7571043587

They both start with 02, which indicates that each script handles 2 transactions. So what I did was simply change 02 into 04, remove the 02 from the 2nd script and then concatenate the 2nd script after the 1st script:
finalScript = 04404b4c000000000017a914c436f95c2ab5062dbc884a7c76ac805b58c00fe5879eaa7f000000000017a914429b7a8975c97dad6f90604faf732d9c7045279a87404b4c000000000017a914c436f95c2ab5062dbc884a7c76ac805b58c00fe587ee337e000000000017a914284c4c58d659cd485a283b48b4dc79da7571043587

Then call the function as stated above:
btc.signP2SHTransaction([[UTXO1, 1, wallet_1.publicKey], [UTXO2, 1, wallet_2.publicKey]],
    ["m/49'/1'/1'", "m/49'/1'/2'"],
    finalScript
);

It worked and I was able to sign the transaction :)

The third parameter is just your outputs script (actually it's the whole outputs part of a transaction) so depending on which address you want to send the funds it will change.
It's using the same format as in bitcoin transactions. The data are serialized like this
TYPE | Description
VARINT   | Number of outputs to create
8 byte   | Amount to send to the first output
VARINT   | Size of the output script
x bytes  | The actual output script
In most case you can consider that VARINT is only 1 byte (special cases if you data is bigger than 255 bytes but if that's the case you probably have an issue somewhere :P)
Regarding the output script depending on which address you want to send you have different type of scripts to use.
btc.serializeTransactionOutputs(???).toString('hex') is just serializing the outputs part of the transaction from a split transaction. If you use it on an existing transaction you're basically sending to the same addresses (the same amounts to the same addresses).


text:
What are the downsides of proof of stake?
I am very skeptical about the security of the proof of stake system. Is it really that secure? Are there no disadvantages?

I found this great article: https://blog.ethereum.org/2014/07/05/stake/

Relevant: https://download.wpsoftware.net/bitcoin/pos.pdf

Relevant: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-May/thread.html#18895

Vanilla proof-of-stake doesn't achieve consensus, unfortunately. People staking their coin can vote for both forks of the blockchain, and can even mine effortlessly in secret. In PoW this is impossible, as you are literally wasting energy by mining both sides of a fork.
To mitigate this, most modern PoS schemes use a mixture of PoS and PoW to ensure that someone will finally decide the chain.
http://www.reddit.com/r/Bitcoin/comments/1oi7su/criticisms_of_proofofstake/ for more discussion.

But what would be the point of 'betting' on two blocks?

Jori: because if you bet only on one, and you bet wrong (the chain ended up not being the longest one), you lose your income.

But can’t it be trivially revealed that you voted for both, and then others in system would just stop listening to you, and therefore all the coins you staked would be frozen forever? One strike and you’re out.

Proof of stake has been used for many months in Nxt, and has not been broken despite having the third highest market capitalisation, so it does seem to be secure. If it wasn't, someone would have broken it by now. History shows forks rarely persist for more than a block, so it does achieve consensus.
In theory, a weakness is that people can vote for both sides of a fork. In practice, that doesn't seem to happen. The gain from doing so would be trivial (there's no block reward in Nxt), and the loss of security substantial, so no-one does it. With Proof of Stake, the people who secure the block-chain the most are also the people who possess the most coins, so they have the most incentive to preserve the integrity of the currency. To put it another way, in Nxt forging is done to secure the block-chain, not to make a profit.
One disadvantage is that in pure Proof of Stake, the only way to acquire coins is from someone who already has them. This can lead to issues with the distribution. For example, in Nxt the entire coin supply was initially distributed to 73 "founders", and some of those people still own significant fractions of the supply, giving them wealth and influence. That said, none now own as large a fraction as Satoshi owns of Bitcoin. It seems that the distribution problem solves itself over time, as the founders have an interest in spending their wealth to support the coin.

despite having the third highest market capitalisation Citation? This website says that Bitcoin, Litecoin, and Dogecoin are all higher.

I ride without a helmet for the fifth year now without problems, therefore it is very safe and secure.

Cryptocurrencies like Peercoin solved this issue by mixing both PoW and PoS in a way that new coins could still be mined (by virtually anyone with the hardware) while the network keeps secured by "minters" at PoS whose also get rewarded by securing the network, receiving ~1%/year in minted coins. Inflation is prevented by destroying transaction fees (instead of giving them to miners).

Funny you say that David: https://www.forbes.com/sites/carltonreid/2018/10/21/i-do-not-wear-a-bicycle-helmet/amp/

"The founders have an interest in spending their wealth to support the coin."
Sounds a bit like trickle-down economics, no?

the major one I can think of is the stakeholder with high stakes can have more easy execution whereas stakeholders with low stake will have to get less limelight to overcome this we have delegated proof of stake in which coin holders get to cast their vote and they may also call upon for network change parameters
For the offline stakes in the pos, they are highly vulnerable, to prevent them from attack we can have proof of checkpoint which ensures miner between blocks and matins scalability

There's an argument that certain properties of cryptocurrencies encourage hoarding, but I think this is wrong. If someone ends up rich through 'hoarding their coins, there is then an incentive to spend some of those coins, to buy a car,a house, go on holiday.
I think this has been levelled at POS coins too, that eventually, all the coins end up in a few hands of big holders.
But they are going to spend at least some of their wealth on a luxury lifestyle.
Probably, they will remain super wealthy, but, their wealth will always be being spent and that wealth passed on to others, eg the guy who built the Aston Martin he just bought.

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


text:
How can I hide my bitcoin transactions to protect anonymity from others?
Please take a look at this transaction link of bitcoin :
https://www.blockchain.com/btc/tx/blablablabla
My bitcoin address is :  blablablabla
You can see all of my transactions by this link :
https://www.blockchain.com/btc/address/blablablabla
My friend address is :  bc1qhkshfzwzm6cl8ezsg5fw7yhpsdqtp4r3vfzzzz
But you can't see all of his transactions by this link :
https://www.blockchain.com/btc/address/bc1qhkshfzwzm6cl8ezsg5fw7yhpsdqtp4r3vfzzzz

What is this address : bc1qhkshfzwzm6cl8ezsg5fw7yhpsdqtp4r3vfzzzz
And why is it undetectable?
How can i hide my transactions from others like that address?

Your address is a classical 1 (Pay-to-public-key-hash) address. Your friend has a newer Bech32 Pay-to-Witness-public-key-hash-type address. The block explorer you referenced is partially compatible with Bech32. Sometimes, it doesn't work. On the other hand, there's nothing that prevents you from looking at your friend's transactions using a different block explorer such as https://Blockstream.info or https://blockchair.com/.

Bitcoin is not yet built with a privacy layer, all transactions are public and immutable, meaning they are visible to everyone, everywhere, forever.
If you wish to make a private transaction, you are better off using another blockchain like Monero, Zcash, or one of the many others focused on maintaining user privacy.


text:
Is mining using with cpu(some web sites) fake or not
There is a rule about every browser :
Browser can not access client's RAM-CPU-HARD DRIVE-WEB CAMERA-And other resources of client's machine.
Am i right?
So how some web sites do mining using client's cpu?
Are they scam or they are real?

Yes, it's fake. Scam.

There are two things mining requires in general:

Processing power (CPU/GPU)
RAM

For Bitcoin, a tiny RAM is OK, but for Ethereum, a few GBs of RAM is needed.

So how some web sites do mining using client's cpu?

Using Javascript (unfortunately. There are more efficient ways, such as TurboJS or GPUJS or WebAssembly). Basically, they're trying xs with different nonce fields until Hash(x) is smaller than a target value.
Bitcoin mining is possible wherever there's general-purpose processing power. Is it feasible? No. Because of ASIC miners, CPU or even GPU mining have higher electricity costs compared to mining revenue.
On the other hand, it might be different for other coins, such as Monero. You might have heard of CoinHive, which had Proof-Of-Work captchas that required mining Monero for a few seconds. Because Monero is ASIC-resistant, CPU mining used to be efficient. (Until February 2019, when CoinHive miner was discontinued due to the falling value of Monero).
It's likely that they might be scam, otherwise it's unprofitable for you (assuming you pay for electricity).


text:
How do I double spend using electrum for fix unconfirmed transaction
I have two Blockchain.com wallets.(Both of them are mine)
Some days ago i did a big mistake.
I sent 1100$ From wallet #1 to wallet #2. (10.0 sat/vB > As you see this is very very low) (TX LINK)
And i sent  that 1100$ to my friend from wallet #2 after the transaction upper immediately. (99.3 sat/vB) (TX LINK)
Because of low fee in first transaction, both transactions have n't confirmed yet.
I asked people to fix these unconfirmed transactions.
They told me use another wallet like Electrum wallet and double spend those unconfirmed transactions.
So i installed Electrum in my windows 7 os.
For double spend using electrum i found this link :
https://steemit.com/bitcoin/@profitgenerator/tutorial-how-to-fix-unconfirmed-transactions
But it seems it has deprecated.
I could n't understand one part of this tutorial :

Re-create the transaction, but this time put a higher fee.
Sign your transaction, and save it to a file, it should end with .txn extension

My questions :

As you know Blockchain.Com has no RBF option. So those two transactions have n't RBF flag.
In this situation can i use double spend with electrum?
How can i create a transaction in offline mode and sign and save it?
I tried it.But after setting fee and click send button electrum tried to broadcast.And i could n't find an option for sign or save transaction with .txn ex.
Would you please share a complete step by step tut about this.
If i double spend first transaction what happen to second unconfirmed one? (I am a bit confused about this)
Should i double spend two unconfirmed transactions with two temp wallets in electrum or double send of first one is enough?

@Prayank Thanks a lot - Problem #2 solved - I checked it.


text:
Bitcoin Cash difficulty before first hard fork: Emergency Difficulty Adjustment (EDA)
What were the network rules regarding the difficulty adjustments of the Bitcoin Cash chain, before the first hard fork was implemented on November 13th, 2017?
There was a rule that was a function of the time taken to find the last 2016 blocks, and one based on the Median Time of the last 11 blocks. What was the effect of these rules?

The first rule is well understood.
The second rule, ensures that difficulty gets readjusted quicker if the MTP between blocks is big (12h.)
In practice:
Check the MTP of the current block (mining time of a block 6 blocks earlier)
compare to the MTP time of a block mind 6 blocks earlier
if the difference is 12 hours then difficulty will reset
for example:
block 478574 has an MTP of Aug 1 14:39: UTC
block 478568 has an MTP of Aug 1  11:52 UTC
so not yet 12 hours apart
also see: https://medium.com/@jimmysong/bitcoin-cash-difficulty-adjustments-2ec589099a8e (edit: fixed link)

Not reset; drop by 20%

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


text:
severity of bitcoin vulnerability to AES crack
In the event that AES is cracked, what are the implications for the consensus layer of bitcoin? What are the implications for user's bitcoin wallets? On average, how many bitcoin would be available to steal?
After either a large-scale theft or migration event, would bitcoin be able to emerge as a secure network with its current implementation or a soft fork?
(Note: Discussion for whether AES can be cracked, or whether the incentives are in place to handle the transition from pre to post-event, or discussion on a bitcoin hard fork are out of scope. This is purely a technical question about what is possible with the cryptography bitcoin currently has under an AES-cracked scenario)

Why ask specifically about AES-192? I don't know anything that uses that at all (AES-256 and AES-128 are more common).

Good idea. The inspiration for this question was this (likely hoax) https://www.reddit.com/r/singularity/comments/1824o9c/is_this_leaked_explanation_of_what_ilya_saw_real/
but should be generalized. Editing.

Consensus Layer of Bitcoin
No direct impact: Bitcoin's consensus mechanism, which relies on SHA-256 and ECDSA, would not be directly affected by the cracking of AES, as it does not use AES for its core functions.
User's Bitcoin Wallets
Indirect impact on wallet security: Major hardware wallets (Trezor, Ledger, KeepKey) focus on secure key storage and physical device integrity rather than AES encryption. Therefore, the direct impact on these wallets would be minimal.
Bitcoin Availability for Theft
Limited direct risk: The amount of Bitcoin at risk would not directly increase due to AES being compromised, as Bitcoin addresses and keys do not rely on AES. The exposure of full public keys from address reuse poses a risk only if ECDSA is compromised. (Note that bitcoin can still be secure under cracked ECDSA, but any address which has a spent transaction output will have its private key exposed)
Bitcoin's Future Post-Event
No protocol change is necessary for AES.
Since Bitcoin’s core protocol does not depend on AES, cracking AES would not necessitate a protocol change or even a soft fork for Bitcoin’s operations. However, peripheral systems using AES may need to upgrade their security (e.g. some wallets such as Bitcoin Core).
So in summary, peripheral security measures might need reevaluation, but the primary mechanisms of Bitcoin remain secure against an AES compromise.


text:
Why does Coinjoin need multiple participants to increase privacy?

Coinjoin is a method that make a transaction with other transaction of
  other parties to hide the link between txin and txout.

In case of this, why we need others transaction? We have many bitcoin address since we are using HD Wallet(BIP32) so I think we don't need to wait other bitcoiner to participate into shuffling for making a transaction. we can just give our address set.
Is there a special reason that enforce to combine mine and others stuff?
Sorry for my English.

The only advantages of doing a coinjoin is that the recipient of your funds cannot see the source of your funds (and the sender of funds to you cannot see your future transactions). If you do a coinjoin with only your funds, any branch they follow along this trail will lead to a source (or destination) of your funds.
Every source you include in the coinjoin will thus be exposed. Your recipient, of course, won't know that they're all of your sources, but if they're keeping a log of addresses that are likely tied to your identity, now all of those addresses, and only those addresses, will be in their log. If you instead do this with other people, it muddies such a log with false leads.
Similarly, the sources of your funds will all have logs of that destination of funds. Also, they can follow the chain back and deduce that your address is likely tied to another address if you have multiple sources, and they will all have an list of your other addresss. Again, they won't know that the other address are necessarily your address, but they actually will be, and so their log will contain accurate address linkage data.

Yes, they can trace all the history about my money flow but, the fact is that they cannot claim some source are belong to me. additionally, my address set is consist of many transaction made with others. it means that they have to trace all the people's address that have expereicne trade with me. I think it is not bad method to hide privacy without depending on other people that may require some resources such as fee or time.

Yes, your address set consists of many transactions made with others, but if you're concerned about privacy, that's exactly what you're trying to hide.
I can't imagine that showing the recipient more information about all of your sources of funds, instead of one source, is better for privacy. If they're the type of entity to just say "oh these came from a lot of sources, I give up", sure, but you can assume anyone really trying to decode the originating transaction will consult with a blockchain analytics firm, in which case you just gave them a lot more information.

"Privacy loves company."
The key is to understand why a coinjoin transaction provides privacy. It is not a magical veil that shields your financial history, it is just a tool that helps obfuscate a particular output's history. This obfuscation is only achieved by including many inputs in the coinjoin transaction, such that each input could be the source of a specific output, but it is not technically possible to determine which is which.
With this in mind, we can see why having many participants is important: you want to have as widely varied a selection of inputs as possible, so that your output's history is not meaningfully determinable. If you only include your own inputs, then each and every input will have a history that leads to you.

To illustrate this point, consider the case in which a chain analysis firm has a very good idea of who owns each UTXO that exists:
If you supply 10 inputs to a transaction, but a chain analysis firm has linked your ID to those 10 inputs, then it would be trivial to determine that you likely own the outputs created as well.
On the other hand, if you supply 1 of 10 inputs, then the chain analysis firm would be hard pressed to determine who owns each newly created output. With no additional info, there is just a 10% chance that you own any one specific output.

Doing coinjoin with only your coins is possible, it's called fake coinjoin. Samourai Wallet has one implementation, called Stonewall, I have written fake-coinjoin.sh for Bitcoin Core. But such fake coinjoin by itself does not give you much privacy, because of common-input-ownership heuristic. So, by default chain analysis companies assume that all the inputs of Bitcoin transaction are controlled by the same entity. Unless they are aware of coinjoins and take them out from their analysis. What fake coinjoin does is that you cannot actually be really sure is coinjoin transaction with multiple equally sized outputs actual real multi-party coinjoin or not. And can possibly give you plausible deniability.


text:
How many public keys is there?
How many wallets is there in existence(that are unique with bitcoins)?
Is there any page with statistics that can give a bigger perspective other than figuring out the data structure of the blockchain.
Meaning is it possible to get all the public keys for all the transactions ever made?
However it seems like the public keys aren't stored in the blockchain, instead it's the addresses which is a hash of the public key.
Am i correct that's impossible to find out the public keys of all transactions(Unless you bruteforce them which is practically impossible)?

Related: http://bitcoin.stackexchange.com/questions/13225/at-what-point-is-a-new-wallet-known-by-the-bitcoin-network

Not sure, whether I understood your question correctly the first time. Do you mean to ask "How many addresses have a bitcoin balance?" or "How many wallets have a bitcoin balance?"

One of the advantages of bitcoin, is that you can send bitcoins to an address, and the receiver public key is not logged in the blockchain. But the senders public key is. Correct me if this is wrong?!

This is what i wanted to say: If you spend with your private key, you leave clues in the blockchain so that if sha256 is someday broken, your coins is not safe at that address. Found the explanation here  http://www.reddit.com/r/Bitcoin/comments/1pxcif/i_just_lost_301btc_70000_on_blockchaininfo_use/cd73qx4

TL;DR: You are not aware of the total number of users, but total number of transactions. In order to speculate the number of wallets (mean the number of users), you can adopt some heuristics, but that's all estimation.
First of all, a user can obtain multiple public keys. In order to get the number of public keys, you should firstly parse and extract the bitcoin transaction network that is publicly available. For example, in this dataset, created on Jan 6 2013, there are 8.864.955 public keys.
That's the easy part.
If you wish to calculate the number of users participating in bitcoin networks, you have to adopt some heuristics, as those data are not publicly available, due to the anonymity that is offered by bitcoin.
The first heuristic could be:

When a single transaction has multiple input addresses, we can assume that those addresses belong to the same wallet, thus to the same user. We should bear in mind that users do not share private keys. In fact many users may use web wallets which have pools, so those services will be treated as a single user.
Secondly, you can exploit the change mechanism in transactions. The entire value of unspent output should be sent back to the user as change. Bitcoin, in order to improve anonymity, produces a shadow address which collects back the change that results from any transaction. So when a single transaction has 2 outputs, you have to predict which one of the output addresses is actually belonging to the same user that initiated the transaction. If one of those two outputs has never appeared before in the blockchain, while the other has, then we can  assume that the one that never appeared before is the shadow address.

You can read this heuristics in more detail in BitIodine paper. In this work, there are 2.175.621 users found, using the above methodologies.


text:
Is bitgo.com api ok for bitcoin payment? What are limitations?
I want to use https://www.bitgo.com api for my bitcoin payment.
My Questions :

Is this api working at this time?
Is this api free?
What are limitations about using this api?

EDIT :
I have 1000 customers in my web site.
I want create a wallet in BitGo and create a unique bitcoin address for every customer and handle deposit and withdraw from that address.
Now tell me how much do these jobs cost & what are limitations about it!

You didn't provide a lot of information on the scope of your needs, but it depends on what you're trying to find a solution for. BitGo is not a payment processor, it's a business-to-business service provider.

On their website, under "Who We Serve" they list "Asset Managers, Banks, Exchanges, and Payment Processors" etc. as their customers.

Is this api working at this time?
Yes, BitGo is up and running according to status.bitgo.com.
Is this api free?
There are a few public endpoints that are free, but BitGo's wallet service is not free. For their "Pay As You Go"-plan, the customer pays a fee relative to the sent amount with every payment to BitGo. For the enterprise plan, the fee is a mix of a fixed amount every month and a relative fee.
What are limitations about using this api?
This one is hard to answer, because you didn't tell us what you want to do. The company is targeting exchanges and other financial institutions as their customers. If you're looking to manage millions of addresses, automate a high volume of payments, and want to add the security benefits of a multisig setup, it may be a good fit. If you're just looking for a payment processor, you may want to consider e.g. BTCPayServer instead.

Disclaimer: I'm a former employee of BitGo.

I have 1000 customers in my web site - I want create a wallet in BitGo and create a unique bitcoin address for every customer and handle deposit and withdraw from that address.
Now tell me how much do these jobs cost & what are limitations about it!

That would be something that you could do easily with a BitGo wallet. You'd probably want to go with the "Pay as you Go" offer there. IIRC, at some point the fees were 0.25% on every payment.

"Pay as you Go" > Where is this link on that web site? I created an account in there and create a wallet for bitcoin. What is the amount limit on this wallet during transactions?

If you make a regular account, you're using "Pay as you Go". You'd need to meet a sales person and make a contract otherwise, and you'd know if you did that. I don't think there is a limit for the amounts. I found on https://www.bitgo.com/services/custody/wallet-platform, that BitGo's fee is indeed 0.25% on each send (in addition to the transaction fees paid to the miners).


text:
How can I generate public address from an xpub key in Java?
I have an xpub key with which I want to generate all addresses which have been used or will be used and then find out the keys which have balance.
Here's a sample xpubkey with balance- xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz

Possible duplicate of generate wallet addresses from extended public key

Hi Ugam, I tried the method but it doesn't work for me. :)

I’m voting to close this question because it shows low to no investigation effort.

I have to deserialize xpub key then use its derivation path to get a child path or normal key. From a normal key, it is easy to convert the public key to address.
You can refer to this source code.
https://github.com/tatumio/tatum-java/blob/master/src/main/java/io/tatum/wallet/Address.java#L24
Thanks

Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

Thanks. I updated my answer.


text:
Networking & Lightning Network
So I have a question regarding network connectivity within LN nodes.
Scenario #1:
I have public lightning network node. it has real public IP address (let's say 123.123.123.123), which one is announced in config file. also, there is a TOR service, with configured .onion service (let's say mynode.onion). On the nodes config file there is no proxy configuration, so my node communicates with the rest of the world using clearnet. So from the outside world my node is available on 123.123.123.123:9735 and mynode.onion:9735. While outgoing connections are made from 123.123.123.123.
Now I have a friend, who's also node operator. He's a paranoid (his node is only available as a TOR hidden service on friendsnode.onion) and needs some incoming capacity. As i understand (please correct me if i am wrong), the only way to open channel to him is possible that way:

connect from my friends node to my node using my clearnet IP
123.123.123.123
connect from my node to friends node using his node ID
open a channel to him, using his node ID

my question is:

what will happen in case of node restart or any other accidental event which can interrupt the current connection.
Will the nodes re-connect to each other without any manual operations?

Scenario #2:
I have two LN nodes on my LAN. each node has its local IP (let's say NodeA - 192.168.0.1 and NodeB - 192.168.0.2) and both nodes have their dedicated public ip (let's say 5.5.5.5 and 6.6.6.6). The nodes have in their config files announcing the real IPs, not local ones. I would like to create a channel NodeA -> NodeB, but want to do so using local addresses. So what i do:

on NodeA connect to NodeB id@192.168.0.2:9735
open a channel NodeA -> NodeB

my question is:

will it connect at all (not tested, but i assume - yes)
will the nodes reconnect correctly on restart? (is the NodeB connection network address stored in DB/config files on NodeA or is it retrieved from "announced" addresses somehow from NodeB each time? )
will be the LAN address of any node somehow visible to rest of the network? (assuming that beside NodeA<->NodeB channel there are non-related channels to  third-party public node from each node as well)

Appreciate your answers!
edit: formatted & fixed some typo

i got an answer in telegram from one guy, so there it is:
it is more iportant public key matching and how nodes connected doesn’t matter, when you try to open channel and any other operation which involve p2p communication, node first tries to find public key in active connections, then establish connection directly to ip address taken from graph cache (each node broadcast their advertised ip addres to the network, for lnd this is --externalip parameter), then in local cahce of previous successful connection...

...when you open a chennel with a node, and then restart both nodes, after restart each of node will try to connect to each other from both sides, infinitely
please confirm someone this

This is implementation dependent of course. Afaik every implementation will try to reconnect, so your first case works (note that your paranoid friend's Tor hidden service isn't used at all). This is common in practice, for any non-public node.
In the second case, for c-lightning the address hint will be forgotten on reconnect, so they'll try to reconnect on the public IPs. Even if we were to fix that, they'll try so the addresses including the public ones: we'd need a special option to ignore public addresses for a specific node if this were common.

That is the interesting part - how exactly the node implementations will reconnect. In which order, and will they do that successfully in described cases. If I understood you (and prev. commenter) correct friends node will going to reconnect to my node anyway on start-up.
I understand that my friends .onion address was not used in that described case, but anyway, it is available for others and he is proxying over TOR outgoing connections.
I was also thinking would it be good in c-lightning to specify proxy setting to some specific hosts only (IP range, .onions). Now it is ON xor OFF.

Thanks, I've opened an issue: https://github.com/ElementsProject/lightning/issues/3085


text:
Why getinfo() and listchannels() inactive channel count differs?
I have strange results comparing node information outputs between getinfo() and listchannels() calls. Maybe someone has thoughts what is wrong (with my trivial code or with c-lightning itself):
chans = lnd.listchannels(source=mychan)['channels']
for chan in chans:
    if chan['active'] == False:
        total_inactive += 1
        print('inactive chan with node: ' + chan['destination'])
    else:
        total_active += 1

print('my inactive chans: ' + str(total_inactive))
print('my active chans: ' + str(total_active))

gives me:
my inactive chans: 2
my active chans: 23

But, lightning-cli getinfo gives:
"num_active_channels": 25,
"num_inactive_channels": 5,

waited for 10+ hours.. now things become even more strange. while upgrading the node there was an event when i launched backuped node copy, so many of my channels closed for some reason (perhaps channels closed because other nodes refused old data). anyway, tried again to launch script and getinfo:
getinfo:
"num_active_channels" : 5,
"num_inactive_channels" : 25
while script output:
my inactive chans: 3
my active chans: 2
wierd.. but i think this is due to slow state refreshing in LN. will close manually 'inactive' channels i see on cli and then ill reply about results

It would appear that you have (or rather had them at the time you ran the commands) 6 channels that were funded, but not yet announced. This is most likely why your node sees them (getinfo) but gossipd doesn't yet (listchannels) since they haven't been announced just yet.

Nvm previous comment its misleading and has nothing to do with question. But should i use listchannels() to get more descriptive info about inactive channels mentioned in getinfo()?

They are two separate sources of information, so we'd need to reconcile the differences. Might be worth doing at some point, but likely a low priority task currently.

as Rene Pickhardt pointed me:

without context I studiert you installed the pylifhtning client via
  pip and upgraded you lightning node later so that the APIs have
  different versions. But that is only a wild guess for a common error

To my defense when I was approached with the question I only knew that the output differed. I did not know how and pointed also out that my replay was a rough / blind guess

anyway, this was a good point. i really had different versions of api and cli and your suggestion makes sense to prevent futher glitches!

Yeah but as Cdecker wrote you make a different api call in your python script in comparison to the cli call

Emmm.. i didnt get it first, i understood thad different software subprocesses are acting in different ways, but soon or late ill get same result. In general i would like exactly to compare the data which gives listfunds and getinfo. I used api simply to not count inactive channels manually, but the idea was to found detailed information about inactive channels that getinfo() outputs. I thought listchannels() is exactly what i need for this

My question title is misleading, it should be: why listfunds() and getinfo() shows me different stats. Regardless of api/cli


text:
What is correct way to count LN node stats
I am running a LN node. Set up monitoring to collect stats. Now i am wondering, how can i get correct conclusions about what collected information actually is.

My question is about forward (transaction?) count. According to my stats i had 14 settled forwards.
There are ~8350 nodes over there, my node according to 1ml.com is ~#450 in channel/capacity rank. so we can assume that i am average active node i think. so then 8350*14=116900 settled forwards over network?. i am not sure what this number mean and can we compare this to 409570 on-chain transactions for last 24 hours.
I had also some 2-3 offchain pay and 1 paid invoice which was my own node made, do i need to add the to calculation above or not?
If this completely incorrect way to count and compare transactions, please describe a correct one.

if someone interested in a monitoring solution i've used: https://github.com/reablaz/zabbix-clightning

Tip: Stats are for last 24 hours

I would approach this problem a little bit differently as counting in general is pretty difficult and the assumption of being an average node is pretty strong (not to say as I lay down below probably wrong) My approach however uses also a strong (and also probably wrong) assumption though I think it is not as strong / wrong as yours.
In my video in which I lay out the math for optimizing routing fees / earnings on the lightning network I start with a probability distribution to derive an expectation value for my routing fees that I want to optimize to gain maximum routing fees.
Instead of assuming your node is average I would ask about the likelihood of being on a path of a transaction between two arbitrary nodes? As I lay down in the video this boils down to the betweeness centrality of your node on the fee graph of the lightning network. The fee graph is the network you get when adding the routing fees as edgeweights (it is a little tricky as they dynamically depend on the payment amoun. You could start with just using the basefee). Generally your centrality raises with you lowering  your fees and maintaining more channels. In your case after computing your centrality you would divide the number of settled routing attempts by the centrality of your node to get an estimate of the overall payments made by the network.
As a datascientist I would say that even your data points (n=13 settled routing attempts) are statistically probably not sufficient. However larger nodes could probably use their data to make a pretty good guess.
Also as a disclaimer I should say that my result with the betweeness centrality depends on the relativly strong assumptions that the distribution of who pays whom is uniform so it would be equally likely that you pay any other node. This seems to be another very strong assumption but it is extremely hard to get a better a priori distribution for it. If it was available it could easily be weighted into the formula of the betweeness centrality. Also I assumed that payments all have the same amount to compute the betweeness centrality. This is also wrong but could also be modelled to the centrality measure if the amount distribution was known.

can't say i am satisfied with answer, but it seems correct..

Why not satisfied? The fact that it can only be estimated and a lot of assumptions have to be put in? Or more my way of presenting it (with which I also was not too happy - but I thought I was overcritical)

rather because  a lot of assumptions have to be put in.. i thought there is a way to get more accurate data with less effort. At some point that is good for privacy as it happens now, but makes hard to analyse network for random person.


text:
How do I update offline Electrum wallet after receiving payment with Online seedless wallet?
How do I update offline Electrum wallet after receiving payment with Online seedless wallet?
The guide at: http://electrum.org/tutorials.html#offline-mpk does not say. It only says how to make payments from the offline wallet but not how to receive money to it. I can receive payments to my online seedless wallet, but I don't know how to transfer that to the seeded offline wallet.
Thanks.
P.S. In case some Electrum dev read this there is also an outdated instruction: [Offline PC] Go to Settings -> Import/Export and copy your "Master Public Key" and put it in a text file on your USB-Key. >>> This is now Wallet -> Master Public Key.

If you have a seedless wallet the coins received there will need to be signed from the offline computer to be able to spend them. History will be showed in your online PC.
Thanks for pointing out the outdated info.
UPDATE:
You don't need the offline wallet to know how much coins it has, only the online needs that. When you make a payment from the online seedless wallet it knows how much it owns, so the client will spit out the unsigned transaction that needs to be transferred to the offline wallet (with a USB stick or webcam) for it to sign it and then transfer it again to the online PC in order to broadcast it from Electrum.

To add, if you are using a lot of addresses it might be that the offline wallet has not yet generated those other addresses. In that scenario I imagine you will have to manually generate the addresses using the console command: wallet.accounts[0].create_new_address(0) or wallet.accounts[0].create_new_address(1) for change addresses. Alternatively you can increase the gap limit wallet.storage.put('gap_limit', 100)

I think this is not needed as the client now uses deterministic signatures. But would be needed if you are generating the addresses trough a script for an online store or something similar.

the private key has to be there in the offline wallet for it to sign a transaction: https://bitcointalk.org/index.php?topic=344115.0

authors: พงษ์สิทธิ์ สุทธิปรีชานันท์


text:
Why am I able to export private keys using my seedless online Electrum wallet?
Why am I able to export private keys using my seedless online Electrum wallet?
I thought this wallet is not meant to be able to expose any of my Bitcoin, but yet it has the option to export private keys? I have not gone to the point of actually exporting them because I'm scared it will compromise me somehow since I can't even set a password on seedless Electrum, so perhaps it is just a redundant option?

this was a gui bug; the menu did not really export private keys.
fixed here: https://github.com/spesmilo/electrum/commit/3fc7d0ef9e34465a47017ffa1f567d829aa0f2a2


text:
who gets the transaction fees?
i heard that miner who get bitcoin first gets transaction fees.
Then who gets the transaction fee right when mine at mining pool? The miner or The pool?


text:
What is the computational power required for just verifying maybe two transactions
I want to know the amount of computational power required to verify a just a couple of transactions. No mining included, just verification
can it be done with CPU or maybe even phones?

Transactions can be verified as being valid by inexpensive software, such as a cellphone.
Transaction confirmation requires a miner to include the transaction in a block. Confirmation is not done on a transaction-by-transaction basis, so "how much power to confirm just a couple of transactions" is not really a good question to ask. Instead you could ask "How much computational power do you need in order to mine a block?", with the understanding that many transactions can be included in a single block.

so in DAG tech can transaction verification be done through cell phones where users have to verify two previous transactions?

That would depend on how the specific DAG coin's protocol works, my answer was in reference to the bitcoin network (which is usually assumed the default here, unless otherwise specified). You would need to be more specific about what coin you are asking about.

yeah my bad, i was talkinng about DAG technology where users in order to make transactions have to verify two previous transactions
So im wondering if phones can carry out such tasks instead of PC's
In DAG each "block" contains only one transaction

Again, it depends on what is involved in 'verifying a transaction'. In general, if the coin is designed to be usable on cheap hardware, then I would expect cheap hardware could be used. But ultimately it will depend on what the protocol requires for verification.

so theoretically it is possible;
by verifying a transaction i meant to avoid double spending

There's a difference between verifying and confirming.


text:
Do I wait or do I have to do something about it?
Nooby question here, I payed/sent an amount and it failed somehow, so I tried again and again.
I checked their website and it´s all "failed" or incomplete. But is has a checkmark(sent) on Electrum. This was saturday, today is monday.
Now my question is, do I just wait and the BTC will comeback, or should I do something so it isn´t floating around?
Thanks in advance,
Alain
PS: Print so you have more details.
https://gyazo.com/41e1f54c1bb11d1739e6a8da3664911b

On blockchain.com, you can see that it was confirmed. It's done, there should be nothing you have to do now.

Thanks for your fast input!
It happens on the site, it shows this. Status:Failed, so where did it go wrong?
See: https://gyazo.com/1698c27aa052679aca2d0842a5427e5a

I don't understand what the list on the website shows, but since it shows many Faileds, are you sure that it's not a scam website?

It shows that I had sent money first, and then I had no more bitcoin on electrum, so it probably failed because of that.
But I continued to try to send money, because it was failing to send (so in my head when it failed means I still have money in the account)

do I just wait and the BTC will comeback

No, the transaction be13...5f1b is complete and 0.00361861 BTC (about EUR 18.86 at time of writing) has been sent to address 1Exq...qoPf
Nothing is going to come back just by waiting
The transaction, like all confirmed Bitcoin transactions, is final and irreversible.

should I do something so it isn´t floating around?

It isn't floating around. It has been moved to address 1Exq...qoPf. It can be spent by whoever has the private-keys from which that address was derived.

I payed/sent an amount and it failed somehow

This is an issue with whatever software/website is showing the "failed" message - you should ask the owner of that website (or developer of that software).

Is it really not possible to track which address belongs to who ? The company says the money never got to them.
I try to check their address and everytime it comes a different one to send the BTC to, is this changing address a reference or their address, because if it is theirs, it should not change?!!

@Alain. Bitcoin is designed to make it nearly impossible to find the owner of an address. It is normal to be given a different receiving address for each transaction. This is partly for privacy reasons and, in this case, so that the recipient can work out which customer sent the money. Note: bitcoin "addresses" are not the address of a place, person, wallet or any other thing. They are just a number (technically a kind of hash-number mostly generated from an encryption key) that is used in a mathematical operation that underpins the integrity of the Bitcoin blockchain.

I understand. Thanks for dumbing it down RedGrittyBrick !!
So strange though, I copy pasted their "hash" sent, then some failed payments notice were shown, although it got confirmed from blockchain, and now the company says it failed and they never got the money, although I don´t have it either on my balance.. sucks

@Alain addresses changing for every transaction is normal. However they did hand out that address to you in the past and you sent them money. Now you need to confront them with a link to blockchain.com showing that address received money. If they don't credit you with this amount consider them scammers.


text:
Some weird BTC transaction just happened to my wallet, sub wallet doesn't send back the BTC to my wallet
So my wallet address is 3BA1kdxSyFLADWJHDeaFb2xap4QASVvXto

First I sent 0.00010000BTC to 1FjpQCZvqQxpGjvdU8AcxVyxXgJqY17Uzw (https://btc.com/e408f1e2126e4a504779e3be529b7b90e27e88a7547844743bf59401b8f77787)

My first question, why did my wallet also send 0.0998914 BTC to 3FT1hD7tHm9WRoMfBFSKoY9H2AXWAN7oDE? who is this wallet belongs to? It seems that my node automatically created this address? How can this happen?

A month later I sent 0.00079509BTC to the same address 1FjpQCZvqQxpGjvdU8AcxVyxXgJqY17Uzw. But instead of sending this BTC from my address it is sent from 3FT1hD7tHm9WRoMfBFSKoY9H2AXWAN7oDE?
How did this happen?
And on the next day, I imported my wallet to a different node. But I realized that 0.09989140BTC of my funds are not in my wallet but inside another wallet 3QNSBznq4mEJFxiSyshTWa7KuQRwYZ8hyA that was suddenly appeared on this transaction https://btc.com/22b3c9f8caa93f5f6968edc6ae93c13ca49063bf015c4b61ac8532b90cfa298d
So I got panicked, but luckily I still have the back up of my old nodes and did listunspent on that node. and I'm glad to see that I have access to the wallet that hold 0.09989140BTC (3QNSBznq4mEJFxiSyshTWa7KuQRwYZ8hyA) How did my BTC got stuck in there.

Is this a bug in bitcoin core (since I'm hosting the node on bitcoind)? or it is meant to be like this?
I am really worried now, what if I did not have the backup of my old node. Will I not have access to the wallet that hold my remaining funds in 3QNSBznq4mEJFxiSyshTWa7KuQRwYZ8hyA?
How can I put back the funds in 3QNSBznq4mEJFxiSyshTWa7KuQRwYZ8hyA to my wallet 3BA1kdxSyFLADWJHDeaFb2xap4QASVvXto. Is there anything I can do with the output of listunspent? What is the meaning of the output in listunspent anyway?

This is completely normal behavior. The wallet follows the best practice of not reusing the same address again, but internally creates new addresses to send "change" back to, simply because it has to send that change somewhere due to protocol requirements. This helps privacy, as it is not (necessarily) clear to the network which output is the payment and which is yours. Don't worry, the funds are still yours, your wallet has all the relevant private keys.

@PieterWuille sorry if I'm have continuing on the argument, so the wallet bitcoin for all transactions generated a new wallet? and on this new wallet can apply a Bech algorithm? an example I have created new transaction whit an x account and to an x id wallet I apply the P2SH and create a y id for payment, now in the next transaction I have a new wallet with a j id wallet and a z P2H2 (supposed to use P2SH)

An address is not a wallet. A wallet consists of many keys and corresponding addresses. This has nothing to do with P2SH or so; outputs in Bitcoin have to be spent completely, so if there is too much in an existing output to send, another output back to the sender's wallet has to be created. This is simply wallet behavior; the protocol does not know or care which output is change or not, so any type of address the wallet can generate can function as change address.


text:
Is it secure to generate a new address using SBC such as raspberry pi? any problem with TRNG?
I am trying to create a cold wallet using SBC such as raspberry pi (not raspberry pi).
I wonder if the random generator is secure enough to generate random wallet address, for both BTC and ETH.
I heard there were fatal flaw in Android random number generator before. Is it possible that SBC can have the same issue?

The TRNG in every modern rPi is indeed quality high entropy
/dev/hwrng "seeds" (feed extra entropy to) the /dev/urandom device
Take a look in the /var/log/syslog file
need rng-tools.service running
apt policy rng-tools
Also check haveged is in the kernel.
Good overview here
https://hackaday.com/2017/11/02/what-is-entropy-and-how-do-i-get-more-of-it
Also check out Easyseed https://github.com/nym-zone/easyseed
Use an rPi with no networking hardware, ideally wipe it securely between sessions.


text:
Is it ok and safe to import master public key from electrum wallet into bluewallet to be a watch-only wallet?
I want to use my iPhone (Blue wallet) to be the watch-only wallet for my offline wallet generated on electrum. So that I can generate unsigned transaction on the bluewallet and send it back to my offline wallet to be signed on electrum. And then send the signed transaction back to bluewallet to be broadcasted.
Is it safe to do so? Is there any better way to do it so I don't have to send the unsigned and signed transaction back and forth?

Yes, it is mostly safe. I would also make sure that I use a QR code to transfer the data if possible. You can check https://x.com/cryptosignals66 for more detailed information.


text:
Private key generation bitaddress.org vs application wallet (armory / bitcoin-qt)
Is an application like armory or bitcoin-qt more secure/ trustable in generating the public and private keys than a locally installed version of bitaddress.org ?

Welcome to StackExchange, we're always happy to see new users, especially ones who ask good questions we can actually read! That said, we do prefer that you only ask one question per... question. If you can find a way to edit this to fit that requirement that's awesome. If not, would you mind terribly editing out some of those bullet points and asking them separately?

Oh, and don't forget to search before asking - nothing ruins the new user experience like having your first question closed :P

Awesome, it looks great. Feel free to ask the remainder as separate questions. Welcome to StackExchange, we're glad to have you!

My first instinct is to answer "No". As long as an application is installed locally and cannot send information over the internet to a third party, it's pretty much as secure as can be. There's no good reason to think that either would be more secure.
But there is a slightly bad one... (maybe not bad, but possibly a bit paranoid)...
Consider this: even if a program is open source, it's compiled, which means it not feasible to see the actual code and what it's doing. The software could be sending data when says it's not. Or it could be saving data in a hidden part of your operating system to be retrieved later by another malicious program. It could be doing a number of things that it shouldn't be and it would be very difficult for the end user to know.
A locally installed website, on the other hand, contains uncompiled code which is, at least somewhat, human readable. So, if you really wanted to, you could make sure that a locally installed website such as bitaddress.org isn't doing anything that it shouldn't. Although, this is infeisable for most, I once spent a while looking at brainwallet.org's source code to at least get a partial understand of how it works.

It occurs to me that if you're suspicious of the compiler you should also be suspicious of the browser and/or javascript engine, no?

I think I will go for a local copy of bitaddress as github clone brought to an offline machine with an usb stick.
And i'm going to do a bip0038 encryption on the private key. bitaddress can revert to the public key by using the password, are there other tools which do this?

@DavidPerry Yup! You can't really be 100% sure that your computer isn't doing something that you don't want to do unless you build the computer from scratch and you've taken a look at the source code for everything that you run on it, including the operating system, the compilers, etc. But as I mentioned, this is a somewhat paranoid way to think and terribly infeasible to actually do.


text:
Is someone trying to kill bitcoin?
I've been observing the huge increase in the price of Bitcoin over the last month (November 2013) and I can't help but think, is someone with an ulterior motive pulling the strings here?
It seems to me that Bitcoin represents a huge threat to some very powerful people who would like to see the financial status quo maintained. If Bitcoin posed a significant threat to them, how would they combat it?
I don't think trying to govern or control Bitcoin in any way would work. If I was in that position, I would probably pour a lot of resources into artificially raising the value of Bitcoin, create a mania of publicity around it and get as many people invested into the bubble as possible. Then when it reached a tipping point, I would burst that bubble hard, make sure all those people who invested got their fingers badly burned. Killing Bitcoin by destroying everyone's faith in it...
That's why the sudden increase in value concerns me.
Is it feasibly possible for someone to artificially raise the value of Bitcoin in this way? Given that those who might want to do so would have almost unlimited financial resources, and a whole lot of influence over the media/public opinion. Could they be setting up Bitcoin for a very overt fall?

I could answer this question, but then I'd have to kill you...

@NateEldredge I'm willing to take that risk, please continue!

Possible, yes.
Probable, no.
If such a scheme were tried it would cost the perpetrator a significant amount to execute (Billions of $) and if successful would almost certainly result in a loss of a significant fraction of the initial investment in the "destroy bitcoin" venture.
There is also no guarantee of success, as the bitcoin price could just re-stabilise at a lower value like we saw in 2011.
There are many explanations behind the recent price increase that are far more likely, including the US Senate hearings, China, and the Network Effect.

"there are many explanations behind the recent price increase that are far more likely" - The simplest explanation is probably the correct one! "including... China""* - Especially as we've seen today that news in China can have a huge effect on the price of bitcoin, up or down..

There are really only two things driving the increase in price you are talking about.

Supply and Demand
Greed and Fear

Supply and demand is simple, there is a virtuous cycle at work here:

Increasing demand drives price increase due to limited supply
Increasing price drives increasing demand as knowledge spreads in the media
Repeat

Greed and Fear are basic human emotions, but the interesting thing is that the Greed and Fear is a community measure not an individuals, this can be considered as the "wisdom" of the crowd.

Large price increases increases greed
Increasing greed increases prices
Decreasing prices increases fear
Increasing fear decreases prices

When you boil it down to just these things and nothing else (such as cost of mining) you have something like a measure of the psychology involved in these simple concepts applied to the crowd rather than the individual.

Possible, yes.
Probable, no.
12+ million Bitcoins, Bitcoins value 1077. Multiply these and you get 13 000 million dollars.
This is a lot of money... Even if they had the money and they would be too late. They probably didn't know about this Bitcoin thing from the start. Even if they would try this this would skyrocket the value of Bitcoin.  Because the miners will keep these coins as an investment. Because they would be so rich they don't even care about the still invested money.
Also know the value of the Bitcoin is related to the cost of mining one. If there is a large investor the value of the Bitcoins will rise and the miners will have more money to mine more coins. They will get richer thanks to the evil investor...

I think you're all not seeing the elephant in the room. There will only be finite amount of these things and that's very bad for the future. Why? Simple: a few people will control them and artificially control the value, this in turn will fuel other crypto-currencies to high levels due to most not being able to obtain Bitcoin and thus collapsing Bitcoin in the next two years or so. This will occur over and over as the rats swarm to the next crypto-currency after each pump and dump. Most of you have no real concept of money or finance and what really makes it all work hence the short term gains you're enjoying. At present there's about 150 different types of cyrptocurrency most barely worth a penny one worth over 67k per coin.
Of course there's also the criminal element, when you assign value to something bad people smarter than you will take it from you quite easily. Example the 2011 and current Mt.Gox foolishness and several other exchanges getting hacked and shuttering like the first offical bitcoin bank it lost 750,00 worth and pretty much told it's depositer's your s.o.l.
Any of you read the new Mt.Gox statement on their site? They are in deep and now Bitcoin is in real danger of being federally regulated by the government of Japan, wanna bet all other goverments will follow suit real quick?
Fun while it lasted.


text:
How to compute profit and loss with currency trading?
I can't seem to wrap my head around this.  Let's say we have these fake trades between two currencies
        C1  C2      Rate    dPIP    Trade   Value C1    Value C2
Day 1   1   0       10      0       buy      1          10
Day 2   0   10      10      0       sell     1          10
Day 3   10  0        1     -9       buy     10          10
Day 4   0   1000    100    99       sell    10          1000
Day 5   5   0       200   100       buy      5          1000

Day 2 you decide to short and overnight it crashes to 1 on Day 3.  So you buy.  Your holdings for Currency 1 (C1) go up 10x.  But the value of your holdings doesn't change.  Likewise you decide to short on Day 4 after seeing a 100x jump.  On Day 5 you get cold feet and decide you sold too soon and buy in again at 2x at a loss.
How would you compute the running profits and losses (and which currency should be referenced)?  For Example on Day 3 you made 9 of C1.  Day 4: 990 of C2, Day 5: you lost 5 of C1.  What is the right way to track the P&L because they are relative to each other.
And what is the overall yield?  In the end of it all you went from C1=1 to C1=5 or in terms of C2...C2=10 to C2=1000.
EDIT:  I've looked that this some more.  If I look the change in C2 values during sales and the change in C1 values during buys I think I get the trade-trade yield.  Does this look correct?  Could then be summed to show the accumulative yield?
Example C1 yield (2nd buy) Yield=((10-1)/1)*100 = 900%
        C1  C2      Rate    dPIP    Trade   Value C1    Value C2    Yield %
Day 1   1   0       10      0       buy      1          10
Day 2   0   10      10      0       sell     1          10            0
Day 3   10  0        1     -9       buy     10          10          900
Day 4   0   1000    100    99       sell    10          1000       9900
Day 5   5   0       200   100       buy      5          1000        -50

So if you add up the yields you get 900+9900-50=10750%, but if you look at the yield on C1 it is 500% vs C2 at 1000%.  Obviously I'm not doing something right.

The simplest way to track profits and losses from trading is to mark your holdings to market in your local currency each day. That is, each day, value all your holdings in your local currency at their market price and sum them. If that number goes up, you made a profit on your combination of holding and trading currencies. If that number goes down, you took a loss.
There are various benchmarks you can compare that to. One is your total investment, which you should also value at market price as you invest it. So if you put in one Bitcoin when Bitcoins are worth $750, you add $750 to your total investment. Another is how much you would have if you had simply held Bitcoins instead of trading. Another possibility is to compare against other types of investments such as stocks or bonds.
Note that holding and trading crypto-currencies can be profitable but is extremely risky.

I'm really more interested in computing trade to trade P&L.  See edit.

Just mark to market the thing you traded and mark to market the thing you received in trade. That's the trade P&L. This can, however, give a deceptively high value because market makers can easily be forced to hold a currency only when it's dropping, so you can't ignore your currency holding losses.

My question is specific to how the calculations are done.  I understand the concepts however my calculations don't seem to work out quite right.

It really depends on what you call profit. If having more X means you made a profit, denominate in X!
If you want to compare two trades you generally want to see if you ended up with more than you went in with. Did a buy result in a better sale, or vise versa.
X can be loafs of bread, cars or preferably other currency.
Ultimately it is about increasing total wealth (I assume). That means you have to measure wealth. How you do that is up to you!
To be more direct: Pick either of those, or their value to a third currency. In the end what matters is how much you can buy with it, so picking a very stable third item is a smart move. If you care just about boosting these two numbers you can express your total value in one of the two.

Either way my numbers don't seem to be correct.

authors: Алексей Михайловский


text:
Google Sheets Cryptofinance Add-on - is the company still operating?
I sent in some support emails since May 14 and have not heard back. Anyone aware if the developer is still operating this add-on for Google Sheets?

Update, they replied today (May 23) and resolved my inquiry.

I believe so, I've had a reply to my emails and telegram messages just few days ago. Maybe they are too busy with this (mini) bull market?


text:
Why are multi hop virtual payment channels desirable?
There are papers about multi hop virtual payment channels emerging like the Perun paper or more recently the Donner Paper.
The idea seems to be to reserve some liquidity on a path (or potentially flow) of channels between two peers for a longer time to effectively give them a virtual channel in which they can transact as if they had a direct channel.
Why is that better then just using the available liquidity every time one wishes to transact?

give them a virtual channel in which they can transact as if they had a direct channel.

This is the key point. Direct channel means Alice can make payment to Carol without the involvement of Bob, which frees the intermediate nodes from frequent relay payments. Suppose Alice is an end-user, and she joins the PCN by establishing a channel with a liquidity provider (LP). Next, she wants to make streaming payments to Netflix to watch videos. In traditional HTLC, the LP needs to participate in each payment, and if many clients access the network through this LP, he is overburdened. Conversely, the virtual channel frees the LP from the heavy interactions. After the virtual channel establishment, Alice can make payments to Netflix without the involvement of the LP.


text:
Is it 'safe' to store hashed values of my mnemonic seed phrase on my computer?
I am setting up my hardware wallet, and have written down my mnemonic seed phrase physically, but also want a way of accessing it from my computer.
If I add all the seed words together, and hash it by a specific combination of the existing words, would it be safe to store on a computer?

The outputs of hash functions cannot be reversed. So what is the point of storing the hash of your seed? Perhaps you mean an encrypted version of your seed? That would be storing the ciphertext of your seed. You could do that but just so you know there's already an encrypted version of your seed stored in your wallet file. Otherwise there would be no way for the wallet to sign spending transactions.

Depending on your computer security, if your computer hacked even if you hashed it or whatever did you do, they will access it.
even if you did store it physically, if your computer infected with any keylogger they will see every letter you type.
if you don't have any idea how to secure your computer, just keep it offline and create your transactions then broadcast it somewhere.

If all of the information needed to recreate your mnemonic seed phrase is stored digitally in an online computer, then you will be greatly increasing the attack surface for any potential hacker. There are ways you could store this digital data more securely, but ultimately having it stored in an online computer will ALWAYS be less secure than having a true 'cold wallet', whose keys/seed phrase have never existed on an online machine.
If you are just storing the hash of your seed phrase, then that would not be enough for an attacker to steal your coins. However, you will need to input your seed phrase into some device in order to run the hash function, so something simple like a keylogger could skim your seed phrase when you do so. You could run the hash function on a permanently offline machine, and then transfer the output value to an online machine for storage, but I'm not sure what the point of doing so would be. A hash of the seed phrase will not help you restore your wallet later, you'll need the seed phrase itself to do so.


text:
How do exchanges and atms introduce bitcoin
As far as I know, Bitcoin is "mined", introduced into the system as part of the protocol, a reward to the miners for verifying everyone's transactions and keeping the network up.
But how do exchanges and ATMs introduce Bitcoin into the system?
Say I bought $10 worth of Bitcoin from an ATM. ATM takes my cash, I get $10 worth of Bitcoin assigned to the address I provided. Where did that $10 worth of Bitcoin come from? Surely it wasn't "mined on the spot". Is there a protocol for such transactions? Does the ATM/Exchange have "spare Bitcoins" that they just assign to the buyer? If so, how did they obtain those coins in the first place? They must have traded it with something too.

Miners need to pay for costs, namely electricity and hardware. One such way to pay for these is to sell the Bitcoin they mine for regular money.
Such transactions will often pass through exchanges. Exchanges and ATMs are simply order books. They accept Bitcoin and fiat money, and match buyers and sellers. If you want to sell 1 BTC at $1000, the order will only go through if there is a buyer willing to pay $1000 for 1 BTC.
Exchange will rarely hold large positions themselves. Instead, all the funds on an exchange usually belong to buyers and sellers, which can be miners, or people who have previously bought Bitcoins.
ATMs and other such systems will often just be a more user friendly mask to an exchange. An ATM operator might deposit $100,000 into an exchange account. Then, when someone puts $100 into an ATM, the ATM operator will execute a buy order of $100 on the exchange (out of their 100k balance). If the order is successful, the ATM will send the BTC out to the user's address, usually from a "hot wallet", which contains some prepurchased BTC that is readily accessible (also commonly known as the "float").
The ATM operator will then perform some balancing of their own, which may involve moving the BTC purchased on the exchange to their hot wallet, and moving the $100 physically deposited into the ATM into a bank account, and then transferring to the exchange he/she uses to maintain liquidity.
At the end of the day, if you follow transaction inputs back long enough, you will eventually end up at a coinbase input, which is the block mining reward that created some BTC. This till then pass through an assortment of exchanges, personal wallets, and p2p trades until it finally ends up with you.

Put simply an exchange buys bitcoins from people who have bitcoin to sell. These could be miners or just people who sold goods and services for bitcoin and want to convert those coins to fiat. So they sell them on an exchange. The ATM owners buy bitcoins from an exchange and send them to their ATMs. The ATMs then send those bitcoins to buyers in the real world as and when required.
The protocol is the bitcoin network itself which lets you transfer funds from one script to another. The scripts specify the conditions under which the funds can be spent. Scripts are often encoded as addresses. When you buy bitcoin at an ATM you give the machine your address and it assigns the coins to you.


text:
How do I find out where a bitcoin address is from?
I am not looking necessarily a name but more like is it an offline, coinbase, blockchain.com, etc...
I had $80 sent from my account yesterday and it says it went to 1H8KZWdTeRuiCq4NyCTYGA8Uw9XjKuLPCx however I don't remember this or know this address. I know that this doesn't sound like a lot of money but for me it is. Please help me if you can

How do I find out where a bitcoin address is from?

You can't find a person, organisation or place from a Bitcoin address alone.
A Bitcoin address isn't really an address in the normal sense. It doesn't label a place or person or anything else in the real world. Really its just a reference number produced from a secret number by a mathematical function. You can't even reverse the maths to find the secret number from the address.

If you do not remember making this transaction, your keys or devices may have been compromised.
It is not possible to determine who or what entity holds the private keys to a bitcoin address - bitcoin is anonymous by design. Although there are techniques to link addresses to known parties such as exchanges, they are rarely 100% accurate, and usually cost money to look up an address.
In any case, it would not help you here, since the address mentioned has only one incoming transaction, and no outgoing transactions (yet), which means there is no pattern that could potentially help identify the operator.
You should assume you are compromised and reset passwords on all devices, accounts, and wipe any devices that may have had access to that account.


text:
How do hardware wallets communicate with the outside world?

Hardware wallet has more security than software wallet because they
  store private key in offline hardware, which online attackers cannot access. Thus, they sign
  in the hardware and then send the transaction with signature out to Bitcoin network.

At this points, I'm wondering some stuff:

If user make a payment, who broadcasts the transaction into the Bitcoin network? I know that hardware wallets has no Bitcoin node software that can communicate with peers. So who is responsible for this work?
bitcoin-cli is a program for querying a bitcoind node, but hardware wallets has no blockchain similar database thus, it can't query any information locally. How does hardware wallets check their transaction state?

A hardware wallet only has responsibility for handling private keys. This includes generating addresses (when receiving), and signing transactions (when sending). It needs some sort of communication with the outside world to do this. There's multiple hardware wallets on the market, and they don't all operate the same way. However, the principles are the same.
1) How is the transaction broadcast? After the transaction is signed, the hardware wallet can export this in raw format. Anyone connected to the Bitcoin P2P network can then broadcast this raw transaction. One way of doing this is through bitcoin-cli sendrawtransaction. Another one is through a web wallet interface. This is typically provided by hardware wallet manufacturers.
2) How does a hardware wallet query the blockchain? It doesn't. It has to have an external source of information about this. This could either be a full node like bitcoind, or a lightweight SPV wallet like Electrum.
Common for both of these are that the hardware wallet needs to communicate with something externally. Trezor and Ledger does this by USB connected to your phone or computer (some Ledger models also have bluetooth), Coldcard uses micro SD cards.

Thanks for reply :) you mean that hardware wallet should have another software to process operation like query in the bitcoin network. in other word, the manufacturer simplified bitcoind by removing store the blocks locally and keep up p2p communication.

A hardware wallet is a bad name. It isn't a wallet at all, it's an offline signing device. When you use it, your (software, online) wallet prepares an unsigned transaction based on the payment you want to perform, and then gives it to the hardware wallet to sign. It gets back a fully signed transaction, which can be broadcast.


text:
Double spending problem in Bitcoin
Suppose Alice sent 2 bitcoins to Bob, Bob ships the product to Alice, then Alice sends 2 bitcoins to herself. Why is this a problem ? If both the transactions are approved then also Bob gets his 2 bitcoins (irrespective of the order of both the transactions). If Alice has no bitcoins left after sending them to Bob, then also no harm is done.

Possible duplicate of https://bitcoin.stackexchange.com/q/70366/5406

Suppose Alice sent 2 bitcoins to Bob, Bob ships the product to Alice, then Alice sends 2 bitcoins to herself. Why is this a problem?

If Alice only had 2 bitcoins to start, then she will not be able to spend them twice. After the first spend (paying Bob) is confirmed, the network will not accept a second payment that spends those same coins again. From the network's point of view, those 2 coins are now locked to an address that Bob controls, not Alice.
Just imagine you had a $10 bill in your pocket, and you went to a food court and used it to buy $10 worth of pizza. After eating the pizza, you decide you need a drink, but you don't have any more money. Would you be able to buy the drink by somehow 'doublespending' the $10 bill you had earlier? Of course not, it is obvious you don't own that $10 bill anymore! The same reasoning applies to bitcoin double spends: you simply don't have any more coins left to spend.

If both the transactions are approved then also Bob gets his 2 bitcoins (irrespective of the order of both the transactions). If Alice has no bitcoins left after sending them to Bob, then also no harm is done.

You say 'no harm is done' by allowing Alice to invent bitcoins out of thin air, but that is far from true! If Alice could create endless coins, then all other coins would slowly (or maybe not so slowly) become worthless. Why would anyone pay for something, that any person (Alice) can just create without cost?

Why both the transactions contain the same 2 bitcoins? I mean, when is it decided which unspent outputs will be used in a transaction?

You said ‘Alice has no btc left after sending to Bob, and the question is titled ‘double spending...’, so I assumed that was the case. If the two transactions spend different coins, then it’d be no problem. Coin selection is usually done automatically by the wallet, but sometimes can be specified by the user, it depends on the software.

If Alice has no bitcoins left after sending them to Bob, then also no harm is done.

You're essentially saying here that if the double-spend problem is solved, then no harm is done. Obviously.
The point is that without a solution to the double-spend problem, Alice could send her 2 BTC to Bob AND also have 2 BTC left herself. This would obviously make Bitcoin useless, as it'd allow people to print money out of nowhere, devaluing everyone else's coins.

Why both the transactions contain the same 2 bitcoins? I mean, when is it decided which unspent outputs will be used in a transaction?

The sender software determines which coins to use, and it of course will never pick the same ones twice. But with modified software you can construct conflicting transactions that spend the same coins - and the network needs a way to prevent that.


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

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

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

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

Also correct. There is no built-in 'protection' against having a transaction included in a stale chain. As a user, it is almost always recommended that you wait for a few confirmations before you consider a transaction as fully settled. This helps ensure that your transaction isn't included in what will eventually become a stale chain. Often, people quote six blocks as being a high level of assurance.
In practice, we can see that it is exceedingly rare for there to be a stale fork that runs longer than just a couple of blocks. See this question for some examples of past forks.

thank you and i highlighted the main points;


text:
how do bitcoin nodes know about the full network
partitions sometimes occur in a distributed network; when this happens, a node can only communicate to a subset of other nodes in the network and may use a different chain as the main chain; since current spec recommends a confirmation of 6 blocks, and current block generation speed is about 10 min / block, this means it is possible to invalidate a transaction if there is a network partition lasting longer than 1 hour; i was wondering how bitcoin client is implemented so that it know it is communicating with the full network and not suffering such network partition;

There are no network level controls for this, as far as I'm aware, simply because there is no real way to discover every node in the network.
Instead, partitions are likely to not last very long as the mining power will also be distributed between the partitions. This means that for a partition with only 10% of the mining power, it will take rather long to mine six blocks, while the partition with 90% of the power will quickly establish a longer chain.
There are some efforts made to given nodes varied peers. If I'm not mistaken, the BTC DNS seeds will try and return different nodes for each request, so that you don't end up with too many nodes connecting only to each other, and have a more varied peer graph.
Additionally, if there is a minor partition, it is fairly likely the the partition will reconnect soon. At that point, since one partition will almost definitely be longer, it will become the dominant chain again. If both partitions are equal, the next block after the partition will make a dominant chain appear.


text:
is the proof-of-work for safety or efficiency?
i am reading the proof-of-work (aka: pow, target threshold, difficulty, etc.); my understanding is that pow adds a requirement to validate block headers, so that both benign and malign nodes need a reasonable amount of time to create a valid block; but i dont see how this rate limit relates to safety; even if there is no pow, so that every block is valid, as long as benign nodes have the majority of computing power, couldnt they still guarantee the main chain is correctly formed?
for example, assuming benign nodes are the majority:

with pow, malign nodes generate new blocks at m blks/min, while benign nodes at b blks/min, and b > m;
without pow, malign nodes generate at 100000m blks/min, while benign nodes at 100000b blks/min; we still have 100000b > 100000m (even though the public ledger now grows much larger);

above is an extreme example, but you could imagine adjusting pow step by step, from current 10 blks/min to 20 blks/min, to 30blks/min, etc. does the bitcoin protocol become less secure from the adjustments?

PoW and validation are completely separate things. You can PoW your cat pictures and that would be fine. Full nodes will do 100% of the validation for themselves and only pick valid Bitcoin blocks thus throwing out your cat pictures.

In principle, yes, what you suggest could work, even in your "extreme case".  But in practice, if it took very little work to create a valid block, then there would be trillions of blocks created per second (by both good and bad actors), and it would become impossible simply to store or transfer that much data, not to mention trying to sort them into a chain.  You'd also have a lot more people stepping on each other's toes by creating multiple blocks naming the same parent, leading to many forks in the blockchain that would take a while to be resolved.
But there would be nothing wrong with altering the difficulty schedule so that blocks get created at a somewhat higher average rate (note that the Bitcoin standard is 0.1 blocks per minute, i.e. one block every 10 minutes, not 10 blocks per minute).  The choice of 0.1 blocks per minute was arbitrary and a different rate would work fine.  Litecoin, for instance, uses a rate of 0.5 blocks per minute.
It is helpful not to have it too fast, so that most of the time there is at least a few seconds between blocks, and the block has a chance to propagate through the network before a new one is found.  Otherwise you get more forks, as mentioned above.
Also note that a common misconception is that reducing the block time would speed up confirmation of transactions.  The security of a transaction against double-spend is related to the total work done on top of it in the blockchain, not just the number of blocks.  So if Bitcoin increased the block rate to 0.5 per minute like Litecoin, that would mean each block demonstrates only 1/5 as much work as before.  To get equivalent security to the current standard of 6 confirmations, you would now have to wait for 30 confirmations, and it would still take 60 minutes.
So while there wouldn't be any particular problem with increasing the block rate (other than those inherent in changing the protocol through a hard fork), there wouldn't be any dramatic benefits either.

all right this sounds like varying pow doesnt open a security issue and pow is for usability, efficiency, etc. reasons;

Good answer overall, but the "common misconception" is not a misconception.  Imagine 2 chains, A targeted for 1-minute blocks and B for 10-minute blocks.  After 10 minutes, A has about 10 blocks and B has about 1 block.  If an attacker wanted to keep private a longer chain and publish it after 10 minutes they would need approximately 11 private blocks for A and 2 private blocks for B.  Even if they were able to produce blocks at half the rate of the rest of the network the chances of that would be about 1 in 2^11 on A and 1 in 2^2 on B, so A allows shorter confirmations for similar confidence.


text:
I lost my uncle few Weeks ago due to the covid 19 and I have his wallet
I have my uncle wallet and I don’t have his private key can anyone help

I meant any amount requested I’m ready to Pay

What is the wallet software / is it a paper wallet?

To assist you further, would you let us know what type of wallet is it?

Hello, welcome to bitcoin.stackexchange! I'm sorry to hear of your loss, in order to help you'll need to provide more information though. More info about the software used / what you have access to is needed. Note: DO NOT share wallet login info, private keys, or mnemonic seed phrases with anyone online, anyone who has that info can steal the coins. Also, offers of reward are not allowed here; if you provide enough info someone will likely help out anyways.

Okay the wallet is blockchain.

And how do we chat privately on this site? Do y’all use icq?

@jeff there is no private chat on this site. Anyone capable of helping should be able to do so publicly; there is no need for you to disclose sensitive info. Are you capable of logging into your uncles blockchain wallet? Do you have possession of a backup of that wallet?

Can you be very precise about what you have and what wallet he was using?

As the user has not followed up with more information in over a month, I've voted to close this question as "lacking details". To reopen the question, please edit your post  to provide more information. Please do not provide any sensitive information.

I have my uncle wallet

The only important thing in a wallet is the private key(s). Usually the wallet's contents are protected by a password. Without the password, no one can get the private key out from the wallet.
The actual money is better thought of as being in the public blockchain. Money is not really inside the wallet.

and I don’t have his private key

Then you don't have any control over his money.
You must find the private-key or a seed-phrase (recovery phrase) - usually consisting of 12 or 24 words from a special list. The private-key can be recreated from the recovery phrase. Prudent people put this information somewhere safe. Some people stamp the recovery phrase onto a fire-resistant  metal sheet and lock that away somewhere.

can anyone help

You will get lots of offers from dishonest people trying to steal the money or, to trick you out of money in "unlocking fees" or other fictions. Don't trust new people who communicate in private. Never give anyone else anything that looks like a private-key or recovery-phrase.
But no, you really need to find the key or recovery phrase. Nothing else.