text:
Double SHA256 giving me an incorrect value with this code VB.net
I'm trying to build a bitcoin miner. I have generated the message successfully, but I can't get the double SHA256 correctly. The value I'm getting is incorrect. What is wrong with this code?
 Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click

    Dim message_combined as string = "02000000671D0E2FF45DD1E927A51219D1CA1065C93B0C4E8840290A00000000000000002CD900FC3513260DF5BD2EABFD456CD2B3D2BACE30CC078215A907C045F4992E3E5F4A5E747B1B1843F740C0"

    Dim sha256 As SHA256 = SHA256Managed.Create()
    Dim bytes As Byte() = Encoding.UTF8.GetBytes(message_combined)
    Dim hash As Byte() = sha256.ComputeHash(bytes)
    Dim stringBuilder1 As New StringBuilder()

    For i As Integer = 0 To hash.Length - 1
        stringBuilder1.Append(hash(i).ToString("X2"))
    Next

    '  Dim sha256 As SHA256 = SHA256Managed.Create()
    Dim sha256_2 As SHA256 = SHA256Managed.Create()
    Dim bytes2 As Byte() = Encoding.UTF8.GetBytes(stringBuilder1.ToString())
    Dim hash2 As Byte() = sha256_2.ComputeHash(bytes2)
    'bytes2 = Encoding.UTF8.GetBytes(bytes)
    'hash2 = sha256_2.ComputeHash(bytes2)
    Dim stringBuilder2 As New StringBuilder()

    For i As Integer = 0 To hash2.Length - 1
        stringBuilder2.Append(hash2(i).ToString("X2"))
    Next

    final_hash = stringBuilder2.ToString()

    TextBox9.Text = final_hash
End Sub

After double hashing, the end hash should be: 920F0D3EF835E723DBDA8AE0E1EA0705FAF53AC784A8116639BCB215F3BC9D8B

You seem to be interpreting the hex encoded data as a UTF-8 string. Instead, you should be decoding it as a byte dump.
To illustrate, decoding 12 as a UTF-8 string will give you:
0x3132

while decoding it as a hex dump will give you:
0x12

In bitcoin, all hashing it done on the byte values, which are often printed as hex strings for convenience - you must decode them back into a byte array as hex strings, not as actual strings.

Thank you, it solved the problem. :)

I have another dumb question, suppose now I got the hash lower than the target, then what should I do? how to insert it to the block chain that it will generate the reward to my wallet. no need of code, just some information would be great. should I hash again with my wallet address etc and send it to some ip adress etc (web request etc)? I really have no idea.

You're supposed to be hashing the result of getblocktemplate, which will include a coinbase transaction that pays the reward to your wallet. You cannot choose to pay the reward to yourself after the hashing is already done. If you find a valid block,, you can use the submitblock RPC call to submit it to the network

