Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters of Transaction questions #2

Open
Wangmmx opened this issue Apr 13, 2021 · 4 comments
Open

Parameters of Transaction questions #2

Wangmmx opened this issue Apr 13, 2021 · 4 comments
Labels
documentation Improvements or additions to documentation JSONRPC

Comments

@Wangmmx
Copy link

Wangmmx commented Apr 13, 2021

I read this document, http://tech.nyzo.co/dataFormats/transaction which is very helpful to me.

{
    "start_timestamp": 1618225693000, 
    "hash": "20db858edce54e6345303994eec74f02a77d3f16caa1d7787fd71cf33064a589", 
    "transactions": [
        {
            "fee": 867856, 
            "sender": "12d454a69523f739-eb5eb71c7deb8701-1804df336ae0e2c1-9e0b24a636683e31", 
            "receiver_nyzo_string": "id__81bkmarm8_tXYTYV77VIyN4p1d-RrL3zNqWb9apUr3WP-ys.NG-H", 
            "timestamp": 1618225694000, 
            "sender_nyzo_string": "id__81bkmarm8_tXYTYV77VIyN4p1d-RrL3zNqWb9apUr3WP-ys.NG-H", 
            "signature": "53deda5c5e53194aae9eb7de7bedc617a7f86d7c91fb49b216b8e0e9d1514526ba71fcfcf6c835b55f3cabc7dc68d82eae0e3ddedfc4dca9b51a33cd7a0a0b00", 
            "previous_hash_height": 0, 
            "sender_data": "", 
            "amount": 347142109, 
            "previous_block_hash": "bc4cca2a2a50a229256ae3f5b2b5cd49aa1df1e2d0192726c4bb41cdcea15364", 
            "type_enum": "seed", 
            "type": "0000000000000001", 
            "id": "803c581e05020f5c-d610d25a0ebd413a-768d7943fb73cfd6-0ddae8d66ab19b9d", 
            "receiver": "12d454a69523f739-eb5eb71c7deb8701-1804df336ae0e2c1-9e0b24a636683e31"
        }
    ], 
    "balance_list_hash": "f400305efb457c07d70a46ae2a5cb738de6c7d8bcca7bd4512e91f10bf46ec1e", 
    "verification_timestamp": 1618225701680, 
    "previous_block_hash": "be0dc3deb13dd7fd365f1431acde8d2eaa14bd3b714f508cce26bd29e2d2d597", 
    "height": 11632699
}

I can understand the basic field meaning. This is the data obtained from the JSONRPC interface according to the block method. Can the transaction status and success of the transaction be queried?

@EggPool
Copy link

EggPool commented Apr 13, 2021

With Nyzo, a transaction is final once its block is frozen.
There is no mempool, no chain reorg.

If a transaction is returned in a block, and that block number is lower than (or equal to) the frozen_edge as returned by the info command for instance, then its final.

@EggPool EggPool added documentation Improvements or additions to documentation JSONRPC labels Apr 13, 2021
@EggPool EggPool pinned this issue Apr 13, 2021
@Wangmmx
Copy link
Author

Wangmmx commented Apr 13, 2021

Ok I understand, if it is returned in the block, it proves that it has been on chain. Will there be returned when the transaction fails but on chain? Where can we show failure?

@EggPool
Copy link

EggPool commented Apr 13, 2021

If the transaction is invalid or was not included in its block, it will not be on chain, and never will be.

With Nyzo:

  • A transaction comes with a timestamp. The timestamp is signed, so can't be changed afterward.
  • The timestamp imposes the block the transaction can be in. One ts = one single possible block.
  • When you send a tx to the network, it is embedded by the forger of this block, may not be frozen yet.
  • Once frozen, a block will not change anymore.

So, when you send a transaction:

  • You know for sure in what block it can be present.
  • Wait for the block to be frozen (a matter of a few secs, depending on the margin you applied to the timestamp of the tx. 10sec is usually fine)
  • the tx is either there (then valid and final)
  • either not there (then never will be, can be re-done and re-sent)

@Wangmmx
Copy link
Author

Wangmmx commented Apr 13, 2021

Ok, so the transactions on the chain are all successful and reasonable transactions, thank you for such detailed answers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation JSONRPC
Projects
None yet
Development

No branches or pull requests

2 participants