Sidechain

The Scrypta Sidechain protocol is described in the appropriate section. Here we see how to interact with Sidechains through IdA Node enpoints.

[POST] /sidechain/issue

This endpoint is used to create a Sidechain, the internal processes are described in the "Emission" chapter of the dedicated section. We recommend the creation of a new personal address directly from the web server, so as to be able to manage the tokens via graphical interface. 1 LYRA is also required in the address balance, otherwise the creation will not be successful.

Here are the fields needed to start a new Sidechain:

  • dapp_address: the address that will become the sidechain owner.

  • private_key: private key of the owner's address.

  • pubkey: public key of the owner's address.

  • version: the protocol version is currently 1

  • name: descriptive name of the sidechain.

  • symbol: alphanumeric ticker of the sidechain.

  • supply: the amount of tokens to be created.

  • decimals: the number of digits with which the token can be divided.

  • burnable: can be true or false and determines whether or not the token can be sent to the trustlink address to perform a token burn.

  • reissuable: it can be true or false and determines whether the token is fixed supply or can be reissued later.

If all went well, the new sidechain will be displayed here: https://sidechain.scryptachain.org and the available balance will also be visible.

[POST] /sidechain/reissue

This endpoint is used to reissue tokens within an existing sidechain. This process can only be done by the sidechain owner and only if it has been marked as reissuable.

Here are the fields to send to reissue tokens:

  • dapp_address: the owner's address.

  • sidechain_address: the sidechain's address.

  • private_key: the owner's private key.

  • pubkey: the owner pubkey.

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

The answer will contain the information necessary to verify that everything went well and you will see this new reissue transaction in the list of your unspent.

[POST] /sidechain/send

Through this enpoint it is possible to send the tokens to another address. To do this it is necessary to send the following fields:

  • from: the address from which you want to send tokens.

  • private_key: the private key of the address that sends the tokens.

  • pubkey: the public key of the address that sends the tokens.

  • sidechain_address:the address of the sidechain.

  • to: the address that will receive the tokens.

  • amount: the amount to be sent. Remember to respect the division of the decimals. The IdaNode rounds the figure to ensure the accuracy and operation; a possible discrepancy involves sending a rounded amount, therefore different from the one requested.

As you can see, the answer is very similar to that of writing any other data:

{
"uuid": "9ae3751c.5448.46df.adf3.07626213bc01",
"address": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"fees": 0.011000000000000003,
"collection": "",
"refID": "",
"protocol": "chain://",
"dimension": 771,
"chunks": 11,
"stored": "*!*9ae3751c.5448.46df.adf3.07626213bc01!*!!*!!*!chain://*=>{\"transaction\":{\"sidechain\":\"6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH\",\"inputs\":[{\"sxid\":\"c623e7d599b335bd60f3ca371824ea0882bad80173f76e8d1c454173b4fca763\",\"vout\":1,\"address\":\"LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2\",\"amount\":99080.5986,\"sidechain\":\"6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH\",\"block\":482119}],\"outputs\":{\"LMnX7FrofprX5UY5M1KjsYAdhkCVL5vR1i\":18,\"LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2\":99062.5986},\"time\":1574700620860},\"signature\":\"037595724e395b1c01472871f542465c3264299f7c079d477d21c6d0a75e8c177f9ac99c73d38c680f189ab543be02e951656e6a76913adc45e93fd59f512d43\",\"pubkey\":\"027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0\",\"sxid\":\"8db6cf7c0de249607d8771b12f318ae7c7173eb965b675e55fcb807f96e4186a\"}*!*",
"txs": [
"bd8415460b31d4fad510b1f2f3e41ee410c1240935774489f16352378fd004f6",
"49029166c852ff00a5215ee95020bfd5c20e770adccfe3fa44c1508de84df797",
"c433fcba4fb2c59262feb3b2f07aca8a48b69c0abdafe38e609b16af70ffa1b1",
"08d32aa928d40980fa10ab662e3512b2090ad1bc9c256673b2c60199e0ac2bfc",
"2e8295fa1a5dcd47370aefe33cc7ff4941abd37d0d67846fe442d46a266a8806",
"18f9f72a1a8c30e326bf3937886443db9d36530f218f2bbb3b32729913c8e402",
"416490028397c5bd221af56e87e6529b6520ab0a2409c980ea280950ffbd3d68",
"7f42b6698494d2057ad96ec9dd09ad65d09547a13ee839a1f7619b07c309b7d8",
"c4dcc0d68131ebcc3cfaa0cbe12141055caf6903d527d2967a261316a1d53002",
"fe9ce2fe695e8c99e969c3f14382c7b56d13bd681f5b38337355b30e2c7f3b62",
"f81feaaf0a2fea766dacc97bbf060b214cfe435578ce42d2dc460da8e96022a5"
]
}