getblocktemplate is to connect to the mining pools right? I will not use mining pools, I will mine as a sole miner (I know it's nearly impossible to find a block) I want to submit the block myself. currently I hash with version, previous block hash, merkle root, time stamp, bits, nonce.  , where do I hash my wallet etc to receive the reward?

The block template can be used to mine to your own wallet as well. Your own wallet goes in the coinbase transaction, which is part of the merkle tree, which leads to the merkle root in your block header.

I'm sorry, I still don't get it, the getblocktemplate contains  "previousblockhash",
"transactions": [],    "expires":     "target":      "longpollid":      "height":      "version":     "curtime":      "mutable":      "bits"  .. I don't think if I'm a sole miner, I won't be needing all those stuff to hash, and further, getblocktemplate doesn't have any where to include my wallet address etc. please elaborate a little bit more if you don't mind.

and bitcoin.org says to create the blockheader only version, previous block hash, merkle root, time stamp, bits, nonce is needed, then why are you saying that I should hash according to the getblocktemplate...    how can I include my wallet address so when I find a good hash, I will receive the reward


text:
Is it possible to link one single LN node to Bitcoin addresses?
In René Pickhardt's presentation (slide 166) (here is the interesting talk), it's written that on-chain funds and addresses can be linked to LN nodes. How can this be achieved?
From my understanding, it is possible to link funds of a channel to two LN nodes, but it's not possible to tell which node funded the channel and how the funds get split among nodes in the settlement transaction.

If a channel is announced a multisig output - which encodes the capacity of a channel - is linked to two nodes on the lightning network. This mutltisig output is obviously onchain and can be seen as onchain funds.
This does not mean that we know directly who funded the channel and how the funds are split between nodes in the commitment / settlement transaction.
However the funding transaction was consuming some other outputs. They might have come from the settlement transaction of another channel. This links two funding transactions. The node that takes part in both payment channels is the one who funded the second channel. Currently lightning nodes reuse outputs and do not mix / coinjoin them. Thus the analysis is rather straight forward.
However it seems that if nodes never reuse outputs and if channels never close it will be much harder to link funds to a single node.

Is it possible that the funds received by an address from a settlement transaction are then used to open another channel that has no node in common with the previous one? In other words, the node ID changes, but the wallet does not.

Theoretically yes. But you'd have to customize your ln node as I think that currently all addresses and nodeid are all derived from a master secret. So switching the node is will not be so easy

source: Stack Exchange

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

sort: votes


text:
Converting NodeID and BitcoinKey from Lightning Network (LND) logs
From the LND logs I have something like this (I changed some characters for privacy):
NodeID1: ([33]uint8) (len=33 cap=33) {
 00000000  02 19 8b 61 42 18 89 24  74 fc 95 ed 64 c4 77 91  |.9.a@(.$t...d...|
 00000010  e9 94 97 50 42 d0 bd 7e  95 91 b0 ec 41 28 ab ac  |...PB..~....A(..|
 00000020  e4                                                |.|
}

BitcoinKey1: ([33]uint8) (len=33 cap=33) {
 00000000  02 63 a4 ca a4 63 8c 3c  43 fc 65 8a e5 7c b5 f8  |.c...c.<C.e..|..|
 00000010  a7 8f f5 a4 d8 2e ad 0a  83 3a 17 e1 e8 1e c8 c8  |.........J......|
 00000020  91                                                |.|
}

I read and checked some docs and services, but the result is wrong.
What are the steps to obtain the node pubkey and the Bitcoin address?
I fear that similar questions have been already answered, but I'm still not able to answer mine.

The values you've pasted are the node public key and the funding transaction output public key. The keys are encoded in compressed form (0x02 | 0x03 followed by the 32-byte x-coordinate of a point on the curve). The first byte indicates whether the y-coordinate is positive (0x02) or negative (x03). The 33-byte public key is the format used throughout the BOLT specs. All values in the BOLTs are encoded in network endian byte order.
There is no "bitcoin address" in either of these, nor are any convertible directly to an address. In bitcoin, the funding transactions use a P2WSH output, but the redeem script for this transaction is not revealed until the transaction is spent (channel closed). The only way to reconstruct the redeem script is if you know both funding public keys for the channel. in which case the redeem script is simply 02 <pubkey1> <pubkey2> 02 OP_CHECKMULTISIG, where <pubkey1> is the lesser of the two public keys.
The way Lightning channels are mapped to a bitcoin transaction is through their short_channel_id, which is a triplet of <block_height>x<tx_index>x<output_index>, encoded as a 64-bit integer. (block_height and tx_index as 24-bits each and output_index as 16-bits).
The full channel_id can also be used to map the channel to a bitcoin transaction, as the channel_id is the txid xor output_index.

To give more context: the data above comes from a channel_announcement message where you have two nodes' pubkeys and the two corresponding Bitcoin public keys. If I understand correctly, these two Bitcoin keys are the ones that will be used to spend the UTXO that funded the channel, when the two nodes want to close it, but there is no way to link these keys to Bitcoin addresses of the nodes, neither the input addresses funding the channel nor the output addresses in the closing transaction, right?

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


text:
HD wallets and multisig
Is there any standardized way to define HD wallet accounts used to participate in multi-signature transactions? How do existing multisig wallets derive their keys from the seed it? How is Bitcoin Core doing it, as it has added support for both, HD wallets and PSBTs, recently?

This answer shows how you could do HD key derivation from xpubs using the new "descriptor language" added to Bitcoin Core in 0.18.

Okay, I found this information about Copay, one of the few multisig mobile wallets:

Depending on the key derivationStrategy, addresses are derived using BIP44 or BIP45. Wallets created in Copay v1.2 and forward always use BIP44, all previous wallets use BIP45. Also note that since Copay version v1.2, non-multisig wallets use address types Pay-to-PublicKeyHash (P2PKH) while multisig wallets still use Pay-to-ScriptHash (P2SH) (key addressType at the backup):

[...]

BIP45 note: All addresses generated at BWS with BIP45 use the 'shared cosigner index' (2147483647) so Copay address indexes look like: m/45'/2147483647/0/x for main addresses and m/45'/2147483647/1/y for change addresses.
Since version 1.5, Copay uses the root m/48' for hardware multisignature wallets. This was coordinated with Ledger and Trezor teams. While the derivation path format is still similar to BIP44, the root was in order to indicate that these wallets are not discoverable by scanning addresses for funds. Address generation for multisignature wallets requires the other copayers extended public keys.


text:
Why is bitcoin balance is incorrect?
For bitcoin-QT, why can't I get any confirmations, but it still subtracts from my total balance?

please you need to be a bit more precise on describing your situation. We don't know what "it still subtracts" means, and also what confirmations you expect. Maybe a tx ID or bitcoin address would help, if you don't mind privacy.

When you send from your wallet, your wallet will subtract the amount sent and mark the input that was spent as spent even when the transaction is unconfirmed. This is to prevent you from creating a conflicting transaction accidentally if you wish to send Bitcoin to someone else while the previous send is not confirmed.
This is standard behavior for all wallets.

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


text:
What redeem script is used in bitcoin core wallet when generate the address?
I'm trying to generate the address 38DGj87axzmQiZeAd1w1y5FEmuu5a7pfBa in my bitcoin core wallet with code.
First, I dump the private key from the address, then I calculate the address from the private key. As the address is start form m, which is of P2SH bitcoin address type. And the P2SH address is constructed as
base58-encode: [one-byte version][20-byte hash][4-byte checksum]

Here I don't know what the script used to calculate the [20-byte hash] in the bitcoin core wallet?

You can use the getaddressinfo RPC command in the latest version of bitcoin core to get the hex encoded script for that address. But note that because you were able to get a private key, I assume this is a P2SH wrapped segwit address, which means the script is just an OP_0 opcode followed by the hash160 of the public key corresponding to that private key.

I use bitcoin core 0.16.0 the latest version. But when I use getaddressinfo I got "Method not found"

Oh apologies, I thought it had made it into 0.16, it looks like its still only on the master dev branch. In that case you might have to create the script yourself using the OP_0 + hash160 approach I mentioned, see here for more info: https://bitcoincore.org/en/segwit_wallet_dev/#creation-of-p2sh-p2wpkh-address

Use validateaddress instead (the parts of validateaddress that give address information are moved to a new getaddressinfo command for the next major version, 0.17).

@AndrewChow does validateaddress output the script? I wasn't sure if it did or if that was new functionality

@MeshCollider It does. The RPC was just split up in two in master, but no new functionality was added.

(For additional detail):
It is a P2SH-P2WPKH (Pay to witness public key hash wrapped in a pay to script hash). To create this address for mainnet:

Create Witness PKH:

PKH = OP_0 0x14 RIPEMD160(SHA256(compressed public key))
0x14 is number of bytes

Create P2SH:

BASE58CHECK(0x05 PKH)
0x05 is the mainnet P2SH prefix

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


text:
Can you send bitcoins together from the same wallet if they have been received via various different addresses?
What has been sent to your individual bitcoin addresses is supposedly recorded in the blockchain, but can you then send all of the combined bitcoins (that you received via various different addresses) at once with your public key? For example, if I received 1 bitcoin via address 1, 2 via address 2 and 5 via address 3, all of these addresses being derived from the same public key, and I wanted to send 6 btc to a friend, could I send all of them at once with my public key? Or would I have to send a combination of bitcoins from different addresses, i.e. by separate transactions? And if I could send them all together using the public key, how is it determined that I am in possession of all of these bitcoins if they were sent not directly to my public key, but to various irreversibly hashed addresses derived from my public key?

A bitcoin transaction can have one or more inputs, and one or more outputs. For example, here is a transaction with 1 input 3 outputs, and here is one with 3 inputs 1 output.
I think you are confusing the terms public key, and private key. A wallet is a collection of keypairs (private keys and public keys), and each one can be used to create a unique bitcoin address. So if you have three different input transactions to three different bitcoin addresses, each of these will be spendable using it's own private key.
Your wallet will sign the transaction with each of these three keys, and the rest of the network can validate the signature by comparing it to the public key associated with each input (despite never knowing the private key!). To learn more about how this works, look up some info on how public key cryptography works, it is a useful cryptographic tool employed in many systems, not just bitcoin.

So in the transaction with 3 inputs and 1 output, did the sender have to send the bitcoins from 3 different addresses (albeit all signed by the same private key), and specify these addresses when making the transaction, as opposed to sending all of the bitcoins from one place, given that they, I am assuming, all came from the same wallet?

Each bitcoin addresses relates to a unique private key, there is not one private key that will sign for all of the inputs in a three input transaction. I think you are confusing this with a BIP 32 HD wallet, in which a master private key is used to derive the wallet's subsequent private keys (each of which will have its own uniqe bitcoin address). As a user, you do not have to worry about this, the wallet software will take care of input selection and transaction signing in the background for you.

I am able to generate multiple bitcoin addresses in Exodus, so I've been under the impression that any number of addresses can be made by hashing the public key. So all of these addresses go back to the one common key. Are you sure that each bitcoin address relates to a unique private key? Or were you referring to public keys?

Multiple addresses aren't created by hashing a public key, this is a misunderstanding. A hash function is deterministic, so if you provide the same input more than once, you will receive the same output each time. That said, it occurs to me that you may be talking about an extended public key (xpub), which can be used to derive infinite child pub keys. Even in this case, you still need the extended private key (xpriv) that created the xpub key so that you can derive the child priv key of each child pub key. So each address still has a priv key of its own, that is required in order to spend

A BIP32 hierarchical deterministic (HD) wallet works in this way, all addresses are derived from a master extended private key (xpriv key), but it is public/private key-pairs that you derive, not just addresses that are all controlled by a single private key. The mnemonic phrase that many wallets implore you to write down is the seed phrase to generate your xpriv key for the wallet.


text:
Can a 51% attacker earn mining rewards on the blocks they tampered with?
This article gives an example of a 51% attack in theory as:

In a 51% attack the hacker will typically mine in private to attain a
longer chain than the publicly seen chain in hopes of double-spending
coins. Cryptocurrency exchanges are often the target of the hack due
to their deep pockets and acceptance of coin deposits and withdrawals.
By having control over more hashpower than anyone else the attacker
has the advantage to find winning blocks faster. If they can mine
selfishly, meaning they secretly mine successful blocks but don’t
broadcast them to the network, they can build up a number of blocks
and when ready broadcast a longer chain of blocks to the network. All
the miners would favor building on the longer chain.
Meanwhile, the attacker would have sent some of the coins they mined
previously to an exchange using the chain that is seen publicly. Once
their deposit is confirmed, the attackers are able to exchange their
mined coins for other coins that they’ll quickly withdraw from the
exchange.
Then, the longer chain that was mined in secret is broadcast to the
network. The longer chain would contain a transaction using the same
coins that were deposited to the exchange.
Now that the miners see the longer chain they will build blocks at the
tip of the longer chain. This has two effects. One, the blocks in the
shorter chain are now orphaned and their transactions dumped back in
the mempool. That means the transaction to the exchange was reversed
like it never happened and the exchange was effectively robbed of the
withdrawn coins. Two, the attacker’s second transaction gets
completed, in effect spending the same coins twice.

When the attacker broadcasts the chain they had been working on in private, will they get mining rewards for all those new blocks after the reorg?

When the attacker broadcasts the chain they had been working on in private, will they get mining rewards for all those new blocks after the reorg?

Yes, the majority attacker can create the longest blockchain entirely on their own. They will create every block in the chain, and thus also create the coinbase transaction in each of those blocks. Presumedly, they would pay the coinbase transaction to an address that they control.

Thank you! And the folks who had earned the mining rewards on the prior canonical chain would still keep those rewards? I am sure that is true, but wanted to verify :)

@septerr only blocks that are in the longest chain can possibly pay a block reward. Any blocks that were in the chain originally, but then were reorganized out when the attacking chain was published, would no longer be valid and thus their coinbase UTXOs would not exist on the network. Very old blocks that were no reorg’d out would still be valid though.

Ahhh! That makes sense, thank you so much!! I did not think of the fact that after the reorg, the coinbase transactions on the old chain are no longer part of the canonical chain. Thanks again!


text:
After mining rewards go down to 0, can someone clog the Bitcoin network by creating millions of transactions with no fees?
After mining rewards go down to 0, it is possible miners will not pick up transactions with 0 fees. In that case, could someone create millions of transactions with no fees, to congest the mempool and slow down the network?

The answer to your question is no (I'll write an actual answer latee to explain), but just to know what I have to focus on: why do you think mining rewards have anything to do with this?

This is not a change in the future; already today, and for a long time, miners usually prefer higher-fee txns, unless you or someone incentivizes some miner(s) out-of-band. This is why wallets automatically suggest (or simply use) a fee rate based on recent successful txns. See as Stack already suggested https://bitcoin.stackexchange.com/questions/69030/how-did-these-zero-transaction-fee-transactions-make-it-into-the-bitcoin-network

@PieterWuille the reason mining reward going down to 0 was relevant to this question...is because without mining reward and transaction fee, the transaction has no incentive left and thus likely won't be picked up by any miner.

could someone create millions of transactions with no fees, to congest the mempool and slow down the network?

Most nodes will discard and not relay any transactions with a fee less than their configured minimum relay transaction fee.
As https://en.bitcoin.it/wiki/Miner_fees says

Relaying
The reference implementation's rules for relaying transactions across the peer-to-peer network are very similar to the rules for sending transactions, as a value of 0.00001 BTC is used to determine whether or not a transaction is considered "Free". However, the rule that all outputs must be 0.01 BTC or larger does not apply. To prevent "penny-flooding" denial-of-service attacks on the network, the reference implementation caps the number of free transactions it will relay to other nodes to (by default) 15 thousand bytes per minute.
Settings

Setting
Default Value (units)

txconfirmtarget
2 (blocks)

paytxfee
0 (BTC/kB)

mintxfee
0.00001 (BTC/kB)

limitfreerelay
15 (thousand bytes per minute)

minrelaytxfee
0.00001 (BTC/kB)

blockmaxsize
750000 (bytes)

blockminsize
0 (bytes)

blockprioritysize
0 (bytes)

So there already are countermeasures to denial of service attacks .
None of this has anything to do with mining rewards. I don't doubt miners will also ruthlessly prune any transactions that don't serve to maximise their profits.


text:
Bitcoin difficulty - why leading 0s?
I do a sort of bitcoin 101 presentation for folks where I work. In one of the recent sessions, someone asked why the proof of work difficulty requires a minimum number of leading 0s. Why not 1s or something else?
Not understanding the math behind it in-depth, the best answer I can come up with is that the protocol requires that the proof of work hash (hash of nonce and block data) should be equal to or lower than the difficulty target. Hence, you can interpret it as having to contain a certain number of leading 0s.
Is there a better explanation?
Thanks!

Not understanding the math behind it in-depth, the best answer I can come up with is that the protocol requires that the proof of work hash (hash of nonce and block data) should be equal to or lower than the difficulty target. Hence, you can interpret it as having to contain a certain number of leading 0s.

This is exactly what it is. The actual calculation has nothing to do with leading 0s. It's entirely just a comparison of integers, which has the effect of producing leading 0s.

I think the explanation with "number of zeroes" has a historical reason: hashcash, the original PoW system, had a "difficulty" that was actually the number of zero bits up front in the hash. Bitcoin's proof of work is based on it, but generalized to a big integer comparison.

@andrew-chow thank you for your answer. Say if difficulty target was 0F in hexadecimal. Then the PoW hash could be anything between 00 to 0E. In this case the number of leading 0s required is 1, but that is not sufficient. The second number needs to be between 0 and E inclusive. Is this correct?

Correct. Even the earliest instances of the code pay no attention to the number of leading 0s and really have the requirement of being smaller than a given target.
Here's a code snippet of how hash target was adjusted (it was effectively multiplied by the ratio of actual time taken over the time desired by satoshi) -- https://github.com/bitcoin/bitcoin/blob/4405b78d6059e536c36974088a8ed4d9f0f29898/main.cpp#L716.
Here's a code snippet where the comparison was actually made -- https://github.com/bitcoin/bitcoin/blob/4405b78d6059e536c36974088a8ed4d9f0f29898/main.cpp#L2345


text:
Storing bitcoins without a wallet using only a seed phrase
Presently I have some BTC in a custodial wallet which I want to transfer out. I don't want a use a wallet at all. Neither hardware nor software.
If I install Electrum on a live Ubuntu session, create a wallet, transfer BTC to it, note down the seed phrase and terminate the live session, will I still be able to recover my wallet with coins several years from now?
What are the downsides of this method over a cold storage wallet?

If I install Electrum on a live Ubuntu session, create a wallet, transfer BTC to it, note down the seed phrase and terminate the live session, will I still be able to recover my wallet with coins several years from now?

Yes. Your mnemonic phrase is all you need to store to recover your funds and your passphrase if you added one.

What are the downsides of this method over a cold storage wallet?

I mean technically what you are describing is a cold storage wallet, it's a cold Hierarchal Deterministic wallet with a bip39 mnemonic backup. The wallet being electrum which you used to derive a bip39 mnemonic. Since the backup method is a popular standard even if Electrum disappears you can be sure you will be able to recover your coins several years from now.

Essentially what you are proposing would be a cold storage if you install electrum via usb stick and not connecting your computer to the internet. What is really important that you note down not only the seed but also the derivation path to your HD wallet. This is necessary for recovering the coins years from now. There is a good side where you can check:enter link description here

Also note the name of the wallet (Electrum) and the version, master key fingerprint, and date it was created. I'd also note the approximate block number, but that can be looked-up if you have the date. Some wallets like Electrum do NOT use BIP39 to generate the seed phrase. I have met people who have a seed phrase, but forgot the name of the wallet program/app because it was many years ago. Now they are trying to recover the wallet and the wallets available today are rejecting their seed phrase. Knowing which wallet was used would help them a lot, in addition to derivation path, etc.

You are describing a cold storage Account-Wallet, secured by a BIP39 Seed Recovery Phrase, (aka mnemonic phrase + passphrase) to allow regeneration of the seed.
That MAY be all you need to recover your assets in cold storage assets, using any BIP39 etc compatible Wallet-Client.
Of course, your Seed and mnemonic phrase (+passphrase) must be generated according to the BIP39 standard. This is not to be assumed with Electrum, whose creator hates BIP39 with a passion and has adopted other nonstandard systems for seed / mnemonics.
I suggest an amnesiac and airgapped Linux Live boot PC using the iancoleman tool and dice rolls myself.
Or a Hardware wallet, which can then later be reset to service your hot account wallets.
Obviously your SRP is the "key to the kingdom" - do not rely on memory, nor choose any words yourself! Use a true random (high entropy source) method to generate all of them. See EFF DiceWare notes to ensure a strong passphrase or perhaps just generate another 12-word mnemonic for that.
I recommend then etching to multiple stainless plates distributed to multiple secure locations, mnemonics separate from passphrase.
As to derivation path, if you
stick to BTC only, and
accept the standard path(s)
and the default Zero Account#, and
use the addresses auto generated, without skipping past say 20 of the unused (google gap limits)
Then any modern BIP39 compatible wallet-client should find all your assets as part of the account wallet (seed) recovery process, even many decades in future.

The seed is supposed to be a backup to your offline storage rather than your primary storage, so you're reducing your storage security.
You're also limiting your ability to access your funds quickly.
But if you know that you don't need to access the funds and you're happy about where you'll keep your phrase, there's no reason you can't do this.


text:
Seemingly random transactions on testnet
I'm testing my bitcoin marketplace site using testnet. Sometimes I'll simulate a payment from a buyer to a seller. In this scenario, my site generates a payment address and the fake buyer is supposed to send money to it. But before I do anything, a mysterious payment will be sent to the address and cause the payment to be partially or fully paid.
I'm not sure if this a bug with my site or the nature of testnet. Here's one such transaction: https://live.blockcypher.com/btc-testnet/address/miX7hFUHPciQaUC2QR88BMCUaR18aH2857/
I'm not an expert on blockchain but it seems like someone sent 0.68885375 BTC and the change valued at 0.00059542 BTC ended up going to my address instead. Why does this happen? Isn't the change supposed to go back to the sender?

Testnet is generally pretty noisy, filled with strange transactions and nonsensical movements of money. I personally hold wallets responsible for 20%+ of all transactions in the block chain, and most of the UTXOs. If you want a stable environment regtest is designed for testing your tooling without the noise or needing to wait for blocks.


text:
Conflicting transaction info on Blockchain.info and Jaxx compared to other sources
I sent a batched transaction with 3 inputs pointing to the same output address. The receiver claims they only received 0.00042 BTC when they should have received a total of 0.00128615 BTC.
She is using the wallet Jaxx which shows the amount received as 0.00042 BTC. Also, the "Estimated BTC Transacted" field on Blockchain.info shows a similar value 0.00042815 BTC.
However, Block Explorer shows the correct value 0.00128615 BTC.
So is this an issue with how I constructed the transaction or is it simply a display issue in both Blockchain.info and Jaxx?
I suspect that maybe the blockchain explorer is confused by the fact that I batched several different inputs to the same output address.

Your transaction is fine, and she should have received 0.00128615 BTC.
There is likely some confusion since not only do you have multiple inputs, you also have three outputs going to her address. They add up to 0.00128615 BTC, but each individual output is around 0.00042 BTC. It is possible that Jaxx shows her these as three separate line-items, leading her to believe you only sent 0.0042.
The explorer is not going to be confused by multiple input/outputs, they are a common part of Bitcoin. The estimated BTC transacted about is blockchain.info's best guess at it, and should not be taken as a fact. It is often wrong.


text:
Can low-cost purchases be accepted safely with no confirmations?
From reading online, the general sentiment to this seems to be "no". You need at least 1 confirmation to prevent a double spend attack.
But in Mastering Bitcoin, there's this note:

A common misconception about bitcoin transactions is that they must be
  "confirmed" by waiting 10 minutes for a new block, or up to 60 minutes
  for a full six confirmations. Although confirmations ensure the
  transaction has been accepted by the whole network, such a delay is
  unnecessary for small-value items such as a cup of coffee. A merchant
  may accept a valid small-value transaction with no confirmations, with
  no more risk than a credit card payment made without an ID or a
  signature, as merchants routinely accept today.

Is this correct? I'm running an e-commerce platform where sellers typically set item prices in the range $1-$5 and I'm debating whether to allow zero-confirmation payments.
I can understand the rationale for a cup of coffee but with virtual items online, an attacker could try to double spend on many cheap items simultaneously.


text:
Build a wallet for Android and iOS for a self-made cryptocurrency
I've built a cryptocurrency of my own using this video guide. I did the first 4 steps out of 6, as the 5th level is about building a wallet for Windows platform.
I have started creating this cryptocurrency so it would be able to trade using it only on mobile devices running Android and iOS. Right now I would like to start to develop it for Android platform.
My question is how can I create a wallet for Android using Java that will support my self-made cryptocurrency? By wallet I mean to store the coins, send and receive them, and ability to open new wallets.

You first should learn how to create an android app if you don't know how to do that already. There are lots of resources available for this and better places to ask questions than the bitcoin stackexchange.
Then once you are comfortable with that most android wallets are built using bitcoinj. I don't know of any nice step-by-step guide. Here is a sample github project for bitcoin that should give you a good starting point. https://github.com/thinkmobiles/BitcoinJ-Wallet-Sample-Android. I don't know anything about your coin but you will obviously need to make some fairly critical changes.


text:
Validation methods beside POW etc
Are there other concepts for the validation of the next added block to the blockchain beside POW, POS etc.?
Of cource there are, but is there a methode that is shining out of the mass?
A methode that can be a future mechanismen better than the current ones? That needs alot less electricity etc. to validate blocks?

None that is secure in a decentralized environment. Only PoW is secure.


text:
Framework for designing Blockchain (in combination with secure multi-party computation)
I'm looking for a framework where I can build my own blockchain. In my case I wan't to combine the blockchain with secure multi-party computation algorithm.
Means that two or more parties want to exchange data without revealing the input data...
are there any good framework you can recommend? (Free or academic access etc.)
I found Openchain and Nstratis... maybe there are better ones?
Thanks in advance.

You may find hyperledger fabric useful for your purposes : Hyperledger Fabric


text:
Attacking Blochcain/Bitcoin by hash
Assuming that SHA-256 is not save anymore. How could the Bitcoin blockchain get attacked? Ok I could get the input value for the hash function but could I now easily add my own blocks to the chain? I'm currently confused why there are theses hashes used...
How long would it take to attack the hash now, with a working SHA-256. Could you provide me a calculation with GFLOPS or something?
best regards

i can not calculate gflops  but...
some easy thoughts:
if sha2 is not safe anymore you can not easily steal bitcoin from an existing address by calculating the private key from any address because to generate the address ripemd160 is also used. and you did not assume that ripemd160 is also not safe anymore.
if everyone would know sha2 is not safe anymore then bitcoin will be worthless because everybody can mine without doing any work of the proof-of-work-process.
if only the attacker knows how to calculate the input of an sha2 function, an intelligent attacker would not attack the system. he would use the system:
the easiest way to make money when you can calculate nearly arbitrary sha2-hashs with nearly arbitrary input: mining. you can mine blocks and so you can earn 12.5btc several times every hour (furthermore you earn the transactionfees) without paying many money for electricity because you don't need to "work" in the sense of proof of work anymore. the advantage: you do not destroying the system because no one can really realize that you can "hack" the system and so you could theoretically earn many bitcoins.

Sha256 is used to calculate bitcoin address from

Breaking SHA256 would break many of the cryptographic mechanisms that secure bitcoin, but if such a situation were to arise, the network could fork to use a new, secure algorithm. Bitcoin’s current implementation depends on SHA256’s security, but in general any other algorithm could be used if users so desired.
In a broader sense, cryptography is a field that is constantly evolving, an ongoing race between the cryptographers, and the hackers that are trying to break cryptographic systems. Before SHA256 there were other algorithms used to secure important systems, and some of those algorithms have now been broken and discarded. Did it cause those other systems to become worthless? Not necessarily, it just meant there needed to be a change in their implementation, in order to remain secure.

downvote: "the network could fork to use a new, secure algorithm" wrong. because: sha2 is used to calculate the address from a public key. you can not switch this algorithm because all (!) private keys would have another new address. sha2 is also used to generate new blocks. so if the hash-algorithm for mining will be changed the miners can not mine anymore because their hardware can only mine with sha256. bitcoin would lost approx 99.999% of the hashrate (!) and every quickly attacker can easily do a 51% attack until all miner have new mining hardware (if they buy it ever).

Hmm good point about the address system! I’m going to think on that, are there any good existing resources on it? Re: mining: to ensure a sufficient level of security the algorithm would need to be changed to something that could have a sufficient/distributed hashrate available right away. Other types of ASICs exist, they may not add up to as much hashrate as sha256, but if sha256 breaks then they will become ‘the most secure option available’. I don’t agree that a 51% attack will immediately become a huge issue at that point, and network difficulty issues could be dealt with in the fork.

Re: address generation: breaking sha256 would be an issue for keeping public keys secure (given a particular address), but the private key would still be secure (ECDSA is used to generate pubkey from private, not sha256). So as long as privkeys are secured, the fork code could be written to check an address generated by the new algo against what would be expected by the old algo. I think it would be more complicated, but technically possible.


text:
How can a closing transaction in LN have more than 2 outputs?
I collected some data regarding closing transactions of channels in LN and I see that a small percentage of them have more than two outputs. How is this possible?
An example of such closing transaction type:
1235c0196785ea2e538fb5f3e45caeb17fc457c089a9f4a4bb01f1221539159a

There are 3 ways to close a channel.

The good way: mutual close
The bad way: force close
The ugly way: revoked close with penalty transaction

In the good case the closing tx should have 2 outputs as you expected. In rate cases even just 1 output.
But in the other two cases a version of the commitment transaction is published. The commitment transactions has additional outputs for pending htlcs that are not settled or timed out yet. So if the channel was routing funds and a force close or protocol breach is happening we can see more than two outputs.

Can we have output addresses in the bad/ugly way that are not controlled by the two nodes, but by a third party?

theoretically yes. have a look at upfront_shutdown_script defined in BOLT 02 in the open_channel message


text:
Getting a Private Key
1) When is a Private Key generated?
2) Where is it generated?
3) Where is it stored?
4) How do I use the Private Key to release funds from 'non-spendable' status

