# How to register cross chain assets

As the value embodiment of the chain, the most direct embodiment of the value interoperability between the chains is the transaction of the assets between the chains. However, before the cross chain transaction of assets, we need to register the assets across the chains.

# Register parallel chain cross chain assets

In the process of registering cross chain, parallel chain registers assets as cross chain assets by default:

  • Command: registercrosschain <address>、<chainId>、<chainName>、<addressPrefix>、<magicNumber>、<maxSignatureCount>、<signatureBFTRatio>、<verifierList>、<asserId>、<symbol>、<assetName>、<initNumber>、 [decimalPlaces]、[minAvailableNodeNum]
Parameter Explain
< address > primary network address, number of nuls is not less than 1000, used to register cross chain
< chainid > Chain ID, unique ID [10-65535]
< chainname > chain name
< addressprefix > address prefix (1-5 characters, upper case)
< magicnumber > magic parameter (8 digits)
< maxsignaturecount > maximum number of signatures (recommended: 100)
< signaturebftratio > Byzantine proportion of signatures (0-100, recommendation: 66)
< verifierlist > chain verifier list (seed block address, multiple addresses separated by commas)
< asserid > asset ID (recommended: 1)
< Symbol > asset symbol (eg: nuls)
< assetname > asset name
< initnumber > total asset issuance
[DecimalPlaces] asset decimal, default 8
[minavailablenodenum] minimum number of connections, default 5

Returns:

{
  "mainNetVerifierSeeds" : "tNULSeBaMsWM1DWppv2H5AUjoxRALv8Rx1JL1V,tNULSeBaMgn16tSzn3Tr6EobmZ9UAfAwD9gPXt,tNULSeBaMjdg2vMBNG3RXeduADiiHbypgBtrfM",
  "txHash" : "c9c2e6518afb0359817ccc74eff1a7d0e4f7ceab3fc5f86095a2b748622992bb",
  "mainNetCrossConnectSeeds" : "192.168.1.139:18002,192.168.1.137:18002,192.168.1.140:18002"
}
1
2
3
4
5

Example

nuls>>> registercrosschain tNULSeBaMqpRQkHCs5ur3ck4LXEZB4qmmkPNo3 4 nerve TNVT 20200422 100 66 TNVTdN9i5aCwKBhaGeUZExLLLB8WtUSWxekcp,TNVTdN9iFcMpYz5eVz41gdETPGNqqbFA8FfSf,TNVTdN9i7xo3PmLj376B17Qntng3DyVio4Bqd 1 TVNT nerve 100000000 8 3
Please enter the password.
Enter your password:********
{
  "mainNetVerifierSeeds" : "tNULSeBaMsWM1DWppv2H5AUjoxRALv8Rx1JL1V,tNULSeBaMgn16tSzn3Tr6EobmZ9UAfAwD9gPXt,tNULSeBaMjdg2vMBNG3RXeduADiiHbypgBtrfM",
  "txHash" : "c9c2e6518afb0359817ccc74eff1a7d0e4f7ceab3fc5f86095a2b748622992bb",
  "mainNetCrossConnectSeeds" : "192.168.1.139:18002,192.168.1.137:18002,192.168.1.140:18002"
}
1
2
3
4
5
6
7
8

# Add parallel chain assets that need to cross the chain in the main chain

Parallel chain is multi asset. Registered cross chain parallel chain can add other assets of the chain on the main network to participate in cross chain

  • Command: addcrossasset <address><assetChainId> <assetId> <assetName><symbol> <initNumber> [decimalPlaces]
Parameter Explain
& lt; address & gt; primary network address, number of nuls is not less than 1000, used to register cross chain assets
& lt; assetchainid & gt; Chain ID, unique ID [10-65535]
& lt; assetid & gt; asset ID
& lt; assetname & gt; asset name
& lt; Symbol & gt; asset symbol
& lt; initnumber & gt; total issues
& lt; decimal places & gt; decimal places

Returns

143a0f6ec36778c7991544b8acca74dbc4433d0a0d17f188465c01d26786a65c
1

Example

