Z-DAG Developer Guide
Z-DAG is a patent-pending transaction technology implemented on the Syscoin blockchain that enables near-instant, low-cost transactions that are highly scalable. Z-DAGs transactional throughput has been audited by third party blockchain auditing firm Whiteblock, you can view their report here. For more technical information on Z-DAG refer to the Z-DAG Syscoin Community page or the Syscoin Z-DAG Whitepaper.
Z-DAG Basics
Z-DAG is an interactive protocol, meaning you can continue to check the Z-DAG status all the way up to the point of blockchain confirmation. In today's network conditions a minimum Z-DAG threshold of 10 seconds or later are typically secure (99.9999%). Within certain enterprise deployments lower Z-DAG thresholds can be considered secure dependent on network conditions.
A typical transaction workflow has 2 stages:
- The transaction enters the mempool (unconfirmed).
- The transaction is mined into a block (confirmed).
When using Z-DAG, there are 3 stages:
- The transaction enters the mempool (unconfirmed).
- After a predefined Z-DAG threshold time the interactive protocol is called and returns a Z-DAG status.
- The transaction is mined into a block (confirmed).
When step 2 returns a Z-DAG status of 0 (after the Z-DAG threshold) that means the SPT can be re-spent without the risk of double-spends. Longer Z-DAG thresholds provide a higher level of security. When transactions are in a Z-DAG state available balance for re-spending should be determined using the Z-DAG balance.
Understanding Z-DAG Statuses
Z-DAG can be return 3 levels of status.
| Status | Description |
|---|---|
| -1 | Transaction not found, not a ZDAG transaction, perhaps it is already confirmed. |
| 0 | OK |
| 1 | WARNING (checked that in the mempool there are more spending balances than current POW sender balance). An active stance should be taken and perhaps a deeper analysis as to potential conflicts related to the sender. |
| 2 | CRITICAL. Active double spend was found and any depending asset allocation sends are also flagged as dangerous and should wait for POW confirmation before proceeding. |
Using Z-DAG Balances
The available balance while use Z-DAG can be determined by calling assetallocationbalance. If the balance and zdag_balance are the same, then display the balance. If the balances differ that is an indication that a Z-DAG transaction is unconfirmed. In this scenario the zdag_balance should be used to indicate to the user their available balance.
Updated about 6 years ago