Non-spendable funds are simply funds that are not yours. Anyone who is telling you that funds are both yours and non-spendable is scamming you and you should stop talking to them.
The process of generating the private key takes place when the owner of the wallet creates the wallet. If you don't have the private key, it's not your wallet and anyone who is trying to tell you otherwise is trying to scam you.


text:
How is a transaction created?
( I have almost no background of coding, so please explain this in relatively easy words :) )
I want to know what are pubkey script, signature, full public key and the roles of these.
Specifically, I want to understand this diagram:

Here is how I understand this diagram;
Say, A wants to send 1btc to B.
Then, A gets something called Pubkey script from the most recent block in a block chain (Let’s call it PubkeyScript 1). Again, A uses something which is also called Pubkey script using the public key of B. (Let’s call it PubkeyScript 2) After that, A types a message “A sends 1btc to B”. Now, using A’s private key, convert the PubkeyScript1 to something called signature. Now, a chunk of signature and A’s public key and PubkeyScipt2 and the message “A sends 1btc to B” is called a transaction.
Am I understanding it correctly?

I try to explain it, that no coding is required :-) Taking more of a process view...
Assembly and sending of a tx:
the wallet software of A looks up it's internal database, if there is a transaction with required amount of 1 BTC on it. If yes, it then looks up this transaction's details in the blockchain, and finds in this transaction the pk script (spending condition), and assembles a new transaction, which shall move the funds to B's address. The wallet software then signs a hash of this transaction. The signature of this hash and the public key are placed in the [scriptsig] field of the transaction. So the final transaction contains the previous tx hash, signature and pubkey, and also an output section, with a pub key script (for B's  target address) and the amount. That's what the picture shows.
The transaction is then sent to the network.
Transaction Verification:
In the network are verifying nodes, that check for validity of the tx. Amongst others, these nodes check that you have the right to spend the funds. They take the current tx' sigscript (<signature> and <public key>), and from the previous tx the output script (pubkey script). Then basically two comparisons take place:

