Syscoin 3 Alias Creation
Or, How I Learned To Stop Worrying and Love the Command Line
Before we start – please read this post fully! It will only take a few minutes, and you will feel much more comfortable creating your alias. Don’t worry about all the text, I included a lot of detail but these are the only commands you actually need to run – it’s mostly cutting and pasting.
aliasnew YOUR_ALIAS "" 3 EXPIRATION YOUR_ALIAS_ADDRESS "" "" "" syscointxfund ALIAS_HEX '{"addresses": ["YOUR_FUNDING_ADDRESS"]}' signrawtransaction RAW_HEX syscoinsendrawtransaction SIGNED_HEX
Getting Started
To use any Syscoin Alias service you will first need to enable the address index in the Syscoin Core by adding addressindex=1
to your syscoin.conf
file, then restarting Syscoin Core Qt and reindexing (it will prompt you when you restart). If you are using syscoind
directly you will need to run syscoin-cli stop
followed by syscoind -reindex
to trigger the reindexing process.
The process to create a Syscoin Alias is just 4 commands. You will need to run them once to reserve your alias, then a second time after waiting for a block confirmation to finalize your alias registration. You will need a small amount of SYS available, and either an existing address (funded or unfunded) or a new address to assign to the alias.
When selecting an expiration timestamp you will need to use Unix Epoch Time. Determine your expiration time by using a site such as https://www.epochconverter.com/ and make sure to only select 1 or 2 years for your expiration – aliases become exponentially more expensive and be quite pricey to reserve for a very long time.
If you’re wallet is encrypted (and it should be!) then you will need to unlock you wallet with `walletpassphrase ‘YOUR_PASSSPHRASE’ 1800` to unlock it for 30 minutes (1800 seconds).
It is recommended to create a new address to use to fund your alias creation transaction – you can do this by sending 1 SYS to a new address in your wallet and noting the address for later use when funding your alias creation transaction.
Alias Creation via RPC
First, get familiar with the aliasnew command. You can read the help below or run syscoin-cli help aliasnew
to see it on your system.
aliasnew [aliasname] [public value] [accept_transfers_flags=3] [expire_timestamp] [address] [encryption_privatekey] [encryption_publickey] [witness] <aliasname> alias name. <public value> alias public profile data, 256 characters max. <accept_transfers_flags> 0 for none, 1 for accepting certificate transfers, 2 for accepting asset transfers and 3 for all. Default is 3. <expire_timestamp> Time in seconds. Future time when to expire alias. It is exponentially more expensive per year, calculation is FEERATE*(2.88^years). FEERATE is the dynamic satoshi per byte fee set in the rate peg alias used for this alias. Defaults to 1 hour. <address> Address for this alias. <encryption_privatekey> Encrypted private key used for encryption/decryption of private data related to this alias. Should be encrypted to publickey. <encryption_publickey> Public key used for encryption/decryption of private data related to this alias. <witness> Witness alias name that will sign for web-of-trust notarization of this transaction.
If you are running these commands from the command line and not the Syscoin Core Qt Console, just add “syscoin-cli” before each command, otherwise follow them filling in your details where there are capital letters.
aliasnew
In these examples YOUR_ALIAS
is the alias name you want to register, in lower case (ironically). Replace YOUR_ALIAS_ADDRESS
with the address you want to associate with your alias (possibly your masternode staking address?). For the EXPIRATION
use https://www.epochconverter.com/ to generate the expiration in Unix Epoch time – no more than a year or two is strongly recommend due to exponentially increasing fees.
aliasnew YOUR_ALIAS "" 3 EXPIRATION YOUR_ALIAS_ADDRESS "" "" ""
[ "00740000010ae45894ba90b24c5120db9354d44fc93f17b86dcc269eddd8111f2454c629f20200000000feffffff02f1020000000000005e515140313463626631663365313533636633656166643736346530396262303532373239336134343935353934333936363536323665353436656533633531316364646d7576a91464c63b4b3398452a32a8d9f47b42ee63d2a59cac88ac85c2e59a000000001976a914c1da47e228637af983e1c75172506eabd77962c188acf4040000", "TKA43ch9qBVh7H8LmfSNFN5GqPsXfLyNqJ" ]
syscointxfund
Copy the hex string result from the aliasnew
command (the top part), which we will call ALIAS_HEX
below to keep it readable. Replace YOUR_FUNDING_ADDRESS
with the address you want to fund the transaction with – note that the change from this transaction will be sent to a new address, so it’s best to fund with a different address than you want to have your SYS associated with.
ALIAS_HEX
=output from aliasnew, “0074000….” in the example aboveYOUR_FUNDING_ADDRESS
=address to fund tx
syscointxfund ALIAS_HEX '{"addresses": ["YOUR_FUNDING_ADDRESS"]}'
[ "007400000179347c7191687ee50469bb8cb8a50a978db51651f482e114d24a6ba926a027ed010000001976a914572b8c4219a138984742c46b231f63afaad6688c88acffffffff02b80b0000000000005e515140373137383831646139346264353934343335383837363766373739343538386134373966313064613163373862313235373333623664373165386262623666326d7576a9149ec5c7b6544d752575ed7672d7984b5aceb14cd588ac534c0609000000001976a9147dc19cec3f574a85d94f2b05186bf3fec39f170588ac00000000" ]
signrawtransaction
The result of this command is the raw transaction hex, which we will call RAW_HEX
from now on, again for brevity. Next you need to sign this raw transaction with your private key before it can be submitted.
RAW_HEX
=output from syscointxfund
signrawtransaction RAW_HEX
{ "hex": "00740000010ae45894ba90b24c5120db9354d44fc93f17b86dcc269eddd8111f2454c629f2020000006a47304402200be0e27776d44cb9ce69dc683c5d1fc41aceca4131392957181f25d40eae186b02201ac64cdbd219f6e587f347d87f5f72f36a22a85050a8c4d79e0d9e3adb29eff9012103d0f289fbb510b953fa5cecc20cf70f95a249c6e30cc8fec292b45a0637120a19feffffff02f1020000000000005e515140313463626631663365313533636633656166643736346530396262303532373239336134343935353934333936363536323665353436656533633531316364646d7576a91464c63b4b3398452a32a8d9f47b42ee63d2a59cac88ac85c2e59a000000001976a914c1da47e228637af983e1c75172506eabd77962c188acf4040000", "complete": true }
syscoinsendrawtransaction
This gives us a signed transaction hex that we can submit to the network which we will call SIGNED_HEX
. Now, submit it to the network to reserve your alias.
SIGNED_HEX
=output from signrawtransaction
syscoinsendrawtransaction SIGNED_HEX
{ "txid": "d4a5ecdd111978082862f2b2ebc199f29158dd5f397df3117dd68e791ed9f446" }
Wait, and repeat…
The result of this is the transaction id that was submitted to the network. Now we need to wait for a couple of blocks before we can confirm the alias reservation to complete the registration. Check the current block height so you know where to start.
> getinfo
{ "version": "3.0.4.1", "dashversion": "0.12.3", "protocolversion": 70221, "walletversion": 3000000, "balance": 26.42070085, "privatesend_balance": 0.00000000, "blocks": 36817, "timeoffset": 0, "connections": 8, "proxy": "", "difficulty": 137061451496.0324, "testnet": false, "keypoololdest": 1525736009, "keypoolsize": 1999, "unlocked_until": 0, "paytxfee": 0.00000000, "relayfee": 0.00010000, "errors": "" }
In the results you can see "blocks": 36817,
though it will be higher when you run these commands :). Wait for a minute or two, then run it again to check the height. After a couple of blocks you are ready to continue. Enter the same four commands again entering exactly the same information for aliasnew
but updating each with the response of the commands the second time you run them.
Confirm Registation
aliasnew YOUR_ALIAS "" 3 EXPIRATION YOUR_ALIAS_ADDRESS "" "" "" syscointxfund ALIAS_HEX '{"addresses": ["YOUR_FUNDING_ADDRESS"]}' signrawtransaction RAW_HEX syscoinsendrawtransaction SIGNED_HEX
Finished!
Now you’re done! You can check the status of your alias with the following commands. Fund your alias by sending to either your alias name or the underlying address.
aliasinfo YOUR_ALIAS aliasbalance YOUR_ALIAS
Getting
SYSCOIN_ALIAS_RPC_ERROR: ERRCODE: 5505 – Encryption keys cannot be empty (code -1)
for aliasnew on the latest version
why do you have to do it twice?
It prevents a man in the middle attack, the first time it reserves the alias and then the second time it confirms it. If you try to modify it (passing in a different address for example) then the confirmation will fail.
Heya, my balance always shows “0” when i run “aliasbalance YOUR_ALIAS”.
Sent Syscoin from an address to the address associated with my new created alias but still nothing. Any opinions?
If you funded the alias transaction with the same address that you assigned to the alias then the funds were probably sent to a change address. You can check the underlying address with
aliasinfo YOUR_ALIAS
. The easiest way to send all your SYS to your alias is to use Coin Control in Syscoin Core Qt and select all the inputs not associated with your alias to send to your alias address, selecting to deduct fees from the amount. If you need more help I recommend trying Slack – good luck!The last picture is misleading because you use syscoin-cli and since you assumed all commands from QT, best to maintain it here as well.
Thanks, updated!