Emission

One of the first problems faced in the Sidechain protocol of Scrypta concerns the uniqueness of the token and consequently the secure issue of the token itself. The uniqueness of the token cannot clearly be referred to the user-creator, as it could maliciously try to "copy" another token to check its balance.

The resolution to this first problem occurred by introducing the Trustlink in the creation process. The Trustlink is made between the user who wants to issue the token and the IdaNode that is invoked. To guarantee the uniqueness, horizontality and non-replicability of the Sidechain we decided to generate this address on-the-fly and burn the private key immediately after writing the first genesis transaction.

Genesis transaction

The necessary fields, defined by the user, for the genesis of the token are the following:

  • name: The name of the token, this is a purely descriptive field and the uniqueness is not guaranteed. For your safety and that of your users, create a name that characterizes the project.

  • symbol: alphanumeric token ticker.

  • decimals: The potential division of the token, can also be 0 and the token will not be divisible.

  • reissuable: If the token is fixed supply or can be reissued.

  • burnable: determines whether the token can be "burned" or not.

  • version: The protocol version is currently 1.

It is possible to test the issue of a sidechain directly via the graphic interface at this link: https://sidechain.scryptachain.org/#/create

Creation Process

The creation process involves the following steps:

  1. Definition of genesis fields

  2. Creation of a new address by IdaNode

  3. Trustlink creation

  4. Sending a minimum of 1 LYRA by the owner to the Trustlink

  5. Writing on the blockchain of the genesis transaction

  6. Sending the entire supply by the Trustlink to the Sidechain owner

When the Trustlink transfers the entire supply to the owner, it is possible to start making transactions using the first transaction as USXO (UTXO related to the sidechain).

Issuing Example

Here is the typical answer of the Ida Node following the creation of a new token:

