3
I'm currently working on some Bitcoin code and whilst I'm hoping I've covered my bases, I wanted to check the implementation theory.
If I understand the malleable bug it's basically... You create a transaction address for the transaction to take place on. At this point a transaction id is created (txid)
The txid is changed before the transaction is complete on the network, creating a second txid, that the transaction will eventually be completed/confirmed/verified on.
So if that is correct (please correct me if I'm wrong)...
A script/program transferring coins to somebody should work something like this:
A transaction address is created and given to the payee to transfer the requested balance to. That transaction address is checked periodically for number of confirmations. When the transaction address receives 6 or more confirmations it can be considered as completed.
Is there a better/quicker/securer way ?
Thanks
2You're confusing addresses with the transaction id. Addresses can't be changed. The transaction id can be. You create a transaction sending btc to an address. The problem is you can't simply use thee transaction id to track the progress of the transaction because someone can change that id and then you don't see it going into the blockchain even though it has. – Jannes – 2014-02-14T23:34:06.447
Thanks Jannes. So why wouldn't people try to verify against transaction addresses instead of transaction IDs ? – Mark – 2014-02-14T23:39:50.757
Yeah that's basically what you're supposed to do. Keep an eye on your own balance and match any transaction you see to any transaction you made earlier. Just not by the id but by the addresses. Which basically means you make your own hash of the important (non-malleable) parts of the transaction that you create and then you keep an eye on the blockchain for that hash. There's a recommended best practices for such a hash. Best to follow those and not implement something yourself based on what some random lurker on here tells you (meaning: i may have parts or all of this wrong) – Jannes – 2014-02-15T01:16:39.870
https://github.com/bitcoin/bitcoin/pull/3656 – Jannes – 2014-02-15T01:17:20.217
I think your question would be much clearer if you edited it to reflect your new knowledge about the difference between addresses and transaction ids. ;) – Murch – 2014-02-15T12:26:06.760
related: How is a Transaction ID generated & when does it change? (with a new sequence ID?)
– Murch – 2014-02-15T12:27:01.903