If you send send a transaction request to a node, what is to to ensure that node doesn't simply log your private key and do nothing?

What is to stop the entry node from taking a transaction intended to transfer 1 bitcoin, and transfer 100 instead? Or to stop the node from changing the receiver of the transaction to someone else?

Lastly, what is to stop a node from sending a completely made up blockchain?

Do you just have to choose a trustworthy node?


Bitcoin is meant to be a decentralized network not requiring trust to make/receive transactions. Transactions contain signatures to prove that they haven't been tampered with. Signature is not just the private key, it is something that is derived by the private key and some other parameters. This is called ECDSA, Elliptic Curve Digital Signature Algorithm. If the crypto implementation is proper, it's impossible to extract the private key from signatures.

Changing the blockchain is a different topic. Each block contains "Proof Of Work", which means its hash (a value to check a block's authenticity, but no private key) would change if any part of the block is altered. This'd invalidate the block, and miners would have to re-mine that block (change little things until the hash is lower than a value, the target) But if you create a fake chain with lower targets for blocks, then your chain would have have less Proof Of Work accumulated and other nodes would switch to the chain with the largest PoW once they're aware of it. (But in practice there are checkpoint blocks, so the initial target for remining a chain is high)

  • Ah! I understand now that the private key is never sent. However, I still am confused on how you know a node doesn't just return a false blockchain. Yes, other nodes wouldn't accept that as a valid blockchain (as there is less POW), but wouldn't the requester still get a fake blockchain and not know it? How does bitcoin prevent this? Do wallets or apps used to trade bitcoin simply choose a trusted node to connect to? Mar 25 '20 at 20:59
  • I think I've answered my previous comment question... Wallets don't just connect to nodes, they start their own "lightweight" nodes, and connect to other nodes to find the most valid chain (longest). Then they use that blockchain! Is that correct? Mar 25 '20 at 21:03
  • Nodes and wallets are given checkpoints like "Don't accept the blockchain unless the block 5000 has hash A, 2000 has hash B, 500 has hash C". And yes, if they find a longer chain then they'll erase their chain and switch! But I don't think they find the longest chain before downloading it, because any node can lie at the beginning.
    – MCCCS
    Mar 25 '20 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.