{
"issue": {
"genesis": {
"name": "tScryptaToken",
"supply": 100000,
"symbol": "TST",
"decimals": "8",
"reissuable": "false",
"owner": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"pubkey": "027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0",
"version": "1",
"time": 1574499539348
},
"signature": "ad6af516d89d9610e17296d10b63d2bd26bb34cd29157860f8d68314f469b2dd521d16c969d8fbd9af5b377b18095f9716b1f1de782662f33d74f585295d210e",
"pubkey": "027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0",
"sxid": "325179d9602bd342c2e5fa15771d5f1490e519f2560eef752bf5c9a6f592cdd5"
},
"funds_txid": "810dba7c891220058c9745942177651751ac0a33a2494317884829fe10c85520",
"sidechain": {
"uuid": "f7757e33.9892.4d5c.8de8.977a95f65a57",
"address": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH",
"fees": 0.009000000000000001,
"collection": "",
"refID": "",
"protocol": "chain://",
"dimension": 618,
"chunks": 9,
"stored": "*!*f7757e33.9892.4d5c.8de8.977a95f65a57!*!!*!!*!chain://*=>{\"genesis\":{\"name\":\"tScryptaToken\",\"supply\":100000,\"symbol\":\"TST\",\"decimals\":\"8\",\"reissuable\":\"false\",\"owner\":\"LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2\",\"pubkey\":\"027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0\",\"version\":\"1\",\"time\":1574499539348},\"signature\":\"ad6af516d89d9610e17296d10b63d2bd26bb34cd29157860f8d68314f469b2dd521d16c969d8fbd9af5b377b18095f9716b1f1de782662f33d74f585295d210e\",\"pubkey\":\"027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0\",\"sxid\":\"325179d9602bd342c2e5fa15771d5f1490e519f2560eef752bf5c9a6f592cdd5\"}*!*",
"txs": [
"928eb4a8e0cc5ab73e625e0d33c3a0de0c81af843cdc4d33d4823908dbc86b8e",
"a52efca66ffcb1513cb0c8ec74641c4d551a9057d179ce4b41af88ee70c21939",
"4fca012f893cc8e13ad1bb4907d4c2ecafd7be920e335d7d56bd4c0e1bfb4e62",
"c1135d8b98186d6e30e5093d0e01434f784ac14cd9a2837dcc1fb028cdbcc814",
"30e1388c44da9b0094e6f25e09b3b7630dcd060d2c33a63ea48b42fc08eaa531",
"13cf04afd9b1717df94749029de08dd14dc3f41bff9a129d1edd578b636e726c",
"36becc354ab609536c9bd939ba310f3f83e4e6a7f1b037fabb7c6a3d0203b731",
"0b00c5779a40b88c2ab610ae4bfa4e30f74bfd8a01bdfc915a930f7ba64b31e1",
"28e6c27cf9436f3ea90848d71f568faaee8148de65ba143c8b94b520dc6e4ccb"
]
},
"genesis": {
"uuid": "aa0bfac6.9c04.4e7a.9357.a97ce85db56f",
"address": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH",
"fees": 0.008,
"collection": "",
"refID": "",
"protocol": "chain://",
"dimension": 583,
"chunks": 8,
"stored": "*!*aa0bfac6.9c04.4e7a.9357.a97ce85db56f!*!!*!!*!chain://*=>{\"transaction\":{\"sidechain\":\"6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH\",\"inputs\":[{\"sxid\":\"325179d9602bd342c2e5fa15771d5f1490e519f2560eef752bf5c9a6f592cdd5\",\"vout\":\"genesis\"}],\"outputs\":{\"LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2\":100000}},\"pubkey\":\"027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0\",\"signature\":\"55617773eef21c3526bc96e3002b229b4cd59c2f5511971171cef1a5665bc47d4e9c26ad057c0a6a964707224aac3a4b85e78756b3a9430c1ebe86a31bd140e3\",\"sxid\":\"60cc5945f43cf91f12b5214fb402228106003aec857f867b8ab6624d7e410f1e\"}*!*",
"txs": [
"9dacba6935fa0bbcca9b2dd53434634c7d2c1bbc624539daf4c24f12da6098ca",
"a8ae6fc8316b5f46788570517a92bb73d7c30ef97448339ba266aa541f2d7601",
"2382f1382371727d3f343446430734592a35a607fd85f22bdca9923f61b5243b",
"651c30212f6e8cf4bbc2f433e3be2cfe092960737ca78a29f6f3705c8cf54c5e",
"15b5e6285914becc4fd04441a7fffb75f54b809d9c1957030b110b980c823cf2",
"6aaad72ae7198eda3496dd136cce24817ecc78bc63a188bdac6e15800ca58e09",
"683d56b318db63cde7513b4633da31216045f18db446db2952cb393ee89d8e4d",
"ce17605b2d0cba97adbe0d4d665b217974c5667a59b8a74f0c092de2b9b8fe4a"
]
},
"issued": true
}

Reissue Process

Reissue process If we have established that the token is indefinite, it is possible for the owner to create transactions similar to the genesis transaction to reissue the token at a later time. The choice to create a fixed or variable supply token is solely up to the user and this setting cannot be changed later.

The reissuing process is very simple, you need to call the endpoint /sidechain/reissue as described in the section concerning the IdaNodes, by sending the following fields:

  • dapp_address: the owner's address.

  • sidechain_address: the sidechain's address.

  • private_key: the owner's private key.

  • pubkey: the owner's pubkey.

  • supply: The amount of tokens you want to reissue.

Following this call, the answer will be very similar to that of genesis:

