Build on Dogecoin
The Dogecoin integration is currently released as beta. While no major changes in the provided API or functionality is expected, Dogecoin differs in signficant ways from Bitcoin (e.g. difficulty adjustment) that may negatively impact the Dogecoin canister and warrant a period of careful observation.
Canister smart contracts on ICP can interact directly with the Dogecoin network. This integration is made possible through a protocol-level integration with the Dogecoin network, which allows canisters to securely interact with the Dogecoin network; and threshold ECDSA cryptography, which enables canisters to sign transactions. As a result, canisters can query the state of the Dogecoin blockchain and submit signed transactions to it.
Dogecoin canister: Canisters use the API provided by the Dogecoin canister to query information about the network state, e.g., UTXOs, block information, or the balance of any Dogecoin address; and to send a transaction to the network.
Threshold ECDSA: A canister can have a secret key that is stored in a secure and decentralized manner using chain-key cryptography. Messages sent by the canister can be signed using this key, enabling the canister to send signed transactions to Dogecoin.
When an ICP smart contract wants to submit a Dogecoin transaction, the following steps may occur:
- Request a public key from the threshold signing APIs
- Create a Dogecoin address from the public key
- Read unspent UTXOs from the Dogecoin API
- Build the transaction payload
- Request a signature of the transaction hash from the threshold signing API
- Submit the transaction to the Dogecoin API
The Dogecoin canister relays the request to the Dogecoin network, which receives and processes the request asynchronously before returning the result of the transaction to the ICP smart contract that initially created it.
Follow the Build on Dogecoin book to build your first smart contract interacting with Dogecoin!
The Dogecoin canister is controlled by the Network Nervous System. Canisters can call the Dogecoin canister directly without any additional setup and trust that any change to it will require a proposal to be reviewed and approved by the community.
Additional resources
Building Dogecoin applications is not trivial. Since it is a fork of Bitcoin, understanding key Bitcoin concepts including transactions, UTXOs, the Script language, and Bitcoin’s hash formats is beneficial.