Test bxid/txid API Server
The dual txid/bxid archival service simplifies Qubic integration by verifying transaction success via curl or web browser queries.
Qsilver · Jan 9, 2024.
I made a dual txid and bxid archival service that is accessible using curl or even a web browser. txid data from epoch 83 and bxid data from epoch 90 are in the archive. Both txid and bxid data are being updated every minute.
This will allow for much easier integration of Qubic into existing crypto services as it becomes much easier to determine if a transaction succeeded. WARNING: This is just a test server and not for production usage, but it should be sufficient to get deposit/withdraw logic debugged.
Using bxid Utility
If you have the important transaction details, you can directly calculate the bxid with the calcbxid command of the bxid utility:
./bxid calcbxid epoch tick source dest amount
Find more details at: qubic-cli/bxid.cpp at main · Qsilver97/qubic-cli (github.com)
Fetching Transaction Data
Alternatively, once you have a txid, you can get its data after it is included in the specified tick with:
curl 93.190.139.223:9200/txid/_doc/(txid)
or just use a web browser.
Assuming the transaction was included in the tick, it will appear and have a “bxid” field. Search for that bxid with:
curl 93.190.139.223:9200/bxid/_doc/(bxid)
If you get a valid return, it means the transaction completed successfully. If it is not found, assuming the archive is current, it means the transaction was included in a tick but failed (e.g., you sent more QU than was in the balance).
To ensure your transaction is “confirmed,” check for the bxid. There is no actual concept of confirmations in Qubic, as it becomes instantly final. As soon as the bxid is available, it is safe to assume the funds were transferred by the txid.
Advanced Searching
While not needed for transaction validation, you can search for any field in either the txid or bxid dataset using the _search endpoint:
curl 93.190.139.223:9200/txid/_search?q=AFZPUAIYVPNUYGJRQVLUKOPPVLHAZQTGLYAAUUNBXFTVTAMSBKQBLEIEPCVJ
curl 93.190.139.223:9200/bxid/_search?q=AFZPUAIYVPNUYGJRQVLUKOPPVLHAZQTGLYAAUUNBXFTVTAMSBKQBLEIEPCVJ
curl 93.190.139.223:9200/txid/_search?q=11919361
curl 93.190.139.223:9200/bxid/_search?q=11919361
Different results might be returned as you can have txid that do not transfer any value in addition to transaction failure. A lot of transactions use zero value with extra data, and that can be seen in the txid output.
For more details, refer to the Search — OpenSearch Documentation.
For the latest updates, join the Valis Discord, follow us on X, and bookmark our blog.
← Previous
On this Page
Related Posts