Create/Issue Tokens
info
UPDATE: The Syscoin Core RPCs used in the example below, and other SPT-oriented RPCs, have been deprecated and removed as of Syscoin Core 4.4.
Now syscoinjs-lib and syscointx-js are used to create/manage digital assets, auxfees, and notaries on the UTXO chain.
Examples are available at https://github.com/syscoin/syscoinjs-lib-examples.
For a complete list of these deprecated RPCs, review the Syscoin Core 4.4 release notes.
This guide helps you create and issue a Syscoin Platform Token (SPT) using Syscoin Core 4.3.
#
🚧Changes to the Syscoin Token Platform since Syscoin Core 3
- Non-Fungible Tokens (NFT), both fractional and non-fractional, are now supported
- All tokens are now UTXO-based (like Bitcoin) for greater efficiency instead of Account-based (like Ethereum)
- Tokens can now be used with Syscoin Bridge when Agent nodes are active
- Token creation fee is 1 SYS instead of 500 SYS
- New option: notary_address, notary_details (learn more)
- New option: auxfee_details (learn more)
- New option: contract (the contract of the token on the NEVM chain)
asset_guid
is the unique identifier of a token- Tokens are now address-only. On-chain aliases have been removed for greater scalability.
- P2PWKH and P2WSH are the current supported witness programs. Future witness programs may be included in Bitcoin Core and Syscoin Core enhancements to extend functionality.
#
1. Ensure your wallet has over 1 SYS to fund asset creation and other operationsThe token creation fee is currently 1 SYS. You'll also need extra to serve as a gas fund for the token, and for future transactions such as updating your token spec.
If you need to send 1 or more SYS to your wallet, wait until your transaction has at least one confirmation, then proceed.
#
2. Define and create your tokenWe will now define then create the SPT using the assetnew
command. This command will sign and broadcast the transaction to the network, and return the transaction ID.
In this example we will create a very basic SPT without using the contract
, aux_fees
and notary
options.
#
📘aux_feesThe aux_fees parameter is used to specify a custom fee structure for your token. Learn about aux_fees and how to use them.
Summary of assetnew
arguments:
A standard fungible token looks as follows:
A non-fractional (indivisible), non-fungible token can be created as follows with precision set to zero and max supply 1.0:
A fractional (divisible) non-fungible token is created when a token is issued via assetsend
with a NFTID specified. See section 4b(i) below.
Record the assigned asset GUID for future use.
Wait for this transaction to receive at least one confirmation, then proceed.
#
3. Check the token specificationReview your token specification as it exists on the Syscoin blockchain by executing this command: assetinfo <assetGUID>
It should look similar to this and reflect the attributes you have most recently set:
The total supply will remain "0" until you use assetsend
to issue some of the tokens.
📘A note on issuance: The difference between
assetsend
andassetallocationsend
#
assetsend
is not for sending existing tokens from one address to another (asset allocation), it is strictly for issuance of tokens by the owner of the token specification.Token users can learn how to perform basic asset allocations with
assetallocationsend
here.
#
4. Issue Fungible TokensThis step covers how to issue a quantity of fungible tokens into circulation.
assetsend
will issue and allocate a designated quantity of tokens to an address. It also signs and broadcasts the transaction to the network, and returns the transaction ID.
Summary of assetsend
arguments:
In this simple example we will not specify an NFTID - leave this blank. The issuance is handled as fungible when NFTID is not used. We will include a small amount of SYS for gas.
Our command for issuing a fungible portion of 425 tokens is as follows:
#
4b. Issue Non-Fungible TokensThis step covers how to issue and transfer a non-fungible token to its first owner. To issue fungible tokens, go to subsection 4a.
Syscoin 4.2 enables issuers to optionally assign a unique identifier to an issuance, which effectively makes it an NFT. Using assetsend
with NFTID will issue and allocate a non-fungible token to an address. It also signs and broadcasts the transaction to the network, and returns the transaction ID.
Further, Divisible and Non-Divisible NFTs can be issued. This article covers how to do both.
#
📘NFT DataThe issuer-assigned ID of an NFT is stored on the Syscoin blockchain (NFTID). Beyond the unique identifier, storage of any detailed-oriented data associated with the asset is the responsibility of the issuer, and isn't stored on the Syscoin blockchain. This is part of what keeps the Syscoin blockchain and its NFT functionality efficient and scalable.
The issuer-assigned NFTID is a 4 byte unsigned integer with a max value of 4294967295. Syscoin Core also assigns a unique identifier of the same byte-length and type to ensure global uniqueness on the blockchain. The total footprint of an NFT is only 8 bytes greater than a standard fungible token.
#
4b(i). How to Issue and Transfer a Fractional (Divisible) Non-Fungible TokenIn this example we will work with a testnet asset representing an inventory of up to 1,000 serialized 100oz gold bars, 6 of which have already been issued to owners.
1. issue another entire bar (1 new token) and identify it with the serial number stamped on the physical asset by the Royal Canadian Mint (13077), and send to a designated recipient address - in this case an address for which you hold the key. Send a small amount of SYS for gas to be used in the future, too.
2. Transfer 12.7251% ownership of the bar (56167720748738) to another address by using assetallocationsend
. We will also send the address a small amount of SYS for gas to be used in the future. We'll make the transaction use Z-DAG by specifying to be false
.
#
4b(ii). How to Issue and Transfer a Non-Fractional Non-Fungible TokenIn this example we will start with a testnet asset representing the inventory of an art vault.
This asset was defined with a precision of 0 and a max supply of 288, because there are 288 art pieces held in the vault, and ownership of each of these will be transferred to one owner as a non-divisible token representing the entirety of the piece
#
📘NoteYou can also create an asset with precision 0 and max supply 1, effectively making the primary asset itself a non-divisble NFT. However, it's often more intuitive to issue multiple unique non-divisible tokens from a single parent asset (the inventory). This is more cost effective as you pay the asset creation fee only once (1 SYS) and are able to issue a quantity of unique child NFT's up to the max supply of the parent asset, only paying the comparatively small fee associated with
assetsend
for each new NFT.Children assets inherit the attributes of the parent and are unique only by their NFTID and deterministic child assetGUID. If you want each NFT you issue to use a different Notary API, on-chain description, etc, you would use
assetnew
and pay the asset creation fee for each of them.
Issue one of the art pieces into the new owner's possession with assetsend
in the amount of 1 token, and assign the NFTID (your own numeric identifier representing the art piece), in this case 14, your inventory number for Andy Warhol's original Self Portrait. We'll also send the new owner a small amount of SYS for gas to be used in the future (0.000098).
The new owner can now transfer ownership using assetallocationsend
with <asset_guid> 4684082515