Monetary System

From Nxt Wiki
Jump to: navigation, search
This page contains changes which are not marked for translation.

Other languages:
Deutsch • ‎English • ‎français • ‎русский • ‎українська

Introduction

The Nxt Monetary System features a special asset class currency secured by the Nxt network and blockchain. Virtual currencies with a variety of customizable properties can be created in minutes without the need for specialized hardware or a preexisting user base.

This guide describes the Monetary System, active on the Mainnet with a hard fork since block 330,000, per Nxt software release 1.4.12. It is based on the the primary documentation found here. Usage examples apply to the Nxt Client Interface.

Table of Contents

Monetary System Menu

The Monetary System is accessed by clicking on Monetary System in the left-pane menu area of the Nxt Client Interface, causing a submenu to appear:

MS menu.png



Monetary System: This item expands or contracts the submenu below and opens the Exchange Booth screen, where exchangeable currencies can be traded.
Currencies: This item displays a list of all currencies and their properties as shown in the All Currencies Screen.
Exchange History: This item displays completed exchanges (trades) associated with the logged-in account.
Issue Currency: This item opens a pop-up entry form for issuing or re-issuing a currency as described in Issue a Currency.



All Currencies Screen

MS currencies.png
  • The currency list is in order of most recently issued currencies.
  • The currency list can be restricted by entering a Code/Name search pattern in the Search Currencies field at the top. The search pattern is case-insensitive and can include the wildcards * and ?.
  • Clicking on a currency code in the Code column opens a detail pop-up window which includes a Currency Distribution link to a list of holders of the currency.
  • Hovering over the symbols in the Type column reveals the Currency Types.
  • The Current Supply is reduced when a reservable currency is claimed or increased when a mintable currency is minted.
  • The Max Supply is the total supply of currency upon issuance for non-mintable currencies or the maximum supply of currency that can be achieved by minting.
  • Clicking on a highlighted button in the Actions column opens the Exchange Booth screen or a pop-up entry form to reserve the currency, when applicable.
  • Clicking on My Currencies in the upper right corner restricts the list to those currencies owned by the logged-in account as shown in the My Currencies Screen.

My Currencies Screen

MS my currencies.png
  • Clicking on a Transfer button opens the Transfer Currency pop-up entry form.
  • Clicking on a highlighted Offer button opens the Publish Exchange Offer pop-up entry form, when applicable.
  • Clicking on a highlighted Claim button opens the Claim Currency pop-up entry form, when applicable.
  • Clicking on All Currencies in the upper right corner returns to the All Currencies Screen

Issue a Currency

To issue or reissue a currency, click on Issue Currency on the Menu. A pop-up entry form appears:

MS issue.png

This entry form provides a few tips (by clicking on the green question marks), but some constraints on the fields are implied and only clarified through error messages that appear near the top of the form when improper values are specified. To minimize errors, follow these guidelines:

CURRENCY NAME: The name must be unique, three to ten characters long and longer than the currency code.

CURRENCY CODE: The code must be unique and composed of three to five upper case letters.

TYPE: Check the desired combination of currency types, subject these restrictions: Reservable requires exchangeable and/or claimable, as does controllable; but mintable requires exchangeable. Claimable requires reservable, non-mintable and zero initial supply. Refer to Currency Types below for more detail.

TOTAL SUPPLY: The total supply must equal the initial supply unless the currency is mintable or reservable. If mintable, the total supply is the maximum supply that can be achieved through minting. The total supply of a reservable currency is set at issuance to the reserve supply (entered as UNITS TO RESERVE in the reservable section of the form) and must be greater than the initial supply.

INITIAL SUPPLY: The supply of a mintable currency increases through the minting process; the initial supply (if any) is held by the issuer. The initial supply (if any) of a reservable currency is held by the issuer; but the initial supply of a claimable reservable currency must be zero.

DECIMALS: The number of allowed decimal places can be from zero to eight, but to avoid client rounding errors in rate calculations, it is recommended that a maximum of four decimal places be used.

ISSUANCE HEIGHT: This applies only to reservable currencies, and must be a blockchain height greater than the current value. Otherwise it must be zero.

FEE: The fee automatically adjusts to the number of letters in the currency code: 25000 NXT for three-letter codes, 1000 NXT for four-letter codes and 40 NXT for five-letter codes. The fee to reissue a currency is always 40 NXT, but for thee- and four-letter codes the displayed fee must manually be overridden by clicking on advanced.

Currency Types

Following are further details about the six currency types:

Exchangeable

Exchangeable currencies can be traded for the NXT currency in the Exchange Booth of the Nxt client, which operates differently than the Asset Exchange. A currency owner can publish a combined buy/sell offer pair with an expiration block height and quantity limits. Only one active offer per account is permitted. Requests to buy or sell offered currency can submitted by anyone. These exchange requests are executed immediately (fully or partially) or not at all if no matching offers are found.

