Package nxt.http

Class IssueCurrency


  • public final class IssueCurrency
    extends APIServlet.APIRequestHandler
    Issue a currency on the NXT blockchain

    A currency is the basic block of the NXT Monetary System it can be exchanged with NXT, transferred between accounts, minted using proof of work methods, reserved and claimed as a crowd funding tool.

    Pass the following parameters in order to issue a currency

    • name - unique identifier of the currency composed of between 3 to 10 latin alphabetic symbols and numbers, name must be no shorter than code. name and code are mutually unique.
    • code - unique 3 to 5 letter currency trading symbol composed of upper case latin letters
    • description - free text description of the currency limited to 1000 characters
    • type - a numeric value representing a bit vector modeling the currency capabilities (see below)
    • ruleset - for future use, always set to 0
    • maxSupply - the total number of currency units which can be created
    • initialSupply - the number of currency units created when the currency is issued (pre-mine)
    • decimals - currency units are divisible to this number of decimals
    • issuanceHeight - the blockchain height at which the currency would become active For CurrencyType.RESERVABLE currency
    • minReservePerUnitNQT - the minimum NXT value per unit to allow the currency to become active For CurrencyType.RESERVABLE currency
    • reserveSupply - the number of units that will be distributed to founders when currency becomes active (less initialSupply) For CurrencyType.RESERVABLE currency
    • minDifficulty - for mint-able currency, the exponent of the initial difficulty. For CurrencyType.MINTABLE currency
    • maxDifficulty - for mint-able currency, the exponent of the final difficulty. For CurrencyType.MINTABLE currency
    • algorithm - the hashing algorithm used for minting. For CurrencyType.MINTABLE currency

    Constraints

    • A given currency can not be neither CurrencyType.EXCHANGEABLE nor CurrencyType.CLAIMABLE.
    • A CurrencyType.RESERVABLE currency becomes active once the blockchain height reaches the currency issuance height.
      At this time, if the minReservePerUnitNQT has not been reached the currency issuance is cancelled and funds are returned to the founders.
      Otherwise the currency becomes active and remains active until deleted, provided deletion is possible. When a CurrencyType.RESERVABLE becomes active, in case it is CurrencyType.CLAIMABLE the NXT used for reserving the currency are locked until they are claimed back. When a CurrencyType.RESERVABLE becomes active, in case it is non CurrencyType.CLAIMABLE the NXT used for reserving the currency are sent to the issuer account as crowd funding.
    • When issuing a CurrencyType.MINTABLE currency, the number of units per CurrencyMint cannot exceed 0.01% of the total supply. Therefore make sure totalSupply > 10000 or otherwise the currency cannot be minted
    • difficulty is calculated as follows
      difficulty of minting the first unit is based on 2^minDifficulty
      difficulty of minting the last unit is based on 2^maxDifficulty
      difficulty increases linearly from min to max based on the ratio between the current number of units and the total supply
      difficulty increases linearly with the number units minted per CurrencyMint
    See Also:
    CurrencyType, HashFunction