1.) can the public key of the previous tx' sigscript be hashed to the same value as the presented hash in the current tx' pubkey script?
2.) is the signature a valid signature for the public key

With the first check, it is assured, that the current transaction moves the funds to the previously defined target address. And with the second check it is verified, if the signature aligns to the presented public key.
For the second test: the wallet software creates a signature, which requires the private key of the owner of the public address. The private key is used to sign the hash of the current transaction.
The picture you provided has a presentation of the parts to create the spending tx. Not the verifying part. That makes it a bit more complex to derive functionality... I had a very good reading with Ken Shirrif's article here:
http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html
and also (of course) Andreas' book "Mastering Bitcoin" (Second Edition), which is also online available.

Some of your understanding is not entirely correct. I will explain it with a series of question

What exactly is a transaction? What are its components?

A transaction is a statement of transfer of value from one account(e.g Alice) to another account(e.g Bob). In bitcoin to transfer an amount, x Alice needs to first prove to the community that she has at least x amount with her. This proves in bitcoin is achieved by showing the whole community a previous transaction where Alice has received x(or more) amounts. Observe that it is even possible that Alice has received x amount from multiple transactions combined in which case Alice needs to give a list of the previous transaction which is called as inputs transaction.
Assume that if Alice has B bitcoins where B is greater than x, then Alice needs to send the change amount back to itself and x to bob. Alice can form this list out all the receiver's address with the corresponding amount which is called as outputs of a transaction.

What are Pubkey Scripts in the diagram?

Bitcoin and several other cryptocurrencies provide us with an option to mention some conditions under which a transaction can be spent. Pubkey Scripts are nothing but these conditions. Example of Pubkey Scripts is "Only Alice is allowed to spend this with her signature", under which case Alice needs to show a legitimate signature to spend the transaction.
In your case, PubkeyScript1 contains the condition under which Alice is eligible to spend the transaction and PubkeyScript2 contains the condition which bob must satisfy to spend the transaction.

What is “txn”? {}{}{}

"txn" is the short form of transaction. It is very standard. apologies.


text:
Can lightweight wallet users exchange money?
Instead of downloading full block chain, lightweight (SPV) users only download blockheaders of the blockchain.
This makes SPV users to check if transactions are confirmed or not. However, can SPV users also exchange money without being full nodes? That is, can they create a transaction and send it to nodes?

Instead of downloading full block chain, lightweight (SPV) users only download blockheaders of the blockchain.

Not all thin client are doing it.

Can the *SPV clients create a transaction and send it to nodes?

yes, they can create a transaction. The example of thin client is Electrum wallet.
Electrum fetches blockchain information from Electrum servers, bitcoin nodes that index the blockchain by address. Electrum performs Simple Payment Verification to check the transactions returned by servers. For this, it fetches blokchain headers from about 10 random servers.

* SPV - Here is lightweight client


text:
The role of timestamp
In Satoshi’s original paper, it is written that “we need timestamp to prevent double-spending”.
However, I think timestamp is unnecessary, because every block has a previous block hash and merkle tree root and these are enough to check if a transaction contained in a block is double-spending or not.
I think timestamp is just used to gurantee the current ‘difficulty target’, and I found posts here that it is even possible that a successor of a block can contain a timestamp which is earlier than that of the predecessor.
Am I correct? What’s actually the role of timestamp?

The timestamp is used primarily for establishing the difficulty. Without a timestamp, new nodes would not be able to determine the correct difficulty to be used for each 2016 block period as they wouldn't know how long it took to mine those blocks. So that everyone calculates the difficulty correctly, the block timestamps are used instead of real time.
This of course means that the difficulty can be manipulated by miners messing with the timestamp, but nodes do still check them against real time and will ignore blocks that are outside of a certain range of times based on its own internal clock time.

I do not know how other blockchain does it but in our case (stamping.io) the timestamp helps us so that all the nodes can obtain the same merkle tree, so that the same root hash can be achieved.

Your answer would be better if it addressed the Bitcoin blockchain, but I think it can be helpful even if it's only about the project you're addressing.  It needs to be improved so that it really explains the role of the timestamp.  For example, How does the timestamp enable all nodes to obtain the same merkle tree?


text:
Am i been scam or should i pay?
I was contacted on social media. He was going to mine 200 btc for me and I get a profit of $4870. He told me to create a black chain account but we never use it. Instead when I bought the btc he send me a link to put it in for it to be mined which I did . However when it was te to withdraw money I was told I need to make a deposit of 1200 to get the money by Trust Markets • trustmarkets2471@gmail.com which I refuse to pay am I right not to pay?

This is certainly a scam. Do not send them any money. They were never going to give you anything.

"If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck." Yeah, it's a scam.


text:
How will a common guy use Lightning Network when BTC hits 10 mln$?
If BTC hits 10mln$ and transactions fees will be horrendous denominated in $, how a "common guy" will be able to opt in using Bitcoin, if even opening LN channel will be too expensive then since it requires on-chain payment? As I understand the only way for him would be to rely on third party which would'nt be very different from using a bank.

Also see this related question: https://bitcoin.stackexchange.com/q/87843/5406

I assume that people will have more refined ideas by the time this would actually appear on the horizon, but here are some ideas:

channel factories
Custodial Lightning Wallets, i.e. "Lightning banks"
atomic swap from a payment focused sidechain
purchasing spendable LN balance on other users' Lightning nodes via macaroons that permit spending a specific amount

Or more generally, I suspect that people would develop third layer solutions that permit multiple users to share Lightning Network channels effectively.


