A unique bxid hash represents confirmed Qubic transactions, simplifying integration into traditional crypto systems, such as wallets and exchanges, via an API indexed by bxid.
Qsilver · Jan 6, 2024.
Qubic's unique characteristics make it challenging to interface directly with existing crypto infrastructure. This proposal defines a unique hash, bxid, representing a confirmed and instantly final proof of value transfer. An API indexed by bxid would simplify integrating Qubic into systems that expect traditional confirmed txid.
The bxid (Balance Transfer ID) can be calculated locally before inclusion in a tick, allowing wallets to display the bxid to users and query an API service. If the bxid is absent after the specified tick, it indicates a transaction failure.
For normal QU transfers, the bxid is defined by the K12 hash of epoch + tick + srcpubkey + destpubkey + amount, in a byte format matching the logfile entry. For other transaction types, the bxid follows the same convention by hashing the logfile entry directly, skipping date fields.
Handling transactionless SC balance changes requires a unique bxid per balance change. By calculating SC balance changes with an amount of 0, the query for that bxid returns the sum of all balance changes for that destination in the tick.
./bxid calcbxid epoch tick source dest amount
curl 93.190.139.223:9200/txid/_doc/(txid)
curl 93.190.139.223:9200/bxid/_doc/(bxid)
Clone and build the repository:
git clone <https://github.com/Qsilver97/qubic-cli>
cd qubic-cli
mkdir build
cd build
cmake ..
make
g++ -I.. ../bxid.cpp ../connection.cpp -o bxid
Example JSON from a logfile entry:
{ "index": { "_index": "bxid", "_id": "397e947847ada93de80907d88a835419fb532b3ca1fd68b3c95ebab11cd24190" } }
{
"utime": "1707059413",
"epoch": "90",
"tick": "11867469",
"type": "1",
"src": "LZLDOEIBQWIUGGMZGOISLOAACDGAFVAMAYXSSJMLQBHSHWDBPMSDFTGAYRMN",
"dest": "QHQPMJVNGZJGZDSQREFXHHAZFYPBIYDOTFAOTTWGYCWGTIRNGBVMKBGGNDDA",
"amount": "1521139"
}
Use the Charmed OpenSearch system to process these JSON lines:
curl --cacert demo-ca.pem -XGET https://<username>:<password>@<ipaddr>:9200/bxid/_doc/397e947847ada93de80907d88a835419fb532b3ca1fd68b3c95ebab11cd24190
{
"_index": "bxid",
"_id": "397e947847ada93de80907d88a835419fb532b3ca1fd68b3c95ebab11cd24190",
"_version": 2,
"_seq_no": 32754,
"_primary_term": 1,
"found": true,
"_source": {
"utime": "1707059413",
"epoch": "90",
"tick": "11867469",
"type": "1",
"src": "LZLDOEIBQWIUGGMZGOISLOAACDGAFVAMAYXSSJMLQBHSHWDBPMSDFTGAYRMN",
"dest": "QHQPMJVNGZJGZDSQREFXHHAZFYPBIYDOTFAOTTWGYCWGTIRNGBVMKBGGNDDA",
"amount": "1521139"
}
}
Create a log processing loop to maintain the archival service and REST API:
while true; do
./bxid processlog
done
Implementing a bxid archival service simplifies integrating Qubic into existing crypto services by providing a confirmed and instantly final proof of value transfer. By leveraging bxid and the bxid archival service, Qubic transactions can be seamlessly incorporated into traditional crypto infrastructure.
For the latest updates, join the Valis Discord, follow us on X, and bookmark our blog.
← Previous
Next →
Arbitrator is not an Alligator
On this Page