Panoramica di integrazione¶
Questa documentazione è disponibile anche come file PDF.
Dash Core is a fork of Bitcoin Core and shares many common functionalities. Key differences are found in existing JSON-RPC commands which have been customized to support unique functionalities such as InstantSend.
The Basics¶
Dash is a Proof of Work network, and similar to Bitcoin, Dash has a mining network but uses a different block hashing algorithm. Dash serves as an improvement of Bitcoin’s shortcomings by offering a robust solution for instant transactions, enhancing user privacy, and offering a self-sustainable decentralized governance model.
Block time: ~2.6 minutes per block
Github source: https://github.com/dashpay/dash
Latest release: https://github.com/dashpay/dash/releases
JSON-RPC Interface¶
The majority of commands are unchanged from Bitcoin making integration into existing systems relatively straightforward. Note that the following commands have been modified to support InstantSend:
Block Hashing Algorithm¶
Dash uses the X11 algorithm in place of SHA256 used in Bitcoin. It’s important to note, however, that this only affects the hashing of the block itself. All other internals utilize SHA256 hashes (transactions, merkle root, etc.), which allows for most existing libraries to work in the Dash ecosystem.
Transazioni Speciali¶
Dash Core v0.13.x introduced the concept of “Special Transactions”. Please see the Transaction Type Integration Guide for more information.
Transazioni Speciali¶
Questa documentazione è disponibile anche come file PDF.
Dash 0.13.0 e versioni successive implementano DIP002 Special Transactions <https://github.com/dashpay/dips/blob/master/dip-0002.md> __, che costituiscono una base per i nuovi tipi di transazione che forniscono on-chain metadati per assistere vari meccanismi di consenso. Esistono i seguenti tipi di transazioni speciali:
Rilascio |
Versione |
Modello |
Payload Size |
Payload |
Payload JSON |
Proposito della Transazione |
|---|---|---|---|---|---|---|
v0.13.0 |
3 |
0 |
n/a |
n/a |
n/a |
Transazione standard |
v0.13.0 |
3 |
1 |
<variable int> |
<hex> |
proRegTx |
|
v0.13.0 |
3 |
2 |
<variable int> |
<hex> |
proUpServTx |
|
v0.13.0 |
3 |
3 |
<variable int> |
<hex> |
proUpRegTx |
|
v0.13.0 |
3 |
4 |
<variable int> |
<hex> |
proUpRevTx |
|
v0.13.0 |
3 |
5 |
<variable int> |
<hex> |
cbTx |
|
v0.13.0 |
3 |
6 |
<variable int> |
<hex> |
qcTx |
Note di integrazione:
DIP002 Transazioni Speciali sono una componente fondamentale di Dash Core v0.13.0 e introducono una nuova versione di transazione e relativo «Payload» alla rete.
Integrated Systems must be able to serialize and deserialize these new Transaction Types to accurately encode and decode Raw Transaction data.
Dal punto di vista della compatibilità con le versioni precedenti, il campo` versione “” di 4 byte (32 bit) incluso nelle transazioni legacy è stato suddiviso in due campi: versione` e` `tipo “” (ciascuno composto da 2 byte)
Fare riferimento alla sezione Transazioni speciali degli sviluppatori dash per ulteriori dettagli su questo tipo di dati, ad es. <variable int>.
InstantSend status and Payload JSON (e.g.
proRegTx) is included in the JSON-RPC response, please note that this data is not part of the calculated hash and is provided for convenience.
Vedere la documentazione sull’integrazione dei tipi di transazione v0.13.0 (PDF) per esempi funzionanti di ogni tipo di transazione.
InstantSend¶
Questa documentazione è disponibile anche come file PDF.
InstantSend è una funzionalità fornita dalla rete Dash che consente di accettare e riutilizzare in modo sicuro le transazioni a zero conferme. La rete lavora per bloccare gli input di ogni transazione valida quando viene trasmessa alla rete. Ogni transazione protetta è inclusa in un blocco successivo in conformità con i principi standard della blockchain.
InstantSend is enabled by the Masternode Network which comprises approximately 5,000 masternode servers. These nodes are differentiated from standard nodes by having proven ownership of 1,000 Dash, making the network highly resistant to Sybil attacks. Masternodes form Long-Living Masternode Quorums (LLMQs), which are responsible for providing near-instant certainty to the transaction participants that the transaction inputs cannot be respent, and that the transaction will be included in a following block instead of a conflicting transaction.
Questo concetto funziona come un’estensione del Nakamoto Consensus. InstantSend consente al destinatario di spendere immediatamente e in modo sicuro i fondi negoziati, anche prima che la transazione venga inclusa in un blocco.
Ricezione di transazioni InstantSend¶
La ricezione di una transazione InstantSend introduce a due requisiti:
La capacità di determinare lo «Status di InstantSend» di una data transazione.
Possibilità di regolare lo «Status di conferma» indipendentemente dalla conferma del blocco.
Lo status di InstantSend viene in genere determinato tramite la connessione diretta con il demone dash, notifica ZMQ, o tramite l’uso di uno script di notifica del portafoglio esterno.
** Connessione diretta: ** Lo stato di InstantSend può essere identificato tramite connessione diretta con il demone Dash utilizzando il protocollo JSON-RPC. L’attributo «instantlock» della risposta JSON riflette lo stato della transazione ed è incluso nei seguenti comandi:
** Notifica ZMQ: ** Ogni volta che una transazione entra in mempool e ogni volta che una transazione è bloccata in mempool, le notifiche ZMQ possono essere trasmesse dal nodo. Un elenco di possibili notifiche ZMQ può essere trovato qui.
Le seguenti notifiche sono rilevanti per il riconoscimento delle transazioni e dei relativi blocchi istantanei:
zmqpubhashtx
zmqpubhashtxlock
zmqpubrawtx
zmqpubrawtxlock
** Notifica portafoglio: ** Dash Core Daemon può essere configurato per eseguire uno script esterno ogni volta che viene osservata una transazione InstantSend relativa a quel portafoglio. Questo viene configurato aggiungendo la seguente riga al file dash.conf:
instantsendnotify=/path/to/concurrent/safe/handler %s
Questo è tipicamente usato con un portafoglio che è stato popolato con indirizzi watch-only <https://dashcore.readme.io/docs/core-additional-resources-glossary#section-watch-only-address> __.
Trasmissione di transazioni InstantSend¶
Poiché Dash v0.14.0 ha stabilito LLMQs sulla rete Dash, i quorum tenteranno ora di bloccare ogni transazione valida per impostazione predefinita senza alcuna commissione o azione aggiuntiva da parte del portafoglio o dell’utente che invia. Una transazione è idonea per InstantSend quando ciascuno dei suoi input è confermato. Questo è il caso in cui si verifica almeno una delle seguenti circostanze:
la transazione precedente a cui fa riferimento l’entrata viene confermata con 6 blocchi
la transazione precedente viene confermata tramite un blocco InstantSend più vecchio
il blocco contenente la transazione precedente è ChainLocked
When checking the previous transaction for an InstantSend lock, it is important to do this on mempool (non-mined) transactions. This allows chained InstantSend locking.
Risorse addizionali¶
Le seguenti risorse forniscono ulteriori informazioni su InstantSend e hanno lo scopo di fornire una comprensione più completa delle tecnologie sottostanti.
Servizi API¶
Esistono diversi servizi API per facilitare l’integrazione rapida e semplice con la rete Dash per servizi tra cui:
Trasmissione di transazioni
Tassi di cambio
Conversione di valuta
Generazione di fatture
I servizi API vengono in genere sfruttati per eliminare il requisito di eseguire la propria infrastruttura per supportare le interazioni blockchain. Ciò include meccanismi come:
Formazione e trasmissione di una transazione alla rete.
Generazione di indirizzi tramite portafogli HD.
Elaborazione dei pagamenti tramite WebHook.
Ci sono una varietà di opzioni per supportare questi metodi, con il fattore chiave di differenziazione che è il modello di prezzo incluso e le funzionalità supportate. Il seguente elenco di provider API tenta di delineare queste caratteristiche / differenziatori chiave e include anche un collegamento alla documentazione correlata.
Insight¶
https://github.com/dashevo/insight-api
L’API REST Insight open source fornisce un modo comodo, potente e semplice per leggere i dati dalla rete Dash e creare i propri servizi con essa. È disponibile una guida pratica per iniziare con l’API Insight e il block explorer dell’interfaccia utente di Insight: ref: qui <insight-api>.
Caratteristiche: Transaction Broadcast, WebSocket Notifications.
Modello di prezzo: gratuito / open source
Documentazione: https://github.com/dashevo/insight-api
BlockCypher¶
BlockCypher è un’API JSON semplice, principalmente RESTful per l’interazione con blockchain, accessibile tramite HTTP o HTTPS dal dominio api.blockcypher.com
Caratteristiche: trasmissione di transazioni, portafogli HD/ generazione di indirizzi, callback WebSocket e WebHook e inoltro di pagamenti. BlockCypher non gestisce le chiavi private.
Pricing Model: Per API Call, 5000 Requests -> $85.00 per month (https://accounts.blockcypher.com)
Documentazione: https://www.blockcypher.com/dev/dash/
BitGo¶
BitGo fornisce un’API RESTful semplice e robusta e un SDK client per integrare i portafogli di valuta digitale con la tua applicazione. È disponibile il supporto per Dash InstantSend.
Caratteristiche: portafogli HD multi-firma, operazioni di portafoglio, notifiche WebSocket e WebHook, soluzioni di custodia
Modello di prezzo: per API Call
Documentation: https://app.bitgo.com/docs/
ChainRider¶
ChainRider è un servizio cloud che fornisce una serie di API REST per la gestione e l’esplorazione della valuta digitale.
Caratteristiche: query Blockchain, notifiche di eventi, trasmissione di transazioni, elaborazione dei pagamenti, ecc.
Modello di prezzo: prova gratuita, pagamento API call
Documentation: https://www.chainrider.io/docs/dash/
Blockmove¶
Portafoglio criptovaluta, commerciante e provider API. Blockmove è un modo semplice e facile per iniziare ad accettare pagamenti in criptovaluta.
Caratteristiche: portafoglio non custodito, portafoglio HD, elevato anonimato, commissioni basse. Le chiavi private non vengono memorizzate e sono disponibili solo per l’utente.
Modello di prezzo: API - 0,3% per le transazioni di prelievo. Commerciante - 1 anno gratuito, poi $ 49 / mese
Documentazione: https://docs.blockmove.io
NOWNodes¶
NOWNodes provides simple, fast, and secure RPC access to Dash-based full nodes. The low latency and high performance is of great use to researchers and businesses such as crypto miners or hardware wallet providers.
Caratteristiche: tutti i comandi Dash RPC
Pricing Model: Free up to 20k requests, Pricing tiers
Documentazione: https://nownodes.io/documentation
CoinPayments¶
CoinPayments is an integrated payment gateway for cryptocurrencies such as Dash. Shopping cart plugins are available for all popular webcarts used today. CoinPayments can help you set up a new checkout or integrate with your pre-existing checkout.
Features: Invoicing, Exchange Rates, WebHook Callbacks. CoinPayments holds Private Keys on their server allowing merchants to withdraw funds in Cryptocurrency or convert to fiat.
Integrazioni: aMember Pro, Arastta, Blesta, BoxBilling, Drupal, Ecwid, Hikashop, Magento, OpenCart, OSCommerce, PrestaShop, Tomato Cart, WooCommerce, Ubercart, XCart, ZenCart
Modello di prezzo: 0.5% tassa di elaborazione (https://www.coinpayments.net/help-fees)
Documentazione: https://www.coinpayments.net/apidoc
Risorse SDK¶
SDKs (Software Development Kits) are used to accelerate the design and development of a product for the Dash Network. These resources can either be used to interface with an API provider or for the creation of standalone applications by forming transactions and/or performing various wallet functions.
Guida per sviluppatori Dash¶
The Dash Developer Portal aims to provide the information you need to understand Dash and start building Dash-based applications. To make the best use of this documentation, you may want to install the current version of Dash Core and Dash Platform, either from source, from a pre-compiled executable or from Docker Hub.
Dash Core: https://dashcore.readme.io/
Dash Platform: https://dashplatform.readme.io/
NodeJS/JavaScript: Dashcore¶
Dashcore is a fork of Bitcore and operates as a full Dash node — your apps run directly on the peer-to-peer network. For wallet application development, additional indexes have been added into Dash for querying address balances, transaction history, and unspent outputs.
Platform: NodeJS / Javascript
Documentation: https://github.com/dashevo/dashcore-lib/blob/master/README.md#documentation
Repository lib: https://github.com/dashevo/dashcore-lib
Repository node: https://github.com/dashevo/dashcore-node
See also: Insight API
NodeJS/JavaScript: DashJS¶
DashJS allows you to transact on L1 or fetch/register documents on L2 within a single library, including management and signing of your documents.
Platform: NodeJS / Javascript
Documentation: https://dashevo.github.io/js-dash-sdk/
Repository: https://github.com/dashevo/js-dash-sdk
PHP: Bitcoin-PHP¶
https://github.com/Bit-Wasp/bitcoin-php
Bitcoin-PHP is an implementation of Bitcoin with support for Dash using mostly pure PHP.
Platform: PHP
Documentation: https://github.com/Bit-Wasp/bitcoin-php/blob/1.0/doc/documentation/Introduction.md
Repository: https://github.com/snogcel/bitcoin-php
Python: PyCoin¶
https://github.com/richardkiss/pycoin
PyCoin is an implementation of a bunch of utility routines that may be useful when dealing with Bitcoin and Dash. It has been tested with Python 2.7, 3.6 and 3.7.
Platform: Python
Documentation: https://pycoin.readthedocs.io/en/latest/
Repository: https://github.com/richardkiss/pycoin
See also: JSON-RPC Utilities
Java: DashJ¶
https://github.com/dashevo/dashj
DashJ is a library for working with the Dash protocol. It can maintain a wallet, send/receive transactions (including InstantSend) without needing a local copy of Dash Core, and has many other advanced features. It’s implemented in Java but can be used from any JVM compatible language: examples in Python and JavaScript are included.
Platform: Java
Documentation: https://bitcoinj.org/getting-started
Repository: https://github.com/dashevo/dashj
Example application: https://github.com/tomasz-ludek/pocket-of-dash
Objective-C: Dash-Sync¶
https://github.com/dashevo/dashsync-iOS
Dash-Sync is an Objective-C Dash blockchain framework for iOS. It implements all most relevant Bitcoin Improvement Proposals (BIPs) and Dash Improvement Proposals (DIPs).
Platform: iOS
Repository: https://github.com/dashevo/dashsync-iOS
.NET: NBitcoin¶
https://github.com/MetacoSA/NBitcoin
NBitcoin is the most complete Bitcoin library for the .NET platform and has been patched to include support for Dash. It implements all most relevant Bitcoin Improvement Proposals (BIPs) and Dash Improvement Proposals (DIPs). It also provides low level access to Dash primitives so you can easily build your application on top of it.
Platform: .NET
Documentation: https://programmingblockchain.gitbook.io/programmingblockchain/
Repository: https://github.com/MetacoSA/NBitcoin
See also: JSON-RPC Utilities
BlockCypher¶
BlockCypher also offers client SDKs.
Platform: Ruby, Python, Java, PHP, Go, NodeJS
Repositories: https://www.blockcypher.com/dev/dash/#blockcypher-supported-language-sdks
Vending Machines¶
Community member moocowmoo has released code to help merchants build their own vending machine and set it up to receive Dash InstantSend payments. The Dashvend software can also be used to create any sort of payment system, including point-of-sale systems that can accept InstantSend payments.
Price Tickers¶
You can add a simple price ticker widget to your website using the simple code snippet generator from CoinGecko.
Similar widgets with different designs are available from CoinLib, WorldCoinIndex and Cryptonator, while an API providing similar information is available from DashCentral.
QR Codes¶
Many wallets can generate QR codes that are scannable to simplify entry of the Dash address. Printing these codes or posting the on your website makes it easy to receive payment and tips in Dash, both online and offline.
In Dash Core, go to the Receive tab, generate an address if necessary, and double-click it to display a QR code. Right-click on the QR code and select Save Image to save a PNG file.
In Dash for Android, tap Request Coins and then tap the QR code to display a larger image. You can screenshot this to save an image.
In Dash for iOS, swipe to the left to display the Receive Dash screen. A QR code and address will appear. You can screenshot this to save an image.
To generate a QR code from any Dash address, visit CWA QR Code Generator and simply paste your Dash address to generate an image.