{
"reissue": {
"reissue": {
"sidechain": "6VheKpdJZD7dv6xCP8cEgaXFAMZ7HtgMvK",
"owner": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"supply": 1777,
"time": 1577088825519
},
"signature": "2e8dad74fb222f7d6f081d87287cc8fbeaf338c27dd3b43a5c162ae31439519f079812a7e84565a3c8e34a342d8638ff157900e1ae946178476c23d85cad602a",
"pubkey": "027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0",
"sxid": "ea772733c8c7e87f08d30e7774b4e6181e3fcac2b002cb1e3ea6746f5ed3724f"
},
"written": {
"uuid": "1b9189ec.f58a.4c55.afb6.4da23564a8a4",
"address": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"fees": 0.007,
"collection": "",
"refID": "",
"protocol": "chain://",
"dimension": 499,
"chunks": 7,
"stored": "*!*1b9189ec.f58a.4c55.afb6.4da23564a8a4!*!!*!!*!chain://*=>{\"reissue\":{\"sidechain\":\"6VheKpdJZD7dv6xCP8cEgaXFAMZ7HtgMvK\",\"owner\":\"LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2\",\"supply\":1777,\"time\":1577088825519},\"signature\":\"2e8dad74fb222f7d6f081d87287cc8fbeaf338c27dd3b43a5c162ae31439519f079812a7e84565a3c8e34a342d8638ff157900e1ae946178476c23d85cad602a\",\"pubkey\":\"027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0\",\"sxid\":\"ea772733c8c7e87f08d30e7774b4e6181e3fcac2b002cb1e3ea6746f5ed3724f\"}*!*",
"txs": [
"24148a68dbe4559e153feb6c0c2e022305c54f1f818db7299dbd8a1bcdec0e63",
"9937b70c439d8e410ceac564d431b9f80e89e715c965c50bfcc262d447777997",
"bb5828f381f0e7119cb9f4bc1848eddfd62fe06f843bbfa986a7da7724c49d16",
"ef109c64273d28dcfc20bf2d35b353135b022e2dc68a0e6cf4a5f173c862a23d",
"94cecbfd4a9ebb1382756bf9152b84fd9e3077c5e553218a5480d6f0a8235725",
"d84e5b8cadf5675c48cf8e6d6fb756389b1a9038923b58bc98e2d973cd300261",
"39437091ef99967049b5c89d1aa3a9bf8b44bc1c1d411c10893bcfb361bb9cbe"
]
},
"unspent": {
"uuid": "1b9189ec.f58a.4c55.afb6.4da23564a8a4",
"address": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"fees": 0.009000000000000001,
"collection": "",
"refID": "",
"protocol": "chain://",
"dimension": 602,
"chunks": 9,
"stored": "*!*bb315710.22ff.426c.b1a7.f20796c37eaf!*!!*!!*!chain://*=>{\"transaction\":{\"sidechain\":\"6VheKpdJZD7dv6xCP8cEgaXFAMZ7HtgMvK\",\"inputs\":[{\"sxid\":\"ea772733c8c7e87f08d30e7774b4e6181e3fcac2b002cb1e3ea6746f5ed3724f\",\"vout\":\"reissue\"}],\"outputs\":{\"LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2\":1777},\"time\":1577088826253},\"pubkey\":\"027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0\",\"signature\":\"e86612bbf59a80ed7367aa67aa10d30445c4515080f2804586b9a50d7a959c4e00abf17dc2375fb5aa75d62942ca785556ab51a6663226c5dd47f83fc2759462\",\"sxid\":\"0b3f0ec772b9cbef01cb67c824a982c30924e5c5b75ccdf95bacf283c0ed759e\"}*!*",
"txs": [
"1982ec304e4d35d652e9e02d5e240b15ae07c23e37c2c681f56a832f915e5352",
"7917b069d4262a21d1628542aa34acfa7e925248c2a51af0cc5cd304ce148a62",
"ccec9488c6a2baed342d1f8d63affa65bc20f589a55c05482c44e0955b38acb3",
"63dd3734a2feee14070bb71cda507b7cc36100e6ae1407f559d06bb93bf1c6fe",
"404f2a35ac4ea8e2866f960b5a9c9e8e33ff061853a04b65ce3215088aebb02f",
"89c5ce47285da1bff8cbda226912169992011cf4813fa3d9ee9374817ec84b0c",
"29ddcf7ce7effbbc4b6f8a34d4bea569c61be0afa7c842258a784fd8f78ac3aa",
"595b7cc6e09ea8cf1a14609628340fce2fe410624a77db29b0d739af412a5ae3",
"8b71443058da520f1b34c764e44404d686092be2affd5449723f3eea34bff9bd"
]
},
"status": 200
}