text:
Main wallet unspent transaction
I have a question about an unspent transaction, we know that after some transactions we have a change address created by the main address, now imagine that Bob mined 6 BTC, now he transferred 2 of the two Alice and now in Bob's change address there is 4 BTC and they are unspent, now the question is that if I try to get unspent transaction of the main wallet with bitcoin core that I imported the address of Bob's main wallet, will it show me 4 BTC? or it can show if I try to get with child address?
Another question is that, is there any way to find a parent or main wallet, child keies?

All wallets will calculate and show the same amount as the "balance" for an address. In your example, all wallets would show the balance as 4 BTC. There are exceptions if a wallet is faulty or is not synchronised (not up-to-date, doesn't yet know about latest transactions).
If you import an address into a wallet, it will show the correct balance but it will show that amount as "watch-only" or "non-spendable".
There is no way to discover private-keys from addresses.


text:
Found old 'key' to bitcoin wallet but don't know which wallet?
I was searching through my email today and I think I found a bitcoin private key from 2013. I think it's a BTC private key because I bought 1 BTC that day. It's 33 letters long but I don't know the wallet it's too! Can someone help? Thanks

I think I found a bitcoin private key

So far as I know, a private key is 64 characters long in Hexadecimal (a mix of digits 0-9 and letters A-F only) or 51 characters long in WIF/Base58 (which includes a mix of any uppercase and lowercase letters as well as digits). There's also a mini format that is 22 characters long.

It's 33 letters long

That's likely to be an address. If it starts with a 1 or a 3 then it is almost certainly an address.
You can't recover control over money if you only know an address.
If you are sure you have an address and not a private key, you can safely enter the address into any blockchain explorer to see if there is unspent money at that address.
Obviously you should never enter a possible private key into any website.

from 2013

In late 2013 BIP39 was published - which defined seed-phrases (also called recovery phrases or backup phrases). These consist of a list of 12, 18 or 24 words from a standard list. If you have a set of such words you may be able to use it to recover control.
If I remember correctly, at least one wallet, Electrum, had a different seed-phrase system earlier (maybe a year earlier). So if you find 12 random seeming words, you could try them in Electrum.
Many people startr in Bitcoin without finding out about custodial and non-custodial wallets. If you had an account with a custodial service, you might have old email that might help you recover access to money in and account with some business. However quite a few such businesses are no longer around.

Thanks for the answer. It doesn't start with a 1 or 3. It's not a address. It doesn't have any numbers in it. It's all CAPS?


text:
Do miners verify address checksums?
I understand how the checksum included in Bitcoin addresses can help prevent someone from sending coins to a wrong address. Or at least make it highly improbable.
And I read in answers to another question Stackoverflow about how compliant Bitcoin clients will verify the checksum and prevent you from sending to wrong addresses.
My question is, does a compliant mining software also perform this check when validating transactions?
Thanks!

No. The address in the format you're used to seeing it isn't encoded like that in the transaction.
When you send a Bitcoin transaction to someone, your wallet will verify that their address is formatted correctly by validating its checksum, then it decodes the public key hash or script hash that is encoded in the address, and this hash is what is included in the transaction output. The purpose of the address checksum is just to prevent typos; it is not included in the transaction itself.

Thank you!! I was in a presentation where they said when you send bitcoin you use addresses instead of public keys to prevent exposing public keys (apart from the error detection and easy of entry benefits) ...since a future quantum computer could derive private key from a public key. And for similar reasons after you send from an address, you move rest of the coins at that address to another address...since your public key is revealed when you send coins. Would you be able to comment to that, thanks! Also feel free to point me to any docs. Much appreciate the help :)

@septerr Right! The actual public key is not revealed until you spend from that address. The address is just a hash of the public key along with a checksum. When you send to an address, your wallet decodes the address into the hash and its checksum, the checksum is stripped off after being validated and the hash itself is included in the transaction.

@septerr Here is an question/answer about the (IMO, alleged) benefits of hashing public keys: https://bitcoin.stackexchange.com/questions/95123/what-are-the-potential-attacks-against-ecdsa-that-would-be-possible-if-we-used-r/95133#95133


text:
How to go about performing invoice generation / payment processing with lightning network?
I am interested in implementing a micro-transaction "paywall" that will allow anonymous users access to a web application that I am building.  Each unique visit to the home page of the application would trigger an api call that will generate an invoice for that specific session and present the user with a QR code for them to make a payment that will grant access for that particular session.
My question is, how many invoices can realistically be monitored with SubscribeSingleInvoice before this would be a problem?  Like if 100,000 people simultaneously visited the app, that would be 100,000 unique invoices generated and subscribed to...  Which seems like that could be a bad scene...  Though I would be setting these invoices to expire some-what shortly, like 5-10 minutes, assuming if they haven't paid within that time frame, they're most likely not going to be paying at all.
Are there any good tutorials to recommend for setting up a paywall like this?  I have been googling and googling and not really finding anything useful......  And the lightning documentation is a bit vague and lacking specifics.
Also, a side question is, to do this, is it really necessary to run a bitcoind backend?  I was reading about neutrino, and saw LND lets you use that as a backend..  Since I am only interested in generating invoices and microt-ransactions and detecting when they have been paid, is it possible to use neutrino for this so that my app can have less of a heavy infrastructure footprint?

Are there any good tutorials to recommend for setting up a paywall like this? I have been googling and googling and not really finding anything useful...... And the lightning documentation is a bit vague and lacking specifics.

No because there is no a good implementation that ship the right API for this use case, I am sorry!
I will put here the idea and maybe you will implement for your implementation (if you are working with core lightning you can ping me to chat about).
Basically, you need a "subscribe" mechanism that it is not blocking, so you generate an invoice with a Post request but you listen to the event over a ws.
So a single ws channel that streams to you all the events of a particular invoice that was paid or not.
This with a core lightning plugin is very trivial but no one was able or interested to implement it (I do not know if cln-rest is doing somethings like this I did not review the PR that get merged but the suggestion that I gave was this one too)


text:
Recovering a Ripple wallet on Ledger Nano
I have 20 XRP in a Ledger Nano and before I load everything onto it I want to test the recovery procedure so I am prepared in case something goes wrong down the track
I have read the material here on the Ledger documentation but it does not elaborate on how it recovers the keys for the apps you have installed - in this case XRP.
Ideally I would also like to generate my public and private keys as described here and store them somewhere safe - but again it does not elaborate on the keys for altcoins.
Thanks in advance on any guidance!

Ledger should recover all your funds including any altcoins like XRP from your 24-word recovery phrase. You may read technical details about the process in BIP44.
I'm not sure whether there is an official Ledger tool for deriving keys for XPR from recovery phrase. You may use Ian Coleman's BIP39 Mnemonic Code Converter. It is possible to launch this site on the offline computer if you worry about keyloggers.
You may also find this discussion on Reddit interesting.


text:
send to online wallet ie spend bitcoin from cold paper wallet ,without losing the remainder
All the answers I see here are just confusing me. What is a ' client '? Is it me, my computer, my online wallet, the person selling to me or buying my bit coin or what ? I just want to know how to send bitcoin from paper wallet to online, to spend, and what to do to avoid losing the change remaining  in   the paper wallet. I GUESS it is like this...empty the paper wallet to an online wallet. Pay the other party by sending off bitcoin. Then make a new online wallet - must I  ? Put the remainder bitcoin  in there Make a new paper wallet.Send remaining coin back to new paper wallet. Sounds simple? But I have NO IDEA about how to use the private and public keys. Do I have to make a new private key for every step in the above ?

Client normally means the wallet
You don't need to give money to someone to make you a wallet. There are many free wallets like electrum , greenwallet, coinomi which create a address for you and also make you the owner of your private keys
You also don't need to send the money from your paper wallet . If you are able to destroy you paper wallet safely , you can sweep the bitcoin from your paper wallet to coinomi wallet .
No need to make a new private key every time .


text:
How do we know that a user owns multiple private keys?
I am reading a data analysis paper on bitcoin, and there is a phrase I do not get:

We use the Bitcoin transaction data set obtained from Stanford Network Analysis Project. All Bitcoin transactions are documented in a public ledger and are in the currency unit called the Bitcoin(BTC). The data set contains all Bitcoin transactions beginning from the network’s creation until April 7th, 2013. For each transaction, there can be multiple sender and receiver addresses. Furthermore, multiple addresses can belong to a single user.

I do not get this last sentence. Yes, surely a user can create multiple private keys. However, how do we know that a user created multiplie private keys if we are not that user?
The dataset given in this paper is very large (6,336,769 users), so they must apply some algorithm to group private keys belonging to each user. What it would be?

I've deleted my answer as I'm clearly missing some context. Perhaps it's useful to add the link you comment to your question?

There are multiple articles available in internet which contain that paragraph. For example: http://cs229.stanford.edu/proj2014..., https://arxiv.org/pdf/1611.03942.pdf, etc
Each one seems to attribute the origin of the data to different sources, but the numbers act as a fingerprint (6,336,769 nodes and 28,143,065 edges), so it can be traced back to a work by Ivan Brugere which seems to have been available in the past, but not now, at compbio.cs.uic.edu, and from which some docs remain at github.
From them he refers to the work "An Analysis of Anonymity in the
Bitcoin System" by Fergal Reid and Martin Harrigan:

Suppose U is, at first, incomplete in the sense that each vertex represents a single public-key rather than a user and that each directed edge between a source and a target represents an input-output pair of a single transaction, where the input's public-key corresponds to the source and the output's public-key corresponds to the target. In order to perfect this network, we need to contract each subset of vertices whose corresponding public-keys belong to a single user.
... as noted by Nakamoto:
"Some linking is still unavoidable with multi-input transactions, which necessarily reveal that their inputs were owned by the same owner. The risk is that if the owner of a key is revealed, linking could reveal other transactions that belonged to the same owner."

And closing the argument, in an extensive work covering the same dataset:
Analyzing the Bitcoin Network: The First Four Years - Matthias Lischke and Benjamin Fabian, Institute of Information Systems, Humboldt-Universität zu Berlin, Spandauer Str. 1, 10178 Berlin, Germany (CC BY 4.0):

The user information is organized by the second group of files [...], where a “user” is a grouping of public keys that were used as inputs into a single transaction (user owns the private key to each address) as proposed by Reid and Harrigan. Each line [...] is a grouping of public keys as illustrated in Figure 3:

