Bitcoin Forum
May 26, 2024, 06:40:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1]
  Print  
Author Topic: LOL. BitcoinCashABC has out-of-order transactions  (Read 155 times)
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
November 16, 2018, 03:12:38 PM
 #1

Sorry for posting about alt-coin.

Looking into new "technologies". One more rule is broken. Transactions in block are in alphabet order.
This cause that spending comes earlier than funding. For example: block #556933
https://blockdozer.com/block/000000000000000000f3d1e6172916cad0a78cffa4e95ce2deb834f546103ffa

funding transaction https://blockdozer.com/tx/c660e155ed46c7e24e7fd9d7bb815f764447578d1ea74c2a531fc0d07552f617
is #78 in block, but spending the 0-th output of it is transaction
https://blockdozer.com/tx/1db66caf454642568895c1558e61644cca0dcee00886c661d24aa7c5a29fcd51
which has position #13 in the same block.

LOL  Grin

How do you verify such blocks?

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
odolvlobo
Legendary
*
Offline Offline

Activity: 4326
Merit: 3239



View Profile
November 16, 2018, 05:09:22 PM
Last edit: November 16, 2018, 05:34:45 PM by odolvlobo
 #2

It is not necessary to store transactions in order of dependency. I can see how storing the transactions in numerical order by hash would improve performance.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
November 16, 2018, 05:44:21 PM
 #3

It is not necessary to store transactions in order of dependency. I can see how storing the transactions in numerical order by hash would improve performance.
This is not an answer for my question. How do you verify the validity of such block?

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
achow101
Staff
Legendary
*
Offline Offline

Activity: 3402
Merit: 6657


Just writing some code


View Profile WWW
November 16, 2018, 06:39:27 PM
 #4

How do you verify such blocks?
You don't and just trust the miners that it is correct. That's the bcash model after all  Grin

But actually, to verify such blocks, you could do it in multiple passes. In each pass, you verify the transactions and skip the ones where the inputs are missing from the UTXO set. As you verify, the UTXO set is updated. Then you try to verify the skipped transactions again and so on. You would do this until there are no unverified transactions left, or until the UTXO set is not updated after a pass over the unverified transactions. At that point, all of those unverified transactions are invalid because their inputs are not in the UTXO set and the inputs are not from a transaction that is in the block.

odolvlobo
Legendary
*
Offline Offline

Activity: 4326
Merit: 3239



View Profile
November 16, 2018, 06:57:49 PM
 #5

It is not necessary to store transactions in order of dependency. I can see how storing the transactions in numerical order by hash would improve performance.
This is not an answer for my question. How do you verify the validity of such block?

The order of the transactions does not affect the process for checking validity. In your example, the validator checks transaction 1db6...cd51 and verifies that its input matches output 0 of transaction c660...f617 regardless of where that transaction is -- in the same block or in an earlier block.

No rules are broken. The only positional requirement is that the input can't reference an output in a future block.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
November 16, 2018, 07:25:39 PM
 #6

the validator checks transaction 1db6...cd51 and verifies that its input matches output 0 of transaction c660...f617
I have a block and parse it from begin to end. Some pseudocode:
Code:
const int count ( rawdata.getTxCount ( ) );
for ( int i ( 0 ); i < count; i++ )
{
   const Transaction tx ( rawdata.getTransaction ( ) );
   // validate and update current state
}

In fact, I definitely able to rewrite my code.
I am just wondering - what is the reason to store transactions in alphabet order of their txid?
As far as I know, the client works with UTXO database, not with serialized blocks.

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
Tonstar
Member
**
Offline Offline

Activity: 434
Merit: 10


View Profile
November 16, 2018, 07:27:14 PM
 #7

Sorry for posting about alt-coin.

Looking into new "technologies". One more rule is broken. Transactions in block are in alphabet order.
This cause that spending comes earlier than funding. For example: block #556933
https://blockdozer.com/block/000000000000000000f3d1e6172916cad0a78cffa4e95ce2deb834f546103ffa

funding transaction https://blockdozer.com/tx/c660e155ed46c7e24e7fd9d7bb815f764447578d1ea74c2a531fc0d07552f617
is #78 in block, but spending the 0-th output of it is transaction
https://blockdozer.com/tx/1db66caf454642568895c1558e61644cca0dcee00886c661d24aa7c5a29fcd51
which has position #13 in the same block.

LOL  Grin

How do you verify such blocks?
well j th9nk taht we should look fpr things taht will happen next and i believe tat we must see tje world statictics for this
Tonstar
Member
**
Offline Offline

Activity: 434
Merit: 10


View Profile
November 16, 2018, 07:28:07 PM
 #8

the validator checks transaction 1db6...cd51 and verifies that its input matches output 0 of transaction c660...f617
I have a block and parse it from begin to end. Some pseudocode:
Code:
const int count ( rawdata.getTxCount ( ) );
for ( int i ( 0 ); i < count; i++ )
{
   const Transaction tx ( rawdata.getTransaction ( ) );
   // validate and update current state
}

In fact, I definitely able to rewrite my code.
I am just wondering - what is the reason to store transactions in alphabet order of their txid?
As far as I know, the client works with UTXO database, not with serialized blocks.
that part of human inventions is very interesting nd i want to widsh ypu good luck in all your work and vusiness just go on
amaclin1 (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


View Profile
November 16, 2018, 07:44:13 PM
 #9

You don't and just trust the miners that it is correct. That's the bcash model after all  Grin
This model is suitable for all cryptos (including the Bitcoin itself).
People just want to use it for increasing their own national (fiat) money
Nobody cares what is under the cover.

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!