---
title: SafeCoin Tokens
url: "https://www.safecoin.org/knowledge-base/safecoin-tokens/"
image: "https://www.safecoin.org/fileadmin/_processed_/3/e/csm_3x2_SafeCoin_Logo_vertical_negative_b2c338d6c9.png"
date: 2022-03-17
modified: 2022-04-13
lastUpdated: 2022-04-13
---

# SafeCoin Tokens

1. [Home](https://www.safecoin.org/)
2. [Knowledge Base](https://www.safecoin.org/knowledge-base/)
3. SafeCoin Tokens

  Token Creation Instructions
===========================

How To Mint A Token on the SafeCoin Network
-------------------------------------------

These instructions will help you to set up a token on the SafeCoin Network. If you already have the SafeCoin Client running, you will need to create two new wallet.json files, “Token-Wallet” and “Mint-Authority”.

 ### **Part 1 – VPS Set Up & Log In**

*\**For At-Home Set Up, skip to Part 2.

*Ubuntu 20.04* *is recommended.*

Choose your VPS provider. Once you have your VPS installed, we will now SSH in and begin to build.

Download Putty (or any other SSH program) to log into your VPS.

**[CLICK HERE TO DOWNLOAD THE LATEST PUTTY VERSION.](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)**

  ![](https://www.safecoin.org/fileadmin/_processed_/7/d/csm_putty-dl_c0c7428920.png)

 Once we have Putty downloaded, open the program. You will see a screen like this:

  ![](https://www.safecoin.org/fileadmin/_processed_/7/f/csm_vps-login_86a338645f.png)

 Copy the IP Address of your VPS, and Paste into “Host Name (or IP address), then click Open. This will open a Terminal connected to your VPS. You may get a security alert due to this being the first time logging into your newly created VPS.

Once connected, use the log in credentials from your VPS provider.

Username – root

Password – xxxxxxxxxxxx

  ![](https://www.safecoin.org/fileadmin/_processed_/e/9/csm_root-login_4411753192.png)

 ### Part 2 – VPS Configuration

Next we will create a new user with the following command, replacing <username> with a username of your choice:

```

adduser <username>
```

You will be prompted for a password. Enter and confirm using a new password (different to your root password) and store it in a safe place. You will also see prompts for user information, but this can be left blank. Once the user has been created, we will add them to the sudo group so they can perform commands as root. Replace <username> with your chosen username.

```

usermod -aG sudo <username>
```

Now, while still as root, we will update the system from the Ubuntu package repository:

```

apt update
```

```

apt upgrade
```

 ### Part 3 – Dependencies and SafeCoin Files

Open Putty again, and SSH into the VPS. This time log in with your username and password you created in Part 2.

Download all dependencies and programs we will need.

```

curl <a href="https://sh.rustup.rs" rel="noreferrer" target="_blank">sh.rustup.rs</a> -sSf | sh
```

*\*When prompted with “Proceed with Installation”, Type 1 then Enter.*

```

source $HOME/.cargo/env
```

```

rustup component add rustfmt
```

```

rustup update
```

```

sudo apt-get install libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang make git
```

*\*If prompted with “Do you want to continue?”, type Y and hit Enter.*

*We are now ready to start building the SafeCoin Program.*

First, lets download the necessary files from the SafeCoin GitHub.

```

git clone <a href="https://github.com/Fair-Exchange/Safecoin.git" rel="noreferrer" target="_blank">https://github.com/Fair-Exchange/Safecoin.git</a>
```

Next, lets move into the SAFE directory.

```

cd Safecoin
```

Now in SAFE, lets compile the SafeCoin Program. This may take 5-45 mins, depending on your machine.

```

cargo build --release
```

Once finished, lets download a few more files.

```

./fetch-perf-libs.sh
```

Now let’s back out of the SAFE directory.

```

cd
```

 ### Part 4 – Wallet Files and Seed Backup

Now we will build our ledger.

```

mkdir ledger
```

In the next few steps, we will be creating our wallet address. Open a text file (or somewhere to save seed words).

```

~/Safecoin/target/release/safecoin-keygen new --word-count 24 -o ledger/token-wallet.json
```

\*Enter a BIP39 Passphrase if you want. If not, hit enter to bypass.

Save your PubKey and your 24 Seed Words for your token-wallet.

```

~/Safecoin/target/release/safecoin-keygen new --word-count 24 -o ledger/mint-authority.json
```

\*Enter a BIP39 Passphrase if you want. If not, hit enter to bypass.

**Save your PubKey and your 24 Seed Words for your mint-authority.**

Next, we will set the configuration for the SafeCoin Program.

```

~/Safecoin/target/release/safecoin config set --keypair ~/ledger/token-wallet.json
```

  ![](https://www.safecoin.org/fileadmin/_processed_/f/8/csm_config_018f81ea52.png) You should see this confirmation returned after setting the configuration.

 Now it is time to add SAFE to your Token Wallet with the funding to create a token. Let’s create a SafeCoin address from our already created wallets.

```

~/Safecoin/target/release/safecoin address
```

Copy the SafeCoin address, and send 1 SAFE to it. The transaction should confirm in a few seconds.

Use this command to check the SafeCoin balance on your Token Wallet.

```

~/Safecoin/target/release/safecoin balance
```

 ### Part 5 – Building the SafeCoin Program Library

Make sure you are in your Home directory, and git clone the SafeCoin Program Library.

```

git clone <a href="https://github.com/Fair-Exchange/SAFE.git" rel="noreferrer" target="_blank">https://github.com/Fair-Exchange/safecoin-program-library.git</a>
```

 Next, lets move into the SafeCoin-Program-Library directory.

```

cd safecoin-program-library
```

 Now in Safecoin-Program-Library, lets compile the Token Program. This may take 5-10 mins, depending on your machine.

```

cargo build --release
```

Once built, you can see all available commands available.

  ![](https://www.safecoin.org/fileadmin/_processed_/b/1/csm_Token_Commands_635262b7e4.png)

 ### Part 6 – Building a Token

```

~/safecoin-program-library/target/release/safe-token create-token --fee-payer ~/ledger/token-wallet.json --mint-authority ~/ledger/mint-authority.json
```

If successful, it will return your Token Address and a Signature.

 Now lets create a Token Account where we will hold the minted tokens.

```

~/safecoin-program-library/target/release/safe-token create-account --fee-payer ~/ledger/token-wallet.json <TOKEN ADDRESS> --owner ~/ledger/token-wallet.json
```

If successful, it will return your created Token Account and a Signature.

**Time to mint some Tokens!**

```

~/safecoin-program-library/target/release/safe-token mint <TOKEN ADDRESS> <AMOUNT TO MINT> <ACCOUNT ADDRESS> --fee-payer ~/ledger/token-wallet.json --mint-authority ~/ledger/mint-authority.json
```

If successful, it will return Amount Minted, Token Address, Recipient Address, and a Signature.