However, how do we know that a user created multiplie private keys if we are not that user?

We can't. User can create keys using any computation mechanism(pen & paper, abacus, etc.). Protocol is one-party and does not need any third-party(website, server, etc.)

some algorithm to group private keys belonging to each user. What it would be?

Usually, they first apply Union-Find graph algorithms. After they do some analysis at this stage, they assume that in this reduced entity graph, all inputs to a transaction belong to the same entity. This was maybe true early-on in history of bitcoin, but joining coins is pretty common now. Receiver associated with certain senders only are created as self loops etc. The entity graph is kept on reducing, applying transitive, commutative, associative etc. closure on it and studied.

I will try to answer this, though not sure about the extent of it being held true.
It says:

Furthermore, multiple addresses can belong to a single user.

It says "can" not "must"
Let me say this with an example.
There are say 5 transactions with transaction ID as: trans1, trans2, trans3, trans4 and trans5
The addresses involved are addr1, addr2, addr3, addr4, addr5, addr6 & addr7
Initial Balances:
addr1: 1 BTC
addr2: 2 BTC
addr3: 1 BTC
addr4: 0 BTC
addr5: 0 BTC
addr6: 0 BTC
addr7: 0 BTC
Transactions occured (considering negligible fees):
trans1: addr1 (1BTC) > addr6 (1BTC)
trans2: addr2 (2BTC) > addr5 (2BTC)
trans3: addr3 (1BTC) > addr4 (1BTC)
trans4: addr4 (1BTC) & addr5 (1BTC) > addr7 (2BTC)
trans5: addr5 (1BTC) & addr6 (1BTC) > addr7 (2BTC)
Final Balances:
addr1: 0 BTC
addr2: 0 BTC
addr3: 0 BTC
addr4: 0 BTC
addr5: 0 BTC
addr6: 0 BTC
addr7: 4 BTC
Now considering transaction trans1, trans2 & trans3 to have occured due to some payment settlement. And that gives us no clue whether these receiving addresses are held by a single person or not.
Whereas for the transaction trans4 & trans5 to have occured, the user requires the private key of address addr4, addr5 & addr6. Thus giving us a hint that this "can" (not must) belong to a single person.
Another assuring thing about this belongs to a single person is, these converges to a single address, i.e. addr7. Though this might be someone else, and might be another payment settlement.
Thus, the data analysis paper says:

Furthermore, multiple addresses "can" belong to a single user.

From what i know from what your asking, a person was able have multiple address if they make multiple of it or have a wallet which keeps multiple address in one place.

Comment if this is not what your looking for because I'm bit unsure what your asking


text:
Does a user have to update blockchain to participate in this situation?
Say a node was offline for a week. After one week, when this node becomes online again, this node has a blockchain which is shorter than the current blockchain.
If a miner sends block to this node, this node will start to compare this block to his blockchain. However, because this node was offline for a week, this node will determine that the newly created block does not match with his blockchain and conclude that this block is false. So I think this node must be updated to the current version of blockchain and then participate.
Am I understanding correctly?
Thank you in advance.

Yes your understanding is correct, the node must update itself with the blocks generated and accepted after it went offline(in your case about a week ago).
Whenever a node receives a new block, it first looks at its header called blockheader which contains the following:
1.Version (32-bit version the node that mined the block was running).
2.Hash of the previous blockheader
3.Merkle root of transaction
4.Timestamp (approximate time of generation of block)
5.Target for block mining puzzle
6.nonce (solution of the puzzle)
To verify a new block each node computes the hash of the previous blockheader and checks for proof of work. In your case the hash of the previous block-header will not match, so the received block will be considered invalid. Also, the timestamp included in the newly received block will be far ahead in future form the last known block of the validating node which will indicate(not explicitly) that the node was out of date for some time.
To come back in the mining game, the recovered node has to query few up-to-date nodes for all blocks generated after the failure time, apply these new set of transactions to the obsolete blockchain, update the UTXO as per required.


text:
PSBT signing safety checks
I'm working on a multisignature cold storage wallet that adds several features to the Glacier Protocol wallet, namely PSBT support through bitcoin-cli's RPC interface. The wallet intentionally uses a very restricted portion of the PSBT standard in order to make the code as short and easily auditable as possible. I define a function validate_psbt() that aims to exhaustively check whether or not a PSBT is safe for a user to inspect and sign:

A user inputs the M & N policy, 1 xprv and N xpubs at the start of the signing process
The only valid wallet addresses are wsh(sortedmulti(M, [xfp_1]xpub_1/change/idx, [xfp_2]xpub_2/change/idx, ... , [fp_n]xpub_n/change/idx)) where change in {0, 1} (i.e. derivation paths for each xpub must be the same). Only using segwit addresses should prevent signing inputs that overspend fees for example.
The wallet only allows users to sign transactions that spend their own inputs.
To be considered change, sufficient metadata must be provided for output at idx, which the wallet uses to calculate an address cross-checked against the address in the PSBT's tx.vout[idx] field.

Are there any missing validations that need to be performed in this process to ensure that a maliciously created PSBT doesn't pass the safety check, letting a user unknowingly sign away / lock up her bitcoins?


text:
Does, or will, Bitcoin Core support Lightning?
I vaguely understand what Lightning is, and would like to take advantage of it. However, actually using it seems extremely "fuzzy".
If it requires some separate software to be trusted, installed, configured and maintained, then I'm afraid it's off the table for me.
I already run Bitcoin Core. Will that get built-in support for Lightning? Or maybe it already has it?
I'm very worried that potentially large fees will prove a major obstacle in front of potential paying customers who don't want to spend so many satoshis just to make such a small payment to my service. I wouldn't want to pay the same amount in fees as what the service costs, myself. That's why Lightning appears to attractive to me, regardless of the speed.
If this thing is going to remain an "add-on", which you need to separately worry about and fiddle with, I'm afraid it will go the way of the Sega 32X or Mega CD. I really hope that's no longer the case, or at least won't be for much longer.

A sketch of Lightning Network support was previously proposed to Bitcoin Core.
Conceptually, most contributors think it is outside of the scope of the Bitcoin Core project which should be limited to be a robust backbone for the Bitcoin network.
Lightning Network implementations "on top" of Bitcoin Core already exist, the three most mature ones being C-lightning, LND and Eclair.
Given the complexity of the Lightning Network, specialized softwares are in my opinion required.


text:
How is a “reward” encoded in a block?
If a miner creates a block including an appropriate hash value, then he sends it to all nodes, and each node verifies if this is correct or not and add it to the previous block chain if this is chosen to be a correct one.
I read here that after 100 more blocks are added to the previous block chain (actually it is written that after 100 depths, but I think this means what I am saying here), a miner gets rewarded.
When a block is created, a miner puts informations like “I take 0.05BTC from transaction A for the mining fee” to get transaction fees. However, as far as I know, a miner get 12.5BTC newly created bitcoins in addition. How does a miner put this information in a block?

Both the block reward and the fees are collected via a "coinbase transaction", which is the first transaction in the block.  It has no inputs, and the total value of its outputs is allowed to equal the sum of the block reward plus all the fees from the block.  The miner can then set the outputs of this transaction to pay the total to their own address(es).
In particular, it is not necessary for the miner to explicitly list which fees are being collected from which transactions.  It's assumed that all fees from all transactions in the block can be collected, so this determines the allowable amount for the coinbase transaction.
The "after 100 blocks" rule is enforced by requiring that none of the next 100 blocks is allowed to contain a transaction which spends this block's coinbase transaction.  I guess it's a matter of semantics whether the reward "happens" with this block or 100 blocks later.


text:
How can I find a transaction on my Bittrex Ripple address with tag?
Bittrex didn't deposit the XRP due to some technical issues and now asking for transaction Id. How can I find the transactions on my Ripple address and tag that happened a few days back?
I tried looking up on Bithomp, XRP Charts, but nothing is that helpful. If there's an API which I can program, I can do that as well.
Please help, thank you!

I will put this question on a bounty, if you can even help with the list of transactions on XRP address and tag, I will be more than happy to give that bounty.

Bithomp now shows transaction hash (id), in the transaction block. You need to press on the orange i. The problem that is shows only first or last 200 transactions. You can use ripple api, to get the info as well.
https://ripple.com/build/data-api-v2/

Thank you, I was able to find this solution weeks ago. I am upvoting and accepting it for others to people to know about it as well :) thank you!


