TPoS Setup Guide

Hydranet Team
Stakenet
Published in
6 min readApr 10, 2018

This guide is for setting up a TPoS contract in XSN mainnet on a Windows OS. We have tried to explain this process as simple as possible.

DISCLAIMER:

1- This guide only works when the XSN wallet is updated to V1.0.6 or later for both parties. Please check with your merchant/owner to make sure both wallets are updated. Here you can download the latest version: https://github.com/X9Developers/XSN/releases

2- You should never send your coins to anyone; with TPoS contracts you only hand over the staking permission to a merchant using the TPoS UI in your wallet.

What is TPoS?

At its very core, the modern banking system is based on a simple paradigm — ‘Trust’. We give our money to banks and they provide us with services in return (deposits, loans, and investments). While we could perform these services ourselves, it has proven much more convenient to use this centralized, trust-based system.

To mitigate the potential for abuse presented by such a global centralized system, decentralized blockchain-based assets (such as Bitcoin) have been introduced. To secure a decentralized network and ensure users cannot double-spend their funds, Bitcoin utilizes a Proof-Of-Work (PoW) algorithm, which requires miners to prove that they’ve spent a certain amount of computational resources in order to make an attack on the network uneconomical. PoW networks aren’t financially ideal as only miners can receive block rewards and transaction fees in return for precious resources, whereas regular users do not see any ROI from holding their coins.

This is where Proof-Of-Stake (PoS) networks come in; the transaction confirmation mechanism shifts from a burden of proof of the expenditure of resources over to total stake held — transactions are confirmed by simple nodes who hold large balances, and the greater the balance the user holds, the more likely they are to receive fees and block rewards. While this significantly reduces the amount of resources required to confirm transactions and effectively allows the average user to see positive ROI on balances held, this system still requires a user to maintain connectivity at all times, to do so via a high-bandwidth connection, and for their wallets to be unlocked 24/7. During any timeframe in which all aforementioned conditions aren’t met, the user is skipped by the network and does not receive their fair share of stake rewards.

XSN has devised a solution to the problems being faced by users of decentralized networks today: Trustless Proof-Of-Stake (TPoS). TPoS essentially allows users to own a stake in XSN, a Proof-Of-Stake currency, and have any other node (merchant nodes) do the staking for them using their high-bandwidth continuous connectivity (to ensure maximal rewards distribution) while not having to share any spendable balance or private keys with the node owner. Your funds are yours and yours alone, and will safely and securely grow over time even while you sleep.

To accomplish this, we have created a multi-layered cryptographic architecture that expands the private-public key paradigm, called Triplet-Based Encryption. This three-layered model will feature a public key, which serves as a public address and stores unspent balances, a private key, which can authorize the spending of a balance stored on the public address it was used to create, and a “shared” key. The shared key is created whenever a user chooses to allow a merchant node operator to stake their funds and its sole purpose is to authorize the staking of a user’s balance. It cannot spend or move the balance around; for those the private key is required. Now that a user has a new key that can be used for remote staking only and the private key no longer needs to be disclosed, the concept of trust is once again eliminated, allowing the economics of the XSN network to prosper. We believe TPoS will be the next stage of evolution in terms of guaranteeing ROI on balances, and our adoption strategy will ensure it becomes the standard across financial services worldwide.

How to be an Owner

DISCLAIMER:

This guide only works when the XSN wallet is updated to V1.0.6 or later for both parties.

Please check with your merchant/owner to make sure both wallets are updated. Here you can download the latest version: https://github.com/X9Developers/XSN/releases

So how to be an owner? It’s pretty simple. Input merchant address (the address that merchant gives you), amount and commission in TPoS UI + click ‘Stake’.

How to be a merchant

DISCLAIMER: 1- This guide only works when the XSN wallet is updated to V1.0.6 or later for both parties.

Please check with your merchant/owner to make sure both wallets are updated. Here you can download the latest version: https://github.com/X9Developers/XSN/releases 2- If you wish to simply TPoS your own coins and not provide services for others you can ignore the controller — remote titles and execute steps 1–9 all on 1 machine/VPS.

Step 1

On your controller wallet, create new address (enter getnewaddress in Debug Console) and copy this address in a notepad/word file.

Step 2

Send the address from step 1 to the owner you want to TPoS with, and have him create the contract in his UI using your address.

Step 3

Again in debug console execute dumpprivkey ‘result of step1’ and copy the output in a notepad/word file.

Step 4

On controller wallet, in debug console execute tposcontract list to get the txid of the contract the coin owner has created. Copy this txid to the notepad/word file. You also can see the TPoS address (owner’s address) here.

Step 5

Still on your controller wallet, go to XSNcore folder (C:\Users\(the pc name)\AppData\Roaming\XSNCore), open merchantnode.conf (using notepad) and input the following line: TPOS1 ‘merchant node IP’:62583 ‘private key’ ‘txid’ Take private key from step 3 and txid from step 4. Restart your wallet.

Step 6

On your remote wallet, go to XSNcore folder, open xsn.conf (using notepad) and input the following lines and restart your wallet: rpcuser=long random username rpcpassword=longer random password rpcallowip=127.0.0.1 listen=1 server=1

daemon=1

logtimestamps=1

maxconnections=256

merchantnode=1

externalip=’merchant IP’:62583

merchantnodeprivkey=’private key from step 3’

Step 7

On controller wallet, make sure you have restarted your wallet, open debug console and input the following commad: merchantnode start-alias TPOS1

Step 8

On controller’s wallet, in debug console input merchantnode list-conf It will give you a list of your TPoS contracts. Right after step 7, your contract will be PRE-ENABLED.

You should wait for your contract to get ENABLED, it usually takes 15–30 minutes.

Step 9

As soon as your contract gets ENABLED, input the following command on your remote wallet:

setgenerate true 1 true ‘txid from step 4’ With this command the merchant node starts staking.

How to be a merchant for several owners?

If you want to be merchant for several coin owners, you should have a control wallet (like a person who has several masternodes), have one unique IP address per contract and manage your nodes with your control wallet. For each contract you should add a separate line in merchantnode.conf of your control wallet (Step 5). You also should do step 7 on your controller wallet and step 6 and 9 on your VPS (remote wallet or TPoS node).

Join our discord — https://discord.gg/cyF5yCA if you have any question.

--

--