We, a team of Cardano developers and Web3 enthusiasts that believe in leveraging blockchain technology to create more inclusive and transparent digital future, joined together to develop the on-chain DApp registration standard (for more details refer to cip-72 specification) that enables DApps developers to advertise their DApps on Cardano blockchain and make them visible and easily discoverable on chain in a standardized way.
Outline what the on-chain DApp registration is about and help DApp developers register their DApps on Cardano blockchain.
The on-chain DApp registration, based on CIP-72 (Cardano DApp registration standard), is a transaction with specific metadata describing your DApp. In general, the on-chain DApp registration process is similar to the on-chain Stake Pool registration process, but in this case the DApp developer references key information about their DApp (e.g. DApp name, logo, description, contacts, website, etc.) stored somewhere off-chain (e.g. DApp website, Github, etc.) on Cardano blockchain.
Initiate your DApp's on-chain registration journey by crafting an offchain-metadata.json file (list your DApp under one or several appropriate categories from this category list ["DeFi", "Development", "Education", "Games", "Identity", "Marketplace", "NFT", "Other", "Security"]). Seek inspiration from the 16 sample offchain-metadata.json files conveniently housed within the examples folder. Once this document is ready, upload onto any web platform – the DApp's website or a repository like Github Gist. Now, you can use that URL when the script asks you to input, which will be used for the onchain metadatada of the transaction.
Disclaimer: We do not support Windows
You will need a node.js installed in your system. You need a few tools to be available in your terminal:
Applications/Daedalus\ Pre-Prod.app/Contents/MacOS
in your $PATH (in case of other network replace pre-prod for preview or mainnet)cabal install bech32
export CARDANO_NODE_SOCKET_PATH=$USER/Library/Application\ Support/Daedalus\ Pre-Prod/cardano-node.socket
(in case of other network replace pre-prod for preview or mainnet)substituters = https://cache.nixos.org https://cache.iog.io
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
experimental-features = nix-command flakes auto-allocate-uids configurable-impure-env
allow-import-from-derivation = true
build-users-group = nixbld
nix develop
under the root of the project and answer the cli prompt if you want to run locally cardano-node instead using BlockfrostIn few places you will have to provide proper network parameter (--mainnet | --testnet-magic NATURAL)
--testnet-magic=2
--testnet-magic=1
There are three ways to set up a wallet.
phrase.prv
file in the root directory and fill it up with your mnemonic in space seperated format.chmod +x ./scripts/restore-mnemonic-wallet.sh
NETWORK=(preview|preprod|mainnet) LOCAL_NODE=(true|false) npm run restore-mnemonic-wallet
(Choose appropriate values of the NETWORK and LOCAL_NODE variables)If you have your payment.skey
, payment.vkey
, stake.skey
and stake.vkey
, then you can follow these steps
$ cardano-cli address build --payment-verification-key-file payment.vkey --stake-verification-key-file stake.vkey --out-file payment.addr
$ cardano-cli query protocol-parameters --out-file protocol.json (--mainnet | --testnet-magic NATURAL)
(Choose appropriate network parameter)chmod +x ./scripts/setup-new-wallet.sh
NETWORK=(preview|preprod|mainnet) LOCAL_NODE=(true|false) npm run setup-new-wallet
(Choose appropriate values of the NETWORK and LOCAL_NODE variables)payment.addr
file.npm install
.env.example-blockfrost
or .env.example-local-node
to the .env
file and edit it appropriately
cp .env.example-<blockfrost|local-node> .env
npm run start
Ref.: https://docs.cardano.org/development-guidelines/use-cli
Query UTXO
$ cardano-cli query utxo \
--address $(< payment.addr) \
(--mainnet | --testnet-magic NATURAL)
Output:
TxHash TxIx Amount
--------------------------------------------------------------------------------------
99b8fcac018828b6f6b29eb55211ac5e69a8651736c4c3d6280ca4524fd41778 0 9998003445 lovelace + TxOutDatumNone
To create draft transaction:
$ cardano-cli transaction build-raw \
--tx-in 99b8fcac018828b6f6b29eb55211ac5e69a8651736c4c3d6280ca4524fd41778#0 \
--tx-out $(cat payment.addr)+0 \
--metadata-json-file metadata.json \
--fee 0 \
--out-file tx.draft
To calculate the transaction fee:
$ cardano-cli transaction calculate-min-fee \
--tx-body-file tx.draft \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 1 \
--byron-witness-count 0 \
(--mainnet | --testnet-magic NATURAL) \
--protocol-params-file protocol.json
Then we calculate the total amount of our wallet minus the calculated fee as the total amount after transaction is complete\
$ expr 9998003445 - 180285 = 9997823160
To build final transaction:
$ cardano-cli transaction build-raw \
--tx-in 99b8fcac018828b6f6b29eb55211ac5e69a8651736c4c3d6280ca4524fd41778#0 \
--tx-out $(cat payment.addr)+9997823160 \
--metadata-json-file metadata.json \
--fee 180285 \
--out-file tx.draft
To sign the transaction:
$ cardano-cli transaction sign \
--tx-body-file tx.draft \
--signing-key-file payment.skey \
(--mainnet | --testnet-magic NATURAL) \
--out-file tx.signed
To submit the transaction:\
$ cardano-cli transaction submit --tx-file tx.signed (--mainnet | --testnet-magic NATURAL)