text:
How do I get Avalon Miner Temperature from console?
I am trying to read the temperature from my Avalon which has the Avalon Firmware: 20170603
I'm using the command:
cgminer-api -o stats
It brings me a lot of information that I don´t need.
root@OpenWrt:/etc# cgminer-api -o stats
STATUS=S,When=1482343577,Code=70,Msg=CGMiner stats,Description=cgminer 4.10.0|STATS=0,ID=AV70,Elapsed=30789,Calls=0,Wait=0.000000,Max=0.000000,Min=99999999.000000,MM ID1=Ver[7411612-6cf14b0] DNA[01313edbc5efabe3] Elapsed[30792] MW[340560 340538 340538 340538] LW[1362174] MH[180 238 259 216] HW[893] DH[2.749%] Temp[30] TMax[77] Fan[5430] FanR[90%] Vi[1201 1201 1202 1202] Vo[4438 4406 4443 4438] GHSmm[8063.47] WU[108083.46] Freq[715.86] PG[15] Led[0] MW0[1170 1302 1206 1250 1197 1312 1331 1262 1300 1216 1230 1281 1265 1273 1327 1291 1232 1231 1267 1292 1286 1203] MW1[1312 1189 1237 1251 1212 1247 1264 1275 1196 1256 1283 1257 1190 1247 1243 1282 1330 1315 1292 1273 1261 1271] MW2[1213 1262 1310 1202 1285 1220 1291 1267 1309 1307 1164 1212 1290 1289 1308 1174 1230 1276 1252 1189 1192 1242] MW3[1302 1275 1209 1307 1217 1294 1328 1273 1237 1256 1227 1239 1268 1242 1308 1314 1296 1314 1331 1324 1297 1190] TA[88] ECHU[512 0 0 0] ECMM[0] FM[1] CRC[974 0 0 0] PAIRS[0 0 0] PVT_T[4-70/0-76/72 0-69/11-76/70 2-70/0-77/74 20-67/0-75/70],MM ID2=Ver[7411612-6cf14b0] DNA[0132c3d0691693b9] Elapsed[30791] MW[340551 340551 340538 340538] LW[1362178] MH[2067 188 222 215] HW[2692] DH[3.629%] Temp[29] TMax[80] Fan[5490] FanR[90%] Vi[1204 1202 1201 1201] Vo[4461 4447 4420 4443] GHSmm[7887.76] WU[103670.36] Freq[700.26] PG[15] Led[0] MW0[1264 1270 1229 1313 1296 1184 1239 1237 1266 1247 1252 1242 1202 1266 1266 1317 1255 1272 1309 1230 1301 1243] MW1[1155 1159 1213 1196 1214 1154 1152 1213 1180 1180 1152 1193 1118 1122 1159 1173 1185 1193 1180 1161 1170 1175] MW2[1269 1138 1285 1180 1256 1210 1170 1299 1223 1185 1164 1132 1140 1225 1246 1173 1237 1212 1192 1284 1215 1205] MW3[762 1268 1187 1271 1277 1150 1202 1208 1172 1170 1176 1249 1177 1154 1197 1250 1176 1227 1268 1218 1262 1251] TA[88] ECHU[0 512 0 0] ECMM[0] FM[1] CRC[0 0 0 0] PAIRS[0 0 0] PVT_T[0-68/10-80/70 19-67/0-76/70 0-70/11-78/72 19-68/0-77/71],MM Count=2,Smart Speed=1,Connecter=AUC,AUC VER=AUC-20151208,AUC I2C Speed=400000,AUC I2C XDelay=19200,AUC Sensor=15483,AUC Temperature=28.17,Connection Overloaded=false,Voltage Offset=0,Nonce Mask=29,USB Pipe=0,USB Delay=r0 0.000000 w0 0.000000,USB tmo=0 0|STATS=1,ID=POOL0,Elapsed=30789,Calls=0,Wait=0.000000,Max=0.000000,Min=99999999.000000,Pool Calls=0,Pool Attempts=0,Pool Wait=0.000000,Pool Max=0.000000,Pool Min=99999999.000000,Pool Av=0.000000,Work Had Roll Time=false,Work Can Roll=false,Work Had Expire=false,Work Roll Time=0,Work Diff=65536.00000000,Min Diff=1.00000000,Max Diff=131072.00000000,Min Diff Count=12,Max Diff Count=18313,Times Sent=1531,Bytes Sent=228345,Times Recv=2668,Bytes Recv=1379612,Net Bytes Sent=228345,Net Bytes Recv=1379612|STATS=2,ID=POOL1,Elapsed=30789,Calls=0,Wait=0.000000,Max=0.000000,Min=99999999.000000,Pool Calls=0,Pool Attempts=0,Pool Wait=0.000000,Pool Max=0.000000,Pool Min=99999999.000000,Pool Av=0.000000,Work Had Roll Time=false,Work Can Roll=false,Work Had Expire=false,Work Roll Time=0,Work Diff=16384.00000000,Min Diff=4096.00000000,Max Diff=16384.00000000,Min Diff Count=374,Max Diff Count=993,Times Sent=109,Bytes Sent=12038,Times Recv=119,Bytes Recv=12214,Net Bytes Sent=12038,Net Bytes Recv=12214|STATS=3,ID=POOL2,Elapsed=30789,Calls=0,Wait=0.000000,Max=0.000000,Min=99999999.000000,Pool Calls=0,Pool Attempts=0,Pool Wait=0.000000,Pool Max=0.000000,Pool Min=99999999.000000,Pool Av=0.000000,Work Had Roll Time=false,Work Can Roll=false,Work Had Expire=false,Work Roll Time=0,Work Diff=0.00000000,Min Diff=0.00000000,Max Diff=0.00000000,Min Diff Count=0,Max Diff Count=0,Times Sent=2,Bytes Sent=151,Times Recv=3,Bytes Recv=244,Net Bytes Sent=151,Net Bytes Recv=244|

The answer is simple.
With the next command I can extract the values that I am looking for:
root@OpenWrt:/etc# cgminer-api -o stats | grep -oE 'Temp[^F]*Fan\[[[:digit:]]+\]'

I hate to necropost but I am in the middle of building a custom monitoring system for our company and had to deal with this exact problem. While I sadly can't release any code at the moment, there two values you are looking for: "Temp" and "TMax". "Temp" is the inlet temperature and "TMax" is the outlet temperature. At the moment my code just iterates through the JSON data looking for those strings with a regex and combines all the ones it finds into an overall controller average.


text:
Mining Every Last BitCoin?
I’m told that their is a total number of bitcoins that can be mined, 21 million bitcoins I’ve heard. I’ve heard that the more bitcoins that are mined there is a direct increases in the level of difficulty and in resources, required to mine more bitcoins.
I’ve heard many estimates from 10 years to 100 years to mine all 21 million bitcoins.
With the unknown variable of future increases in processing power, how could anyone make a educated guess as to how long it will take?
Additionally, if it is true that Moore’s law will be ending as we currently know it due to limitations in our current manufacturing methods of Processors, then this would lend even more weight to my theory that estimating the time of will take to mine all 21 million bitcoins is a guess, at best.
Please explain if I’m wrong and what I’m failing to understand about this, as I’m pretty new to crypto but eager to learn!
Cheers!

I’ve heard that the more bitcoins that are mined there is a direct increases in the level of difficulty and in resources, required to mine more bitcoins.

You have heard incorrectly. That is absolutely incorrect. The difficulty has nothing to do with how many Bitcoin have already been mined; all that matters for the difficulty is the average time between blocks for a sample of 2016 blocks.

I’ve heard many estimates from 10 years to 100 years to mine all 21 million bitcoins.

It is estimated that the block subsidy (which is what creates new Bitcoin) will reach 0 in 2140. The block subsidy will effectively be 0 long before that. It is impossible for all Bitcoin to be mined within 10 years as the hashrate required for that is too great.

With the unknown variable of future increases in processing power, how could anyone make a educated guess as to how long it will take?

Blocks are mined at a roughly fixed rate. The rate is fixed by the difficulty which adjusts every 2016 blocks. The difficulty adjusts so that it takes 10 minutes to find a block, on average. So if there is a massive increase in hashrate, the difficulty will increase as well so that blocks are still found 10 minutes apart.
Since we know how long it will take to mine blocks, on average, and we also know how many blocks it takes to mine all Bitcoin into existence (6,930,000 blocks), we can predict, roughly, when all Bitcoins will be mined.

You said: “impossible for all bitcoin to be mined in 10 years...as the hash rate required is too great” .....if in 5 years from now, GPU/CPU power has an exponential leap above its normative growth, then we could see a large jump in the currently known and currently predicted hash rate. Thoughts?

Mining all blocks within 10 years requires ASIC hardware (note that Bitcoin is not mined on GPUs or CPUs anymore) to have exponential increases in hash power daily, for 10 years. There are 315360000 seconds in 10 years, and 6421000 blocks to be found in that time. That means that blocks would need to be found every 42 seconds, on average. In order to reach that now, the hashrate would need to be ~14 times what it currently is now.

Then every 2016 blocks (so just over a day at 42 seconds a block) the difficulty will adjust. It can only adjust by a factor of 4 at most, so in order to counteract that, we need to quadruple the hash rate basically every day. That's pretty infeasible considering that new hardware needs to be built and setup, and then new technological enhancements need to be made to support that much computing power.

Appreciate the robust and informative response! I guess I’m set on the belief that a new idea will emerge taking us beyond GPU, and ASIC mining, creating a day in which ASIC is ancient due to its slow hash rate compared to the next evolutionary advance.

Great info, thanks for breaking it down for me. Cheers

Anything that comes after ASICs will just be "better ASICs". An ASIC is a generic term (much broader than CPU or GPU) that means "Application Specific Integrated Circuit" and any chip that is designed to mine Bitcoin (or do any other application) is, by definition, an ASIC. So unless this new advancement is not an integrated circuit (which I think is unlikely as it would mean a completely different method of computing which has no circuits), it will be an ASIC, just a better ASIC.

No? I don't think I have agreed with anything you have said.

Sarcasm, sorry!


text:
Antimer L3+ - Approximately How Many Coins In 30 days
I am about to receive one L3+ LiteCoin miner with
A hash speed of 4TH/s.
Approximately, how much litecoin could I
reasonably expect to mine in 30 days with my L3+
running at full operating speed 24/7, with unlimited
bandwidth up/down for my internet connection to
the miner? Approximately??
Thanks in advance for any response!

An Antimer L3+ could be making about 32 USD per Antminer per day. But the total over 30 days depends on a lot of things. If you take an average of 30$ over 30 days and bitcoin price average of 11,000, then you could make 900$.
Also, you need to include other things like a power outage, internet connection down, and hardware issues to be on safer side.
Let us know if this answers your question.

If mining litecoin; currently around $1100 per coin, would this influence the $900 value in 30 days you mentioned above?

According to the link I am using, you could get 97$ a day. But check the parameters are correct for calculation at https://www.coinwarz.com/calculators/litecoin-mining-calculator/?h=4000000.00&p=1000.00&pc=0.10&pf=0.00&d=3731199.18337428&r=25.00000000&er=0.01603501&btcer=11569.00000000&hc=0.00

Thanks for the info and the link to the calculator! Much appreciated.


text:
is there some one expert with the btc recovery tool?
trying to use btc recovery tool , installed every thing , python 2.7 and all the required pibs . followed tutorials . actually i need to find second password so am using the command i.e c:\python27\python btcrecover.py --wallet wallet.aes.json --utf8 --blockchain-secondpass
here it asks for main password , when i enter it ,,, it says wrong main password where i can enter to blockchain wallet using the same password . where i am going wrong ?

either you have the wrong wallet.aes.json or you have a v1 wallet. they (blockchain.info) seem to have used three different wallet encryptions and btcrecover only work with one.


text:
How wallets/ miners differentiate bitcoin and bitcoin cash (forks of cryptos)? (technical IT question)
I could not find the answer by web search. People usually interested in economic differences. I guess it is a question for those who know how mining algorithms works.
Internet is kind of decentralized. But there is single domain servers grid that tells where to find google.com. In a world of cryptos, how do wallets know where to send your BTC / BTC cash transaction? How to differentiate between forks? Is there some list of agreed gateways like for TOR? If so who administers it?