[POST] /sidechain/balance

This operation allows you to view your balance at a specific sidechain. The following fields must be sent:

  • dapp_address: the Lyra address you want to inspect.

  • sidechain_address: the address of the sidechain.

The answer will be similar to this:

{
"balance": 99062.5986,
"symbol": "TST",
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH"
}

[POST] /sidechain/transactions

It allows you to view transactions made from an address at a specific sidechain. The following fields must be sent:

  • dapp_address: the LYRA address you want to inspect.

  • sidechain_address: the address of the sidechain.

The answer will be something like this:

{
"transactions": [
{
"sxid": "5aa7b97e1b22eec134781af42d11501f0701b771451dda9be4361b5a0f07eaa1",
"from": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"to": "LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT",
"amount": 10,
"block": 482075
},
{
"sxid": "0ac9210cd4dbd08550a1ca7501ed7336c6ee1e0700791518ff7c3bdbaa0db22f",
"from": "LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT",
"to": "LNmYWqaU5qrZcHxCA2vVTMmvKcaXBdjKUZ",
"amount": -50,
"block": 482061
},
{
"sxid": "ac6b491fa140464427b3cb933796a4820d22a454d125d6e744b7fcce8b6acac5",
"from": "LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT",
"to": "LRJRsP9ZhszTNAmtubwiSzzLFGn4DfZZcU",
"amount": -150,
"block": 481989
},
{
"sxid": "e861776c7bb7425da282930572add577deeb5581e0c6b5dd29640ff2a9305f99",
"from": "LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT",
"to": "LR7nXWy7gb8LhGvgWkaGaLqDm4uvSAKqJc",
"amount": -34,
"block": 481918
},
{
"sxid": "39bd8b6fe8b470e606e044216be3c5c26fc364e49e6d28893f117b314e2f9724",
"from": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"to": "LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT",
"amount": 112,
"block": 481913
},
{
"sxid": "f8743b1d468ec8982c325a7e8fd050112952a7d0c294f218596c249703207ea2",
"from": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"to": "LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT",
"amount": 229.4934,
"block": 480427
}
],
"symbol": "TST",
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH"
}

[POST] /sidechain/listunspent

Allows you to view expendable transactions (USXO) from an address at a specific sidechain. The following fields must be sent:

  • dapp_address: the LYRA address you want to inspect

  • sidechain_address: the address of the sidechain.

The answer will be similar to this:

{
"unspent": [
{
"sxid": "8db6cf7c0de249607d8771b12f318ae7c7173eb965b675e55fcb807f96e4186a",
"vout": 1,
"address": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"amount": 99062.5986,
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH",
"block": 482413
}
],
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH"
}

[POST] /sidechain/scan/address

Allows you to view all the sidechains with balance for a given address. Field to send:

  • dapp_address: the LYRA address you want to inspect.

The answer will be like:

{
"data": [
{
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH",
"symbol": "TST",
"balance": 555
}
],
"status": 200
}

[GET] /sidechain/list

Allows you to view all the sidechains created and valid within the Scrypta network. Example of answer:

{
"data": [
{
"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",
"address": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH"
},
{
"genesis": {
"name": "gioconda",
"supply": 1,
"symbol": "GIOC",
"decimals": "0",
"reissuable": "false",
"owner": "Lbj39Vysy4YUuAct9Yo2hFnETApQKV8EfK",
"pubkey": "02e40a0edd697bf59c38b26903f7f46401d312b4fac8fc3989ea0753db64444fbd",
"version": "1",
"time": 1574679790587
},
"signature": "12154510cde6d5179025ccb1176c1ec1fa486b57cbe80e6679a7bd46003f62517f1925e62a466abf9ff8c4ed2971021b8f7058ae4aa161d0562d134c5a967c2a",
"pubkey": "02e40a0edd697bf59c38b26903f7f46401d312b4fac8fc3989ea0753db64444fbd",
"sxid": "cb9c15f37b340b6988adee38a0175abe366325abeb21459bae6e97ab195c767d",
"address": "6WmU2zVLvDRkxHmqkiSETRmm89HtM2y4Wj"
}
],
"status": 200
}

[POST] /sidechain/scan

Allows you to view all the transactions of a specific sidechain. Field to send:

  • sidechain_address: the sidechain address is to be inspected.

Example of answer:

{
"data": [
{
"transaction": {
"sidechain": "6WmU2zVLvDRkxHmqkiSETRmm89HtM2y4Wj",
"inputs": [
{
"sxid": "8903dd2cc9428a0a879c7ee43376657d6a93a95f2d94830751eee5d9bb10fb4f",
"vout": 0,
"address": "LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT",
"amount": 1,
"sidechain": "6WmU2zVLvDRkxHmqkiSETRmm89HtM2y4Wj",
"block": 482128
}
],
"outputs": {
"LRJRsP9ZhszTNAmtubwiSzzLFGn4DfZZcU": 1
},
"time": 1574698567404
},
"signature": "1574c802484602234d0be73992f673d24526cd0580a64c3243e3680f2cd34c681164edc704344bc330979629732efb8921576e6d948ca482c539f259c9eb553d",
"pubkey": "030249ca95b9d10701d9dfb08cb43b79ee229c3c621a9d17b84320b61690e87d09",
"sxid": "baca71e1fb87faacca7b772b0c2ecaf3de13bcba4501b7a980bcda49d1dac484",
"block": 482383
},
{
"transaction": {
"sidechain": "6WmU2zVLvDRkxHmqkiSETRmm89HtM2y4Wj",
"inputs": [
{
"sxid": "992ba66c6cf9c1b4bd8375d9525909020ab9ebd208173e36547e1ae5581b2f3d",
"vout": 0,
"address": "Lbj39Vysy4YUuAct9Yo2hFnETApQKV8EfK",
"amount": 1,
"sidechain": "6WmU2zVLvDRkxHmqkiSETRmm89HtM2y4Wj",
"block": 482071
}
],
"outputs": {
"LchzGX6vqmanceCzNUMTk5cmnt1p6knGgT": 1
},
"time": 1574683028721
},
"signature": "972de254a686f1358c5de2c7ddd4a28da0e8b41e02f3c55971e97d10ff67911327a9335380575bd24cee5894ea3ee55ec4503f2a309cbf8d0fbc684d4625d08f",
"pubkey": "02e40a0edd697bf59c38b26903f7f46401d312b4fac8fc3989ea0753db64444fbd",
"sxid": "8903dd2cc9428a0a879c7ee43376657d6a93a95f2d94830751eee5d9bb10fb4f",
"block": 482128
},
{
"transaction": {
"sidechain": "6WmU2zVLvDRkxHmqkiSETRmm89HtM2y4Wj",
"inputs": [
{
"sxid": "cb9c15f37b340b6988adee38a0175abe366325abeb21459bae6e97ab195c767d",
"vout": "genesis"
}
],
"outputs": {
"Lbj39Vysy4YUuAct9Yo2hFnETApQKV8EfK": 1
},
"time": 1574679790945
},
"pubkey": "02e40a0edd697bf59c38b26903f7f46401d312b4fac8fc3989ea0753db64444fbd",
"signature": "b87e2de54fe6b8676c60b7fc050c39f7357c6cb863c088e40a8bb1222a54ab0422c64c89ff8892a6b8942168c2c87894672d3edcf964b0f018730aee5f6ff6a2",
"sxid": "992ba66c6cf9c1b4bd8375d9525909020ab9ebd208173e36547e1ae5581b2f3d",
"block": 482071
}
],
"status": 200
}

[POST] /sidechain/transaction

Allows you to view a specific SXID. The following fields must be sent:

  • sxid: the id of the transaction to be inspected.

  • sidechain_address: the address of the sidechain to which the transaction belongs.

The answer will be like this:

{
"transaction": {
"address": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"uuid": "99a60.a13e.4cf1.a7d9.18bf065885ee",
"collection": "",
"refID": "",
"protocol": "chain://",
"data": {
"transaction": {
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH",
"inputs": [
{
"sxid": "60cc5945f43cf91f12b5214fb402228106003aec857f867b8ab6624d7e410f1e",
"vout": 0,
"address": "LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2",
"amount": 100000,
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH"
}
],
"outputs": {
"LhhoDjf9pWenaAA89LqSGemr1KWBhr9uuZ": 555,
"LdRQokR1i3XDtj1V3jnCRqMPrVc7sYkeE2": 99445
},
"time": 1574525110177
},
"signature": "61d950526c8d381c389c899232f77eab7706aff3f2c0064768134d6c33dc53b06efb74d1483dcd9a643b1e87397164aea5e13c2c5d50c930a19416e31251bf55",
"pubkey": "027460a5f721e97f5e241d9767fb1b7fd778892e7c40684b79fcb4420d07d240e0",
"sxid": "c2f218f13325c052b16ed10a42ce5415155ec898d97fc7c8365d8cea33d4513b"
},
"block": 479518,
"blockhash": "8e616b72272143cc9f2d62bdb41d198932ecc8f3777814b1b367ec9266ae2bb5",
"time": 1574525178
},
"symbol": "TST",
"sidechain": "6RQ54yHx2dARWkN8Biiw3gDjb4sB5hSHSH"
}