nuls>>> addcrossasset tNULSeBaMqpRQkHCs5ur3ck4LXEZB4qmmkPNo3 4 2 eth ETH 100000000 8
Please enter the password.
Enter your password:********
143a0f6ec36778c7991544b8acca74dbc4433d0a0d17f188465c01d26786a65c
1
2
3
4

# Remove parallel chain assets of cross chain transactions in the main chain

The parallel chain is multi asset. When the cross chain transaction of the asset is to be stopped on the main network, the removal instruction is used. If the last asset is left, the corresponding chain will stop working and the parallel chain will be cancelled after the instruction is executed

  • Command: disablecrossasset <address><chainId><assetId>
Parameter Explain
& lt; address & gt; address used to register cross chain assets
& lt; chainid & gt; write off the chain ID of the asset
& lt; assetid & gt; asset ID of write off asset

Returns

eb58da9321543c3a97f6d20721d3a9892a21fa630ccc6061a7b43c2229bb2f64
1

Example

nuls>>> disablecrossasset tNULSeBaMqpRQkHCs5ur3ck4LXEZB4qmmkPNo3 3 1
Please enter the password.
Enter your password:********
eb58da9321543c3a97f6d20721d3a9892a21fa630ccc6061a7b43c2229bb2f64
1
2
3
4

# Query parallel chain registration information

Query the registration information of a parallel chain in the main network

  • Command:crosschaininfo <chainId>
Parameter Explain
<chainId> Chain ID of the registration chain

Returns(see Example)

Example

