Developers Portal. By builders, for builders.

Your resource for everything you'll need to build the future on FairCoin

Overview

FairCoin makes it easy for developers to integrate FairCoin into their applications.

FairCoin Developers Portal  is a developer resource that provides the essential concepts and references for building applications on FairCoin. Each concept and reference will focus on specific aspects of FairCoin development while providing additional details and usage examples.

FairCoin is a cutting edge cryptocurrency, fair, secure, and sustainable with many features not available in most other cryptocurrencies:

  • Anonymized transactions using coin mixing technology, we call it Coin Mixing.‍

  • Fast transactions featuring guaranteed zero confirmation transactions, we call it FastSend.

  • Decentralized blockchain voting providing for consensus based advancement of the current Masternodetechnology used to secure the network and provide the above features, each Masternode is secured with collateral of 25K faircoin.

Coin Specs

Ticker Symbol
FAIR
Algorithm
Quark
Type
PoW - PoS Hybrid*
Block Time
120 Seconds
Difficulty Retargeting
Every Block
Max Coin Supply
53,193,831 FAIR
Premine/Initial Supply
90%
FairCoin Created Per block
10 FAIR*

PoS/PoW Block Details

Proof Of Work Phase
1-25000 Blocks.
Proof of Stake Phase
25001-infinite

Staking Methods

Masternodes
Yes - 25k faircoin Required
Wallet Staking
Yes - 1 to infinite FairCoin

Get Started

Introduction to FairCoin

What is a blockchain?

A blockchain is a public database that is updated and shared across many computers in a network.

"Block" refers to data and state being stored in consecutive groups known as "blocks". If you send FAIR to someone else, the transaction data needs to be added to a block to be successful.

"Chain" refers to the fact that each block cryptographically references its parent. In other words, blocks get chained together. The data in a block cannot change without changing all subsequent blocks, which would require the consensus of the entire network.

Every computer in the network must agree upon each new block and the chain as a whole. These computers are known as "nodes". Nodes ensure everyone interacting with the blockchain has the same data. To accomplish this distributed agreement, blockchains need a consensus mechanism.

FairCoin is based on a Proof-of-Stake consensus algorithm. Each participant's chance to generate the next block is proportional to their economic stake in the network. Unlike Proof-of-Work, Proof-of-Stake is hardware-savvy and power-savvy, making attacks profitless for miners.

Contributing to FairCoin

We are constantly looking for skilled people who want to help in developing this beautiful movement.

Nodes and Clients

is a distributed network of computers running software (known as nodes) that can verify blocks and transaction data. You need an application, known as a client, on your computer to "run" a node.

Prerequisites

You should understand the concept of a peer-to-peer network and the basics of the FVM before diving deeper and running your own instance of an FairCoin client. Take a look at our introduction to FairCoin.

If you're new to the topic of nodes, we recommend first checking out our user-friendly introduction on running a FairCoin node.

What are nodes and clients?

"Node" refers to a running piece of client software. A client is an implementation of FairCoin that verifies all transactions in each block, keeping the network secure and the data accurate.

Many FairCoin clients exist, in a variety of programming languages such as Go, Rust, JavaScript, Typescript, PHP, Python, C# .NET and Java.

Why should I run a FairCoin Node?

Running a node allows you to trustlessly and privately use FairCoin while supporting the ecosystem.

Benefits to you

Running your own node enables you to use FairCoin in a truly private, self-sufficient and trustless manner. You don't need to trust the network because you can verify the data yourself with your client. "Don't trust, verify" is a popular blockchain mantra.

  • Your node verifies all the transactions and blocks against consensus rules by itself. This means you don’t have to rely on any other nodes in the network or fully trust them.
  • You won't have to leak your addresses and balances to random nodes. Everything can be checked with your own client.
  • You can program your own custom RPC endpoints.

Network benefits

A diverse set of nodes is important for FairCoin's health, security and operational resiliency.

  • They provide access to blockchain data for lightweight clients that depend on it. In high peaks of usage, there need to be enough full nodes to help light nodes sync. Light nodes don't store the whole blockchain, instead they verify data via the state roots in block headers. They can request more information from blocks if they need it.
  • Full nodes provides extra security in the network because if all the nodes were light nodes, which don't do full verification, bad people could attack the network and, for example, create blocks with higher rewards.

If you run a full node, the whole FairCoin network benefits from it.

Running your own node

Linux instructions

FairCoin Core GUI

In order to use FairCoin Core GUI, you will need several libraries installed. All of them should be available in all major recently-released Linux distributions, but they may not be installed on your computer yet. To determine whether you’re missing any libraries, open a terminal (if you haven’t already) and run the command /usr/local/bin/faircoin-qt to start FairCoin Core GUI.

If all the required libraries are installed, FairCoin Core will start. If a required library is missing, an error message similar to the following message will be displayed:

  	/usr/local/bin/faircoin-qt: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
  

Search your distribution’s package database for the missing file missing and install package containing that file. Then re-run /usr/local/bin/faircoin-qt to see if it’s missing another file. Repeat until FairCoin Core GUI starts.

