DecentralChain (DCC) icon

DecentralChain (DCC)

Create, sign and broadcast DecentralChain transactions, plus query blockchain data

Overview

This node facilitates creating, signing, and optionally broadcasting a "Burn Tokens" transaction on the DecentralChain blockchain. Burning tokens means permanently destroying a specified amount of a particular asset, effectively reducing its total supply.

Typical use cases include:

  • Reducing circulating supply of a token to increase scarcity.
  • Removing tokens from circulation as part of a tokenomics strategy.
  • Correcting token balances by burning erroneous or excess tokens.

For example, a user holding a custom token can burn 100 units (in smallest divisible units) to decrease the total supply, signaling scarcity or value adjustment.

Properties

Name Meaning
Base URL The base URL of the DecentralChain node API to connect to if no credential is supplied.
Authentication Method How the transaction will be signed: Seed Phrase, Private Key, or create an Unsigned transaction.
Seed Phrase Secret seed phrase used for signing transactions (required if using Seed Phrase auth).
Private Key Private key used for signing transactions (required if using Private Key auth).
Sender Public Key Public key of the sender; required when creating unsigned transactions.
Chain ID Network identifier: Mainnet (?) or Testnet (!).
Auto Broadcast Whether to automatically broadcast the signed transaction to the network after creation.
Asset ID Identifier of the asset/token to burn.
Amount to Burn Quantity of the asset to burn, expressed in the smallest units (e.g., satoshis).

Output

The node outputs a JSON object containing:

  • transaction: The created transaction object with details such as type, id, proofs, and signature presence.
  • broadcastResult (optional): If auto-broadcast is enabled and successful, contains the response from the blockchain node confirming broadcast.
  • status: Indicates whether the transaction was just created (created), successfully broadcast (broadcasted), or if broadcasting failed (broadcast_failed).
  • broadcastError (optional): Error message if broadcasting failed.
  • debug: Contains metadata about the operation, including chain ID, authentication method, base URL, transaction ID, timestamp, and transaction details like type and version.

If auto-broadcast is disabled or the transaction is unsigned, only the transaction creation details are returned without broadcasting info.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a DecentralChain node API endpoint (configurable via Base URL or credentials).
  • Uses an external library for transaction creation and signing (@decentralchain/waves-transactions or compatible).
  • Requires either a seed phrase or private key credential for signing unless creating unsigned transactions.
  • Optional network configuration via Chain ID to specify mainnet or testnet.
  • If auto-broadcast is enabled, requires network connectivity to submit the transaction to the blockchain node.

Troubleshooting

  • Library Loading Failure: If the underlying transaction library fails to load, the node falls back to mock functions which do not perform real transactions. Ensure the environment has the required dependencies installed.
  • Invalid Attachment Errors: Although not directly relevant to burn operation, other operations may fail if attachments exceed size limits or are invalid base58.
  • Broadcast Failures: Errors during broadcasting usually indicate network issues, incorrect node URL, or invalid transaction signatures. Check the error message in broadcastError for details.
  • Missing Required Parameters: The node requires assetId and quantity for burning tokens. Omitting these will cause errors.
  • Authentication Issues: Using incorrect or missing seed phrase/private key will prevent signing and cause failures.
  • Unsigned Transactions: When creating unsigned transactions, the senderPublicKey must be provided; otherwise, transaction creation will fail.

To resolve common errors:

  • Verify all required fields are correctly set.
  • Confirm that the Base URL points to a valid DecentralChain node.
  • Ensure credentials (seed phrase or private key) are correct and have sufficient permissions.
  • Enable detailed logging/debugging to inspect transaction creation and broadcasting steps.

Links and References

Discussion