0

I have read all kind of the articles and I understand almost all the concept from cryptocurrency. What I still don't understand is, what are the steps from transactions to a valid block. On a post on this SE I found this:

  • Collects transactions from the network
  • Validates them, and doesn't allow conflicting ones
  • Puts them into large bundles called blocks
  • Computes cryptographic hashes over and over until if finds one "good enough to count"
  • Then submits the block to the network, adding it to the blockchain and earning a reward in return.

Let's take a practical example and please correct me if I make some wrong steps:

  • I send 10BTC to Batman.
  • Because I have send BTC, a transaction is created in system.
  • This transaction is send to all nodes from network (all users)
  • After transaction arrives to all users, the transaction is added in a queue where the miners take take their transactions.
  • A miner take transaction, process it (proof of work) and creates a block with more transactions.
  • After all the transactions are validated by miner, the new block is send in the network for check.

Now, questions:

  • How does each user check this blockchain (divide the blockchain and check each transaction if the transaction from the blockchain is the same with the one that he has (because first transactions are send to all the users from p2p network and after that are send in the queue to be process by the miner. This is how user is able to compare the transactions))?
0
  • I send 10BTC to Batman.
  • Because I have send BTC, a transaction is created in system.
  • This transaction is send to all nodes from network (all users)

That is correct so far

  • After transaction arrives to all users, the transaction is added in a queue where the miners take take their transactions.

Yep, although its not really a queue because miners don't necessarily have to take the first transactions first. Its called the mempool, and its just a bit collection of them, with no enforced order.

  • A miner take transaction, process it (proof of work) and creates a block with more transactions.

I'd just like to make it clearer that the proof of work is the name given to the hashing of the entire block, proof of work is not the verification of the transaction. Verifying the transaction doesn't take much work, only creating the block does.

  • After all the transactions are validated by miner, the new block is send in the network for check.

After all the transactions are validated by the miner and the miner has found a valid proof of work block, that new block is sent to the rest of the network. Just valid transactions alone does not make a valid block. You are missing the idea of "Computes cryptographic hashes over and over until if finds one 'good enough to count'" that you mentioned. That is the proof of work.

How does each user check this blockchain (divide the blockchain and check each transaction if the transaction from the blockchain is the same with the one that he has (because first transactions are send to all the users from p2p network and after that are send in the queue to be process by the miner. This is how user is able to compare the transactions))?

Users can just compare the transaction hash with the ones in the blockchain, because the hash is a deterministic "summary" or digest of the transaction. The same transaction will always have the same hash, but two different transactions will have different hashes. Full nodes always validate all the transactions in the new block when they receive it anyway, they don't just trust the miners.

  • As a node (user, when i receive a new block) how can i say that transaction inside that block are valid and not tamper by the miner if is the first time when i see that transaction? I can understand this if before a transaction is send in mempool also to be send to each node from p2p network and to store this transaction. When a new block arrives i can compare my local transactions with those from block. If a local transaction match with one from block is declare as valid else i not valid. This is how i see the things but i don't thing is write. – Mike Feb 15 '18 at 6:16
  • @Adrian a transaction has to be signed by the sender, if the transaction was modified the signature would not be valid. So as long as the signature is valid, you know the transaction is not tampered with – MeshCollider Feb 15 '18 at 6:32
  • One more question. How can i know that signature was not tampered? I guess this signature is a hash on date or something like this. How can I know(me as a node) that the transaction I am looking at has a valid signature and was not tempered? Thanks – Mike Feb 15 '18 at 6:37
  • If the signature was tampered with, it would be invalid – MeshCollider Feb 15 '18 at 8:20
  • I think i understand. Is something like..each transaction has a flag when i create the transaction this is set to true (sig is ok) if someone will change in any way this signature this flag will be false.(this is a way to see things, there maybe is more complicated way to validate transactions). What i am trying to say is that each transaction has a mechanism that will reveal if a transaction has been tempered or not. I am right @MeshCollider? :) – Mike Feb 15 '18 at 8:56

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.