Controllable

Controllable currencies can only be transferred to and from the issuing account, and if also exchangeable only the issuing account can publish offers.

Reservable

If Reservable is checked, two extra fields appear:

MS reserve.png

UNITS TO RESERVE: This is the total amount of the currency to reserve, the reserve supply. It will become the total currency supply when the issuance height is reached, unless the minimum amount below is not achieved by then. It must therefore equal TOTAL SUPPLY and be greater than INITIAL SUPPLY.

MINIMUM AMOUNT OF NXT PER WHOLE UNIT NEEDED TO ACTIVATE CURRENCY: Assuming the currency code COIN, this is the minimum amount of NXT per COIN needed to back the currency. For example, if the reserve supply is set to 1000 COIN and the minimum amount per reserve unit is 0.2, then at least a combined 200 NXT must be pledged by supporters to back the COIN currency before the issuance height. If this minimum requirement is met or exceeded in time, each pledged supporter becomes a founder and receives a portion of the difference between the initial supply and the reserve (now total) supply of the COIN currency. If the minimum is not met in time, the currency will be deleted and all pledged NXT will be unlocked and returned to supporters. If the minimum is met or exceeded, all pledged NXT will either remain locked until claimed if claimable or be transfered to the issuer otherwise.

Claimable

Claimable currencies are reservable currencies that allow the locked NXT reserves that back them to be claimed, meaning that a current holder of a claimable currency can exchange it for the locked NXT that backs it, in doing so reducing the Current Supply shown on the All Currencies Screen.

Mintable

If Mintable is checked, three extra fields appear:

MS mint.png

MINIMUM DIFFICULTY: The minimum difficulty (minimum 1).

MAXIMUM DIFFICULTY: The maximum difficulty (maximum 255 and greater than the minimum).

ALGORITHM: The hashing algorithm to use. Select SHA256, SHA3, Scrypt, or Keccak25.

  • A mintable currency is issued with an INITIAL SUPPLY of currency that can increase over time until the TOTAL SUPPLY is reached; thus TOTAL SUPPLY is better named MAXIMUM SUPPLY in this case.
  • The currency supply is increased through a minting process, governed by the above properties. Minting does not secure the currency as mining does for some other virtual currencies such as Bitcoin; the currency is already secured by the Nxt blockchain and network.

Non-Shuffleable

Non-Shuffleable currencies will not participate in coin shuffling (an anonymity feature) when it becomes available in the future. The default is to participate.

Delete a Currency

A currency can be deleted only when the total supply belongs to one account, and only by using the Delete Currency API call. However, a currency that can be deleted can also be reissued with different properties using Issue a Currency.

Transfer a Currency

To transfer a quantity of currency to another account, click on the Send Currency button at the top of the Nxt Client Interface. Alternatively, click on the Transfer link on the My Currencies Screen, or navigate to the Exchange Booth for the currency and click on the Transfer link there. The Transfer Currency pop-up entry form appears:

MS transfer.png

Recipient: Enter the recipient account ID.

Units: Enter the number of currency units to transfer, up to the number of Currency units available.

Exchange an Exchangeable Currency

Currency exchanges take place in the Exchange Booth, which appears when Monetary System is clicked on the Menu or when the Exchange link is clicked on the All Currencies Screen:

MS exchange booth.png
  • Click on the Offer link at the top to publish a buy/sell offer pair. Refer to Publish an Exchange Offer for details. Published offer pairs are displayed in the middle row, in order of most favorable rate.
  • Click on the green bar to request to buy offered currency with NXT. Open offers to sell currency for NXT are displayed just below. Refer to Submit an Exchange Request for details.
  • Click on the red bar to request to sell currency for offered NXT. Open offers to buy currency with NXT are displayed just below. Refer to Submit an Exchange Request for details.
  • Exchange requests from the logged-in account to buy or sell offered currency are listed in the lower left area, most recent on top. If the request is italicized, it is pending. As soon as a pending request is confirmed (by inclusion in a block), it is executed based on available offers at that moment. All non-italicized requests have already been processed and possibly ignored if no matching offers were found. Old offers continue to be displayed until dropping off the bottom of the list, but they will not be processed again even if a new matching offer appears.
  • Executed exchange requests (trades) from all accounts are listed in the lower right area, most recent on top. Click on My Exchanges to display only those associated with the logged-in account. This list is short; old exchanges (trades) fall off the bottom. For a complete list, click on Exchange History on the Menu

Publish an Exchange Offer

The Publish Exchange Offer pop-up entry form appears when the Offer button is clicked on the Exchange Booth screen, or alternatively on the My Currencies Screen:

MS offer.png

Buy units (Initial): The initial amount of currency offered to buy.

Buy units (Limit): The total amount of currency to buy.

Buy Rate per unit: The exchange rate offered to buy currency (in NXT per unit of currency).

Sell units (Initial): The initial amount of currency offered to sell.

Sell units (Limit): The total amount of currency to sell.

Sell Rate per unit: The exchange rate offered to sell currency (in NXT per unit of currency).

Expiration Height: The block height at which the offer expires; it must be greater than the current height.

  • Whenever an exchange request is executed against an offer, the respective limit is reduced by the amount of the exchange (trade).
  • An offer pair, once published, will persist until the expiration height is reached or until both limits become zero. If one limit becomes zero before the other, that half of the offer pair is withdrawn.
  • The offered amounts can decrease or increase from their initial values; they decrease when an exchange request is executed, but they increase when an exchange request of the opposite type is executed if the limit permits.
  • Only one active offer is permitted per account; new offers replace existing offers.

Submit an Exchange Request

The Exchange Request drop-down entry forms appear when the green and red bars are clicked in the Exchange Booth:

MS request.png

The green buy request form has identical fields to the red sell request form. Only the direction of the exchange (trade) is different.

Units: The amount of currency to exchange. When selling, it sets the exchange limit rather than Total, meaning that Units will not be exceeded but Total could be exceeded.

Rate: The least favorable (to the requester) exchange rate (in NXT per unit of currency) required. The request will be executed at a more favorable rate if possible.

Total: The amount of NXT to exchange. This read-only field is automatically computed as Units * Rate. When buying, it sets the exchange limit rather than Units, meaning that Total will not be exceeded but Units could be exceeded.

Fee: The minimum and default fee for a request is 1 NXT.

  • The exchange request is submitted when the blue Exchange button is clicked, but will not be executed until confirmed (included in a block). Once confirmed, the request will be immediately executed (fully or partially) if any matching offers are found, otherwise it will be permanently ignored.

Exchange Example

Offer

Complete the offer form as follows:

  • Buy units (Initial): 5
  • Buy units (Limit): 10
  • Buy Rate per unit: 1
  • Sell units (Initial): 10
  • Sell units (Limit): 20
  • Sell Rate per unit: 2

Once the offer is confirmed on the blockchain, the Exchange Booth screen shows:

MS example offer.png

Request to Buy

Complete the green buy request form as follows:

  • Units: 20
  • Rate: 3

While the request is pending, the Exchange Booth screen shows:

MS example request pending.png

  • While the request is pending, it is italicized.

Once the request is confirmed on the blockchain, the Exchange Booth screen shows:

MS example request confirmed.png

  • The Units, Rate and Total columns in the Exchange Requests and Executed Exchanges sections have the same units as on the request form. Units is the amount of currency exchanged, Rate is the exchange rate in NXT per currency unit, and Total is the amount of NXT exchanged, always equal to Units * Rate.
  • The requested amount of currency was greater than the amount offered, and the offered rate was more favorable to the requester than the requested rate, so the offered amount and rate prevailed, as shown in the Executed Exchanges section.
  • The request was executed immediately upon confirmation, but continues to be displayed in the Exchange Requests section. Even though the request was only partially filled, it becomes obsolete after execution; the request will not be fully met even if a new matching offer appears in the future.
  • All of the initial amount of currency offered to sell (10 units) was sold, so the sell half of the offer pair was temporarily withdrawn. But it could reappear if the supply of currency to sell is replenished by a sell exchange request being executed against the buy offer. Up to 10 more units could be sold in this way, because the sell limit is now 10 units, having been reduced from 20 units.
  • The amount of currency offered to buy increased from the initial 5 units to 10 units, the buy limit. It would have increased to 15 if the buy limit was 15 or greater, due to the 10 units sold. Thus the Exchange Booth allows an offer publisher the opportunity to automatically replenish sold currency.
  • Clicking on a timestamp in the Exchange Requests section opens a detail pop-up window showing all executed exchanges resulting from a request; clicking on the timestamps of any of those executed exchanges opens an offer detail window, which in turn shows initial and current supplies and limits along with all executed exchanges against that offer, plus exchange totals. The offer detail window can also be opened by clicking on a height value in the Offers to Exchange section, and the request detail window can also be opened by clicking on a timestamp in the Executed Exchanges section.

Request to Sell

Complete the red sell request form as follows:

  • Units: 20
  • Rate: 0.5

Once the request is confirmed on the blockchain, the Exchange Booth screen shows:

