CurrencyMint
Generates new currency units for mintable currencies. Minting requires solving a hash puzzle based on the currency's mining algorithm.
Request
POST /nxt?requestType=currencyMint
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
secretPhrase | string | Miner's secret passphrase (must be the currency issuer) | Yes |
currency | long | Currency ID | Yes |
nonce | long | Unique nonce for this minting attempt | Yes |
unitsQNT | long | Number of units to mint | Yes |
counter | long | Sequential counter per currency/account (prevents replay) | Yes |
feeRateQNTPerFXT | long | Transaction fee rate | Optional |
deadline | int | Transaction deadline in minutes | Optional |
Minting Process
- The hash calculation is based on submitted data and the currency's hash algorithm
- The resulting hash is compared to the target value derived from current difficulty
- If the hash is smaller than the target, the currency units are generated into the sender account
- It is recommended to calculate the hash offline before submitting
- Use the GetMintingTarget endpoint for the current target
Constraints
- Only the currency issuer can mint
- Each mint transaction can generate at most 0.01% of total supply
- Total supply must exceed 10,000 for minting to be possible
- The
countervalue must be monotonically increasing to prevent double-spending
Response
{
"transaction": "1234567890123456789",
"fullHash": "abc123...",
"errorCode": 0,
"errorDescription": ""
}
Error Handling
| Error | Condition |
|---|---|
NOT_CURRENCY_ISSUER | Sender is not the currency issuer |
NOT_ENOUGH_CURRENCY | Insufficient balance for transaction fee |
Example
curl -X POST http://localhost:22024/nxt \
-d "requestType=currencyMint" \
-d "secretPhrase=your_phrase" \
-d "currency=987654321" \
-d "nonce=123456789" \
-d "unitsQNT=1000000" \
-d "counter=1"