You will be prompted to choose a directory to store the FairCoin block chain and your wallet. Unless you have a separate partition or drive you want to use, click Ok to use the default.

FairCoin Core GUI will begin to download the blockchain. This step will take at least several days, and it may take much more time on a slow Internet connection or with a slow computer. During the download, FairCoin Core will use a significant part of your connection bandwidth.

You can stop FairCoin Core at any time by closing it; it will resume from the point where it stopped the next time you start it.

After download is complete, you may use FairCoin Core as your wallet or you can just let it run to help support the FairCoin network.

Optional: Start Your Node At Boot

Starting your node automatically each time you login to your computer makes it easy for you to contribute to the network. The easiest way to do this is to tell FairCoin Core GUI to start at login. This only works in desktop environments that support the autostart specification, such as Gnome, KDE, and Unity.

While running FairCoin Core GUI, open the Settings menu and choose Options. On the Main tab, click Start FairCoin on system login. Click the Ok button to save the new settings.

The next time you login to your desktop, FairCoin Core GUI should be automatically started as an icon in the tray.

If FairCoin Core GUI does not automatically start, you may need to add it to an .xinit or .xsession file as described here.

You have now completed installing FairCoin Core. If you have any questions, please ask in one of FairCoin's many communities, such as Reddit, or the FairCoin Official Telegram group.

To support the FairCoin network, you also need to allow incoming connections. Please read the Network Configuration section for details.

FairCoin Core Daemon

If you’re logged in as an administrative user with sudo access, you may log out. The steps in this section should be performed as the user you want to run FairCoin Core. (This can be a locked account used only by FairCoin Core.) If you changed users in a graphical interface, start a terminal.

Type the following command:

Copied to clipboard!
  	d -daemon
  

It will print a message that FairCoin Core is starting. To interact with FairCoin Core daemon, you will use the command faircoin-cli (FairCoin command line interface).

Note: it may take up to several minutes for FairCoin Core to start, during which it will display the following message whenever you use faircoin-cli:

  	error: {"code":-28,"message":"Verifying blocks..."}
  

After it starts, you may find the following commands useful for basic interaction with your node: getblockchaininfo, getnetworkinfo, getnettotals, getwalletinfo, stop, and help.

For example, to safely stop your node, run the following command:

Copied to clipboard!
  	faircoin-cli stop
  

A complete list of commands is available in the RPC API reference.

When FairCoin Core daemon first starts, it will begin to download the blockchain. This step can take long, and it may take much more time on a slow Internet connection or with a slow computer. During the download, FairCoin Core will use a part of your connection bandwidth. You can stop FairCoin Core at any time using the stop command; it will resume from the point where it stopped the next time you start it.

Optional: Start Your Node At Boot

Starting your node automatically each time your computer boots makes it easy for you to contribute to the network. The easiest way to do this is to start FairCoin Core daemon from your crontab. To edit your crontab on most distributions, run the following command:

Copied to clipboard!
  	crontab -e
  

Scroll to the bottom of the file displayed and add the following line:

Copied to clipboard!
  	@reboot faircoind -daemon
  

Save the file and exit; the updated crontab file will be installed for you. On most distributions, this will cause FairCoin Core daemon to be automatically started each time you reboot your computer.

You have now completed installing FairCoin Core. If you have any questions, please ask in one of FairCoin's many communities, such as Reddit, or the FairCoin Official Telegram group.

To support the FairCoin network, you also need to allow incoming connections. Please read the Network Configuration section for details.

Windows instructions

Mac OS X instructions

Upgrading FairCoin Core

If you are running an older version, shut it down. Wait until it has completely shut down (which might take a few minutes for older versions), then run the installer (on Windows) or just copy over /Applications/Faircoin-Qt (on Mac) or faircoind/faircoin-qt (on Linux).

The blockchain and wallet files in the data directory are compatible between versions so there is no requirement to make any changes to the data directory when upgrading. Occasionally the format of those files changes, but the new FairCoin Core version will include code that automatically upgrades the files to the new format so no manual intervention is required.

Sometimes upgrade of the blockchain data files from very old versions to the new versions is not supported. In those cases it may be necessary to redownload the blockchain. Check the release notes of the new version if you are planning to upgrade from a very old version.

Sometimes downgrade is not possible because of changes to the data files. Again, check the release notes for the new version if you are planning to downgrade.

Network Configuration

If you want to support the FairCoin network, you must allow inbound connections.

When FairCoin Core starts, it establishes 8 outbound connections to other full nodes so it can download the latest blocks and transactions. If you just want to use your full node as a wallet, you don’t need more than these 8 connections—but if you want to support lightweight clients and other full nodes on the network, you must allow inbound connections.

Servers connected directly to the Internet usually don’t require any special configuration. You can use the testing instructions below to confirm your server-based node accepts inbound connections.

Home connections are usually filtered by a router or modem. FairCoin Core will request your router automatically configure itself to allow inbound connections to FairCoin’s port, port 53472. Unfortunately many routers don’t allow automatic configuration, so you must manually configure your router. You may also need to configure your firewall to allow inbound connections to port 53472. Please see the following subsections for details.

Join the FairCoin Developer Community