MS example sell request.png

  • The requested amount of currency was greater than the amount offered, and the offered rate was more favorable to the requester than the requested rate, so the offered amount and rate prevailed, as shown in the Executed Exchanges section.
  • All of the currency offered to buy (10 units) was bought, so the buy half of the offer pair was withdrawn permanently because the buy limit became zero.
  • The amount of currency offered to sell increased from 0 units to 10 units, the remaining sell limit; the bought units replenished the currency supply and so the sell half of the offer pair reappeared.
  • Notice that the buyer and seller are the same account. The Monetary System allows this but still charges a fee even though no currency or NXT is actually exchanged. This is a method for effectively withdrawing an offer before it expires.

Reserve a Reservable Currency

The Reserve Currency pop-up entry form appears when the Reserve button is clicked on the All Currencies Screen:

MS reserve currency.png

Amount of NXT per currency unit: This value is multiplied by the Reserve Supply amount to determine the amount of NXT to be pledged to back the currency, displayed as Amount of NXT reserved.

  • If the entered amount of NXT per currency unit is 1.5 and the reserve supply is 100, 150 NXT will be pledged to back the currency. This will be displayed as Amount of NXT reserved on the form if this read-only field is clicked.
  • The minimum amount of NXT per unit of currency that must be pledged by all supporters of the currency combined in order to activate (issue) the currency is displayed as Activation Per Unit Reserve. This value was specified as MINIMUM AMOUNT OF NXT PER WHOLE UNIT NEEDED TO ACTIVATE CURRENCY on the Issue Currency form. The combined amount of NXT that must be pledged is this value multiplied by Reserve Supply.
  • The amount of NXT per unit of currency already pledged by other supporters is displayed as Current Per Unit Reserve. The corresponding amount of NXT already pledged is this value multiplied by Reserve Supply.
  • In this example, 200 NXT must be pledged by all supporters combined to activate (issue) the currency. 100 NXT have already been pledged; at least 100 NXT more is required. If 150 NXT are pledged now, the minimum will have been met (and exceeded) and the currency will be issued at the issuance height.

Founders

All pledges of support can be viewed on the Currency Founders pop-up window, which can be opened by clicking on the currency code on the All Currencies Screen then clicking on Click here to view this currency's Founders. If the minimum combined pledge is reached by the issuance height, the pledged supporters will become the founders of the currency. In this example, there are two pledged supporters:

MS founder.png

  • The Amount Reserved column shows the amount of NXT pledged by each supporter, which upon activation (issuance) becomes NXT reserve backing the currency. These values are computed by multiplying the Reserve Units (elsewhere named Reserve Supply) by the Amount per Unit column.
  • The Founders Units column shows the portions of the currency Reserve Supply to be distributed among pledged supporters of the currency upon activation (issuance), in proportion to the Amount Reserved
  • The Percent of Minimum column shows what percentage each supporter has contributed to meeting the minimum reserve requirement. If the total reaches 100%, the currency will be activated (issued) at the issuance block height. In this example, the total has already exceeded 100% and so the currency will be activated (issued) 5 blocks from now.
  • If the minimum reserve requirement were not to be met in time, the currency would be deleted and all pledges would be returned. When the minimum is met or exceeded in time, all pledged NXT either remain locked until claimed if claimable or are transfered to the issuer otherwise.
  • If the currency is activated (issued), the Founders table freezes as a permanent record, and the Reserve Supply becomes the total supply of the currency.

Claim a Claimable Currency

The Claim Currency pop-up entry form appears when the Claim button is clicked on the My Currencies Screen:

MS claim.png

Number of units: The number of units of currency to claim up to the displayed maximum of Number of units to claim, the amount of currency held by the logged-in account.

  • The Claim rate (in NXT per currency unit) multiplied by the entered Number of units is the amount of NXT that will be unlocked and transfered to the currency holder.
  • In this example, if the maximum amount of 80 units is claimed, 40 NXT will be transfered to the logged-in account, reducing the Current Supply shown on the All Currencies Screen by 80 units.

Mint a Mintable Currency

The Nxt client interface does not provide a minting mechanism. Minting requires a separate tool that makes use of following Nxt API calls:

  • Get Minting Target returns a target hash; a nonce must be found such that its hash is less than the target hash. The difficulty of computing a valid nonce increases as the currency supply increases, according to the MINIMUM and MAXIMUM DIFFICULTY properties entered in the Issue a Currency form. The hashing algorithm applied to the nonce must be the one selected as the ALGORITHM property in that same form.
  • Currency Mint submits the computed nonce in exchange for newly minted currency, increasing the Current Supply shown on the All Currencies Screen.

A reference minting tool that uses the API is the Java Mint Worker Utility, included with Nxt Software. In its current form, it can only use a CPU for hashing computations. It is hoped that in the future it will be enhanced to include support for GPUs and ASICs.

External Links