Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: vic.cebedo on June 21, 2019, 08:06:58 AM



Title: Verifying Invalid Transactions
Post by: vic.cebedo on June 21, 2019, 08:06:58 AM
Hi all,

I think I have already understood how Signing and Verifying means:
Signature = Hashed Message + Private Key of Wallet
Is Valid = Hashed Message + Signature + Public Key of Wallet

But what happens next after this?
Where/How does the network verify?

Consider the situation:
1) I declare a false message (send 10BTC to Bob), then hash it.
2) Sign false message with Private Key from wallet.
3) Broadcast it to the network.

After this phase, the miners will receive my transaction containing a false message.
And then what? How or where do they check that I have enough funds to transfer 10BTC?
Is there like a simple infographic that I can refer to so that I can understand the flow?
I have trouble understanding the bigger picture.

Thank you!


Title: Re: Verifying Invalid Transactions
Post by: LoyceV on June 21, 2019, 08:22:18 AM
How or where do they check that I have enough funds to transfer 10BTC?
Transacions use inputs, if the address doesn't hold enough funds, it's simply rejected.

There are many (https://www.youtube.com/watch?v=6yIqXMaeEJ4) videos (https://www.youtube.com/watch?v=41JCpzvnn_0) on Bitcoin (https://www.youtube.com/watch?v=s4g1XFU8Gto) on Youtube if you want a simplified explanation.

It might help to manually create, verify and sign (don't enter private keys on an online website!) some transactions on https://coinb.in/ as an exercise.


Title: Re: Verifying Invalid Transactions
Post by: vic.cebedo on June 21, 2019, 09:06:13 AM
Transacions use inputs, if the address doesn't hold enough funds, it's simply rejected.

There are many (https://www.youtube.com/watch?v=6yIqXMaeEJ4) videos (https://www.youtube.com/watch?v=41JCpzvnn_0) on Bitcoin (https://www.youtube.com/watch?v=s4g1XFU8Gto) on Youtube if you want a simplified explanation.

It might help to manually create, verify and sign (don't enter private keys on an online website!) some transactions on https://coinb.in/ as an exercize.

So, basically, before the Transaction is even made, there has to be a pointer to the FROM address to check if the funds are sufficient. Am I correct?
It's getting really hard to search for anything technical related to Bitcoin because there is alot of noise everywhere.
Thank you very much.


Title: Re: Verifying Invalid Transactions
Post by: bob123 on June 21, 2019, 10:59:34 AM
So, basically, before the Transaction is even made, there has to be a pointer to the FROM address to check if the funds are sufficient. Am I correct?

On a technical level, there are no 'addresses'.

Bitcoin is based on a UTXO (Unspent Transaction Outputs) model.

You 'destroy' UTXO and create new ones. If you use UTXOs as input which do not exist, each node will ignore it when validating it using their 'list' of all UTXOs.
Validating a transaction happens upon receiving it.


Does this answer your question ?


Title: Re: Verifying Invalid Transactions
Post by: nc50lc on June 21, 2019, 11:30:28 AM
But what happens next after this?
Where/How does the network verify?
The "network" consists of all the nodes, each have a copy of the full (or partial) "blockchain" which is a chain of blocks where the UTXO (unspent outputs) are "recorded".

So, having a copy of the blockchain, every transaction that they will (usually automatically) save to their own mempool and relay to other nodes should have a valid UTXO, signature, specific preferences, etc. or else, it will be rejected and wont reach other/mining nodes.

Hope you get this.


Title: Re: Verifying Invalid Transactions
Post by: vic.cebedo on June 24, 2019, 01:25:25 AM
Thank you very much for your input guys, but I still find it difficult to understand.
I think, probably, the best way for me to understand the flow is just to code my own simple wallet and tinker on some parts of the API.
Thanks!