The protocol administers it.
Usually, one coin's blockchain will not be compatible with another's: for example, Bitcoin supports Segwit transactions, and Bitcoin Cash does not; whereas Bitcoin Cash has a high block size limit and Bitcoin does not. The point at which the two diverged is the point at which Bitcoin started mining Segwit blocks (which Bitcoin Cash clients will not accept as valid blocks, because they contain Segwit transactions), and where Bitcoin Cash started mining large blocks (which Bitcoin clients will not accept as valid). However, if there was a transaction that was valid on both blockchains (as may have been the case around the time of the fork), then that transaction can indeed be "replayed" on both blockchains, with both accepting the transaction.

I see. But how do wallets/etc find miners in general than? What internet address are transactions broadcast to?

@Martian2020 Your node will seek out other Bitcoin nodes, I believe first by querying a few DNS servers that will have known functioning Bitcoin nodes, then you'll be able to query those Bitcoin nodes for the nodes that they're connected to, so on and so forth, until you have sufficient nodes you're connected to. Then, you only stay connected to each node if the information they send you validates against the rules of the blockchain you're expecting (for example, if you're connected to Bitcoin nodes, you only stay connected to them if the blocks they send you are valid Bitcoin blocks).


text:
my unconfirmed transactions hold for over 1 day
I have following 2 unconfirmed bitcoin incoming transaction for one day, can you please advise how to speed up?
1Eg8thYVMBTpXg78FQo2sXhxeFdZWB9DjN
1D3grbjFXZWUp1wCApLTHQ9GAxsyyAawkU


text:
Mycelium - more than one unused Bitcoin HD account
Why can't I have more than one unused Bitcoin HD Account? What if I want to use a Bitcoin mixer that allows for 5 destination addresses?

You can have multiple addresses on one account.
Accounts are not a feature of the Bitcoin protocol, they are a feature created by some wallets to help you organise your money.


text:
Why is SHA-256 mining secure?
My understanding is the when you are mining bitcoin you are looking for a string, or maybe a binary number (a) such that if you 'add' a to the block (b) you get a number (c) whose hash begins with a bunch of zeros.
My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?
What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?

There are two very different questions you could be asking. When you say "to the same number c", do you mean the exact same number? Or do you mean some number with just as many beginning zeroes? Those are two very different questions that address very different types of threats and have very different answers.

I mean exactly the same number

My question is: Say I know that the message b 'added' with the number a gets mapped to my desired output. Why is it not possible for me, given a different block (b2) to find a corresponding number (a2), such that the hash of the result will map to the same number c?

It's not possible because there are 2^256 (approximately 1 followed by 77 zeroes) possible hash results. You would have to try an awful lot of possible values for a2 to find one that happened to produce precisely the same hash output. The stars would burn out first.

What is the operation that combines the block b with the number a that makes this impossible? Is it simple appending?

No, it is not simple appending. That would produce very, very long numbers. It's an operation that has three important characteristics:

It produces an output smaller than its input. This makes it irreversible because information is lost. You cannot reverse the hashing operation just as you cannot reverse addition. If I add two numbers and get 10, you cannot tell me which two numbers I added because that information has been lost.

A small change in the input produces large changes in the output. That is, changing a single bit of the input changes roughly half of the bits of the output, and it is not easily predictable which bits that will be. It mixes the input quite thoroughly to produce its output.

The output is long, 256 bits. As a result, brute force trial and error to get particular outputs is not practical.

You can read more on the SHA-2 family of functions (which includes SHA-256) here.


text:
Can one manually type the mined block on bitcoin core and broadcast it?
I get that all miners compete to find the block first, which is then broadcasted to other nodes who then verify it. But what spikes my interest is would it be possible to broadcast the block to the blockchain without a miner's software's help? Can bitcoin core work alone for mining purposes?

Yes. Bitcoin Core has a RPC submitblock, which, as the name implies, allows you to provide a block to be submitted to the Bitcoin network.
In fact, Bitcoin Core supports the getblocktemplate protocol which means you can solo mine with Bitcoin Core. Furthermore, pools are probably running Bitcoin Core in their backend and their pool software just uses the getblocktemplate protocol to get the transactions for a block and prepare the work that is sent out to the actual miners.


text:
Listunspent: "Solvable - False"
So i have retrieved an old wallet.dat file. When i open it in bitcoin-core i can only see the adress as an watchadress. I went to the console and typed - listunspent and this shows up.
I understand why the bits are unspendable due to the fact that it only shows as a watch-adress. But how is it possible that it says "solvable -false" since i accessed with the wallet? Am i missing something very important here?
"vout": 14,
"address": "-------------------",
"label": "",
"scriptPubKey": "----------------------",
"amount": 0.60790000,
"confirmations": 257190,
"spendable": false,
"solvable": false,
"safe": true

Bitcoin Core distinguishes between spendable and solvable.
Spendable means your wallet knows how to spend the UTXO (for example, it knows all the scripts it needs), and has all the private keys it needs to create and sign a spending transaction.
Solvable, on the other hand, only means the wallet knows how to spend the UTXO (it knows all the scripts it needs), but it doesn't necessarily know the keys, so it may not actually be able to spend it. If something is spendable, it is always solvable, but not the other way around. For example, if you import all the scripts and public keys for a P2SH address into your wallet, it will be solvable, but not spendable, because you don't have the private keys (they may be on a hardware wallet, for example).
So in your case, it is neither solvable nor spendable, because you don't have the private keys or scripts needed to even know how to spend.

Solvable refers to the wallets ability to create a transaction which could spend those funds. As it is a watch only key that has been imported, there is no possible solution which it could come to in order to spend that money.

Ok so i need the right key in other words to access the funds then?

Yes, a watch only import does not let you spend the money in any circumstance.


text:
What happens if everyone disconnected from the blockchain
What would happen if for some reason, every computer connected to the blockchain was disconnected, and no peer-to-peer connection was established with the blockchain protocol between 2 users.
Would all the transactions recorded on the blockchain be lost ?
Also what if theoretically only 1 or 2 connections remained connected to the blockchain, wouldn't it be easy for them to just add more transactions to the chain and everyone would need to trust their blockchain state since there is no other copy of it elsewhere*(or are they stored locally on devices even if they disconnect??)* ?

Computers are not connected to the blockchain.
Computers running Bitcoin software connect to a few other computers that are running Bitcoin software.
Each of these computers keeps its own copy of the blockchain if they are what is known as a full-node. For example any computer running the "Bitcoin core" wallet software is a full node. So even if they don't communicate, this blockchain data is not lost. The old transaction data is still stored on many thousands of computers.

No node ever needs to trust any other. Each node that has a copy of the blockchain can use it to check that new blocks are correct.


text:
Why is it impossible to get a straight answer as to whether Bitcoin is anonymous or not?
Yesterday, I asked a question which got linked to this answer: Is it true that all the bitcoins in existence are on the blockchain (the ledge), but it just depends on who the owner (address) is?
Judging by that, if I interpret it correctly, there's no way to track people on the Bitcoin blockchain. Okay? So what's with the constant pointing out about how "Bitcoin is a fully open ledger blablabla not anonymous by design bladiblableblablu everyone knows exactly who does business with who forever etc."?
I swear, I've probably asked this and similar questions hundreds of individual times over the years, in chat rooms, on forums, on here, etc. I've watched endless videos and read mile-long articles on the subject, I've thought really long and hard about it, I've implemented a Bitcoin payment system on my own, I've use Bitcoin myself, etc.
I still truly have no idea if Bitcoin is anonymous or not.
The answer seems to be "kinda, but we don't wanna talk about it".
I see companies specializing in trying to determine Bitcoin ownership and who does business with what... Are those just fake? Complete BS? Are people just constantly spreading ill-intentioned FUD about Bitcoin? Is it actually anonymous after all? Is it safe for me to use the same wallet (with unique receive addresses) for my private use as my commercial project and not have them associated with me?
Is it possible to get a straight answer on this once and for all?

Why is it impossible to get a straight answer as to whether Bitcoin is anonymous or not?

Because privacy is not binary in nature. It is not as if there is some moment at which your information flips from being not-private, to private. Privacy exists on a spectrum, and as a bitcoin user, where you sit on that spectrum depends entirely on the actions you take.
This means that there are ways which bitcoin can be used which afford the user a very large degree of privacy, and there are always ways to use it which afford the user no privacy whatsoever.
Some things that the average user can do to help improve their privacy:

Never give up personally identifying information to exchanges or other bitcoin businesses
Never re-use bitcoin addresses to receive funds
Run a full node to validate the network state themselves, run it over Tor only
Only use wallets which connect to their own full node to query blockchain information
Only use wallets which allow coin control and UTXO labelling
Never look up addresses of interest on blockchain explorer websites (unless using Tor)
Never publicly post any information that could tie them to certain addresses or transactions
Use the lightning network to make payments
Do not send round number amounts when making payments (eg send 0.00104103 BTC, instead of 0.001 BTC)
Use privacy-focused wallet software, such as JoinMarket or Wasabi, to create coinjoin/payjoin/etc transactions .

As a user, you need to decide what level of privacy you need/desire. Maybe following every point on the list above is too much for you, or maybe it isn't enough. There is no 'one size fits all' for privacy, though generally I would recommend endeavouring to retain your privacy whenever possible.
To quote this great article, which I would highly recommend reading:

As of 2019 most casual enthusiasts of bitcoin believe it is perfectly traceable; this is completely false. Around 2011 most casual enthusiasts believed it is totally private; which is also false. There is some nuance - in certain situations bitcoin can be very private. But it is not simple to understand, and it takes some time and reading.

I think that in general the term "anonymity" is used to refer to an extreme form of privacy where no other party can infer anything else about your identity. And for that I think the answer is very simple: Bitcoin is not anonymous, period. But there are ways to get a certain level of privacy, which may or may not be sufficient for your needs.

@PieterWuille that is a good distinction (private vs anonymous), which I didn't consider when writing this answer. Thanks, I do agree with you, but I also hope this answer can provide some level of practical help for users concerned with privacy/anonymity (and those two words are often used somewhat interchangeably in colloquial speak, despite the difference you pointed out).