Skip to main content

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

NameTypeDescriptionRequired
secretPhrasestringMiner's secret passphrase (must be the currency issuer)Yes
currencylongCurrency IDYes
noncelongUnique nonce for this minting attemptYes
unitsQNTlongNumber of units to mintYes
counterlongSequential counter per currency/account (prevents replay)Yes
feeRateQNTPerFXTlongTransaction fee rateOptional
deadlineintTransaction deadline in minutesOptional

Minting Process

  1. The hash calculation is based on submitted data and the currency's hash algorithm
  2. The resulting hash is compared to the target value derived from current difficulty
  3. If the hash is smaller than the target, the currency units are generated into the sender account
  4. It is recommended to calculate the hash offline before submitting
  5. 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 counter value must be monotonically increasing to prevent double-spending

Response

{
"transaction": "1234567890123456789",
"fullHash": "abc123...",
"errorCode": 0,
"errorDescription": ""
}

Error Handling

ErrorCondition
NOT_CURRENCY_ISSUERSender is not the currency issuer
NOT_ENOUGH_CURRENCYInsufficient 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"