nuls>>> crosschaininfo 4
{
  "chainId" : 4,
  "chainName" : "nerve",
  "addressType" : "1",
  "addressPrefix" : "TNVT",
  "magicNumber" : 20200422,
  "minAvailableNodeNum" : 3,
  "regAddress" : "tNULSeBaMqpRQkHCs5ur3ck4LXEZB4qmmkPNo3",
  "regTxHash" : "c9c2e6518afb0359817ccc74eff1a7d0e4f7ceab3fc5f86095a2b748622992bb",
  "createTime" : 1587628283,
  "verifierList" : [ "TNVTdN9i5aCwKBhaGeUZExLLLB8WtUSWxekcp", "TNVTdN9iFcMpYz5eVz41gdETPGNqqbFA8FfSf", "TNVTdN9i7xo3PmLj376B17Qntng3DyVio4Bqd" ],
  "signatureByzantineRatio" : 66,
  "maxSignatureCount" : 100,
  "selfAssetKeyList" : [ "4-1", "4-2" ],
  "totalAssetKeyList" : [ "4-1", "4-2" ],
  "mainNetVerifierSeeds" : "tNULSeBaMsWM1DWppv2H5AUjoxRALv8Rx1JL1V,tNULSeBaMgn16tSzn3Tr6EobmZ9UAfAwD9gPXt,tNULSeBaMjdg2vMBNG3RXeduADiiHbypgBtrfM",
  "mainNetCrossConnectSeeds" : "192.168.1.139:18002,192.168.1.137:18002,192.168.1.140:18002",
  "enable" : true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

返回Parameter说明

parameter required type description
chainId true int Chain identification
chainName true string Chain name
addressType true int Address type of the account created on the chain: 1ecological and non ecological
addressPrefix true string Address prefix 1-5 capital letters or numbers
magicNumber true string Network magic parameter
minAvailableNodeNum true int Minimum number of available nodes
regAddress true string Registered payment address
regTxHash true string Transaction hash
createTime true long Transaction submission time, seconds difference in 1970
verifierList true string Verifier list
signatureByzantineRatio true int Byzantine proportion [66-100]
maxSignatureCount true int Maximum number of signatures
selfAssetKeyList true string Asset symbol
totalAssetKeyList true string Asset name
mainNetVerifierSeeds true string Primary network seed verifier address
mainNetCrossConnectSeeds true string Primary network seed connection node address
enable true string In use or not

# Query the information of parallel chain registered assets

Query the registration information of a parallel chain asset on the main network

  • Command:crosschaininfo <chainId> <assetId>
Parameter Explain
<chainId> ID of the registration chain
<assetId> Asset ID

Returns(see Example)

Example

nuls>>> crossassetinfo 4 1
{
  "chainId" : 4,
  "assetId" : 1,
  "symbol" : "TVNT",
  "assetName" : "nerve",
  "depositNuls" : "100000000000",
  "destroyNuls" : "20000000000",
  "initNumber" : "10000000000000000",
  "decimalPlaces" : 8,
  "enable" : true,
  "createTime" : 1587628283,
  "address" : "tNULSeBaMqpRQkHCs5ur3ck4LXEZB4qmmkPNo3",
  "txHash" : "c9c2e6518afb0359817ccc74eff1a7d0e4f7ceab3fc5f86095a2b748622992bb"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Return parameter description

parameter required type description
chainId true int Chain identification
assetId true int Asset ID
symbol true string E.g. BTC for short
assetName true string Asset name
depositNuls true long Number of main network assets mortgaged
destroyNuls true long Number of main network assets destroyed
initNumber true string Initial value of assets
decimalPlaces true int Number of assets that can be cut
enable true boolean Available or not true available, false disabled
createTime true long Transaction generation time
address true String Transaction payment address
txHash true String Transaction hash

# Restore parallel chain registration in main chain

After the parallel chain is registered and logged out in the main network, if it needs to be restored, you can restore and update the information through the following command, which needs to run in the main network node

  • Command: updatecrosschain <address>、<chainId>、<chainName>、<addressPrefix>、<magicNumber>、<maxSignatureCount>、<signatureBFTRatio>、<verifierList>、<asserId>、<symbol>、<assetName>、<initNumber>、 [decimalPlaces]、[minAvailableNodeNum]
Parameter Explain
<address> Main network address, number of nuls is not less than 1000, used to register cross chain
<chainId> Chain ID, unique ID [10-65535]
<chainName> Chain name
<addressPrefix> Address prefix (1-5 characters, uppercase)
<magicNumber> Magic parameter (8 digits)
<maxSignatureCount> Maximum number of signatures (recommended: 100)
<signatureBFTRatio> Signed Byzantine proportion (0-100, recommendation: 66)
<verifierList> List of chain verifier (address of seed block, multiple addresses separated by commas)
<asserId> Asset ID (recommendation: 1)
<symbol> Asset symbol (eg: nuls)
<assetName> Asset name
<initNumber> Total assets issued
[decimalPlaces] Asset decimal, default 8
[minAvailableNodeNum] Minimum connections, default 5

Returns

{
  "mainNetVerifierSeeds" : "tNULSeBaMsWM1DWppv2H5AUjoxRALv8Rx1JL1V,tNULSeBaMgn16tSzn3Tr6EobmZ9UAfAwD9gPXt,tNULSeBaMjdg2vMBNG3RXeduADiiHbypgBtrfM",
  "txHash" : "c9c2e6518afb0359817ccc74eff1a7d0e4f7ceab3fc5f86095a2b748622992bb",
  "mainNetCrossConnectSeeds" : "192.168.1.139:18002,192.168.1.137:18002,192.168.1.140:18002"
}
1
2
3
4
5

Example

nuls>>> updatecrosschain tNULSeBaMqpRQkHCs5ur3ck4LXEZB4qmmkPNo3 4 nerve TNVT 20200422 100 66 TNVTdN9i5aCwKBhaGeUZExLLLB8WtUSWxekcp,TNVTdN9iFcMpYz5eVz41gdETPGNqqbFA8FfSf,TNVTdN9i7xo3PmLj376B17Qntng3DyVio4Bqd 1 TVNT nerve 100000000 8 3
Please enter the password.
Enter your password:********
{
  "mainNetVerifierSeeds" : "tNULSeBaMsWM1DWppv2H5AUjoxRALv8Rx1JL1V,tNULSeBaMgn16tSzn3Tr6EobmZ9UAfAwD9gPXt,tNULSeBaMjdg2vMBNG3RXeduADiiHbypgBtrfM",
  "txHash" : "c9c2e6518afb0359817ccc74eff1a7d0e4f7ceab3fc5f86095a2b748622992bb",
  "mainNetCrossConnectSeeds" : "192.168.1.139:18002,192.168.1.137:18002,192.168.1.140:18002"
}
1
2
3
4
5
6
7
8

# Nrc20 asset registration cross chain assets

see Nrc20 token cross chain guide