Create Sanctuary 2

From BiblePay Wiki
Revision as of 20:47, 22 August 2020 by Togoshigekata (talk | contribs) (Removed keyword "evolution", Updated linux download link, Added unzip, Added part G - Orphan Sponsorship requirement)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Step by step guide to create/setup a Sanctuary (Masternode)

UPDATED: 08-22-2020


2 machines with 2 separate IP addresses and 4,500,001 BiblePay coins

you are setting up a Sanctuary on a remote Linux cloud server (Sanctuary Wallet)
and storing BiblePay coins on a local Windows PC (Controller Wallet)

This is called a Cold setup, your coins are stored safely on your own machine in the controller wallet,
compared to a Hot setup, where the coins are stored on the remote server in the sanctuary wallet (not recommended)

PART A - Controller Wallet (Windows)

On local/home Windows PC:

1. Download & Install latest version of BiblePay:

2. Run and Sync BiblePay

3. Send any needed BiblePay coins to your Controller Wallet
Wallet Menu >> File >>> Receiving Addresses

PART B - Rent Linux Cloud Machine

A. Research and Choose Cloud Provider (Vultr, AWS, Google, Azure, etc) and Create Account
B. Choose Machine to Rent (Recommend: Ubuntu 16.04, 2GB RAM [1GB RAM is okay if use Swap File])
C. Payment Method
D. Connect to it / SSH (Putty SSH Client for Windows)

Vultr $5/month (1 CPU 1GB RAM)
AWS $8.3/month (1 CPU 1GB RAM)

(NOTE: These next steps assumes using Vultr)

1. Create Account

2. Add Payment Information

3. Download & Install PuTTY (SSH Client):

4. OPTIONAL: Generate SSH Public/Private Keys

5. Deploy Instance

Instance Type: VC2
1. Server Location: Random
2. Server Type: Ubuntu 16.04 x64
3. Server Size: 1 CPU, 1024MB RAM, $5/mo (*Assuming using SWAP file later for more RAM)
6. SSH Key: Add and Select Public Key you added in Step #4
7. Serverhostname: Add unique name

6. Use Putty to Connect to Vultr Server
Enter IP Address, Port 22, Connection type SSH
You can add your private key file: Connection >> SSH >> Auth >> Browse
You can name and save your connection info: Session >> Saved Sessions >> Enter a Unique Name >> Save

PART C - Install Sanctuary Linux Wallet

A. Use Automated Script

1. Download the script on the cloud machine:

 cd ~ wget

2. Ensure script is executable:

 chmod 777

3. Run the script:


Follow the prompts.

If your Cloud Machine has less than 2GB RAM, please allow the script to create a Swap File.

After the setup is complete, you can continue at PART E step 2

Alternatively, you can set up manually below.

B. Manually Install BiblePay

- Download Binary:

Linux 64 bit: (Hash)

- Download and unzip

 wget fileURL
 apt install unzip
 unzip -o filename


- Build from Source:

PART D - Run Sanctuary Linux Wallet

On remote Linux machine:

1. Run and Sync BiblePay

 cd home/yourusername/biblepay/src
 ./biblepayd -daemon

2. Close wallet:

 ./biblepay-cli stop
 #if BiblePay is stuck
 ps -ef #view processes and find BiblePay PID number, use in kill command
 kill PID

3. Run BiblePay:

 ./biblepayd -daemon

4. Check that blocks number matches home Windows Controller wallet

 ./biblepay-cli getinfo

PART E - Financing your Sanctuary (Masternode)

1. Generate private key on Sanctuary remote Linux machine

 ./biblepay-cli masternode genkey

(Store this as your SANCTUARY_PRIVATE_KEY)

2. Local Windows Controller Wallet - Show Proof of Coins

Create a unique name (SANCTUARY_NAME) for the address you will be storing your coins in
and send the required 4,500,001 coins to that address

2a. Create Masternode Coin Address with Label

Tools >> Debug Console

 getaccountaddress SANCTUARY_NAME 

this creates your SANCTUARY_ADDRESS


2b. Combine All Your Coins into One Address

File >> Receiving Addresses >> Right click Copy Address (this is your RECEIVING_ADDRESS)
Send all of your wallet coins to this one address

Tools >> Debug Console

   sendtoaddress RECEIVING_ADDRESS 4500001 "" ""


2c. Send Required Coins to Newly Created SANCTUARY_ADDRESS from step 2a

Enable Coin Control: Settings >> Options >> Wallet >> Click "Enable coin control features" checkbox >> Ok

Send >> Inputs >> Click Checkboxes of which Address(es) to Send Coins From

Send exactly 4500001 coins

NOTE: Fees are OK as long as you dont click the checkbox to Subtract fees. Fees are stored in a different vector
NOTE: Important thing is to make the amount exactly 4500001 and dont click instant send or any other options
NOTE: Coin Control will allow you to send coins from a specific address and not move coins you already set aside in other addresses

2d. Record Transaction Hash

Open an Explorer:

Record Latest Hash for your 4,500,001 deposit (TRANSACTIONHASH)

3. Wait for 7-8 or so confirmations (at 7 minute block rate, that will be around 1 hour)

4.a Controller Windows Wallet - Get TRANSACTIONHASH and INDEX from running this command:
Tools >> Debug Console

 masternode outputs

You will get a string that looks like this:

 "06e38868bb8f9958e34d5155437d009b72dff33fc28874c87fd42e51c0f74fdb" : "0",

The long string is your TRANSACTIONHASH, and the last number is the INDEX.

4.b Controller Windows Wallet - Edit masternode.conf:
Open File Explorer, Enter in address bar: %appdata%/biblepay and press Enter
Find and Right Click >> Edit masternode.conf
Add line below and Save:


SANCTUARY_NAME: The name/label that you set for your sanctuary address in step 2
SANCTUARY_PUBLIC_IP: Your sanctuary IP (Your sanctuary Linux VPS/Cloud machine IP)
SANCTUARY_PRIVATE_KEY: This is the private key that you placed in your remote configuration
TRANSACTIONHASH: This is the transaction hash for the transaction in which you got your 4500001 BBP deposited.
INDEX: This is the Index of your transaction for that address I'll show you how to get it in a bit.

NOTE: If you have multiple sanctuaries, should be able to add additional lines to masternode.conf

5. Controller Windows Wallet - Edit biblepay.conf:
Open File Explorer, Enter in address bar: %appdata%/Biblepay and press Enter
Find and Right Click >> Edit biblepay.conf

Decide on "RandomUsername" and "RandomPassword" to use for RPC credentials
NOTE: Password must be Alphanumeric only! (Letters and Numbers only)
Add Lines below and Save:


NOTE: For the RPC Port, you can use whichever port you want, just make sure to open it in firewall in Step 7

6. Restart (Close and then Open/Run again) Windows Controller Wallet

7. Sanctuary Wallet Remote Linux Machine, Run Firewall/Port commands:

 sudo apt-get update
 sudo apt-get install ufw
 sudo ufw allow ssh/tcp
 sudo ufw limit ssh/tcp
 sudo ufw allow 40000/tcp
 sudo ufw allow 9998/tcp
 sudo ufw logging on
 sudo ufw enable
 sudo ufw status

8. Sanctuary Masternode Linux Wallet - Edit ~/.biblepay/biblepay.conf:

 cd ~/.biblepay
 vi biblepay.conf

(SANCTUARY_PUBLIC_IP: Public IP Address of Remote Linux Sanctuary Wallet)

9. Sanctuary Masternode Linux Wallet - Restart BiblePay:

 cd home/YOURUSERNAME/biblepay/src
 ./biblepay-cli stop
 #if BiblePay is stuck due to new password
 ps -ef #view processes and find BiblePay PID number, use in kill command
 kill PID
 ./biblepayd -daemon

PART F - Upgrade Deterministic


NOTE: BiblePay upgradesanc tool will automatically create a file called "deterministic.conf" in your Data directory. It will automatically add a new row to this file every time you upgrade a sanctuary to deterministic. This file will contain your sanctuary name, ip, port, collateral txid, pro-tx txid, blsprivkey, blspubkey, and all other pertinent tx info on one row.

1. Unlock Controller Wallet

Settings >> Unlock Wallet

or type command:

 walletpassphrase "password" number_of_seconds

2. With Controller Wallet, Run command:

 exec upgradesanc SANCTUARY_NAME 0

Check the output and make sure there are no errors

3. With Controller Wallet, Run command:

 exec upgradesanc SANCTUARY_NAME 1

4. Edit Remote Sanctuary's biblepay.conf file, Add below line with your blsprivkey (can find the key in deterministic.conf)


5. Reboot (Stop and Start) your Remote Masternode wallet

6. In Controller Wallet >>> Sanctuaries tab >>> Check that your masternode has status ENABLED

7. In Remote Sanctuary Wallet, check status with command:

 ./biblepay-cli masternode status

PART G - Orphan Sponsorship

"The POOS (Proof of Orphan Sponsorship) system requires each of our sanctuaries to sponsor one cameroon-one orphan in order to be paid Biblepay rewards."



Show Sanctuaries Tab in Windows Controller Wallet

Settings >> Options >> Wallet >> Click "Show Sanctuaries Tab" checkbox >> Ok >> Restart BiblePay Wallet

Extra Commands:

 mnsync status
 masternode help

How to Edit Files on Linux
I like to use vi, example:

 vi filename #to open the file
 i #to go into edit mode and be able to insert characters
 ESC #to leave edit mode and go into command mode
 :wq #to save (write) the file and exit (quit) vi 

Port 40000 is biblepay-prod, while 40001 is biblepay-testnet


Linux Sanctuary (Masternode) Update by 616westwarmoth


   ### Turn off/stop BiblePay 
   cd /home/yourusername/biblepay/src  
   ./biblepay-cli stop      
   ### Pull down latest Biblepay code and build it 
   cd ..
   git pull origin master    
   ## Enable swap if running on 1 GB VPS (such as Vultr)
   dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
   mkswap /var/swap.img
   swapon /var/swap.img
   ## Compile
   sudo make    
   ## OPTIONAL use if need to clean old data files
   cd ~/.biblepay
   rm blocks -R
   rm chainstate -R
   rm banlist.dat fee_estimates.dat governance.dat mncache.dat mnpayments.dat netfulfilled.dat peers.dat db.log debug.log    
   ## Start BiblePay
   cd /home/biblepay/src
   ./biblepayd -daemon -reindex  ## OPTIONAL use -reindex if blockchain needs to be rebuilt
   ./biblepay-cli getinfo
   ./biblepay-cli mnsync status
   ./biblepay-cli masternode status

Update/Upgrade Packages:

   sudo apt-get update
   sudo apt-get upgrade
   sudo apt-get dist-upgrade
   sudo apt-get autoremove


1. Stop biblepay on remote linux machine: ./biblepay-cli stop
2. On home controller Windows wallet, edit masternode.conf and delete the entry for that masternode
3. Restart home controller Windows wallet
4. 4,500,001 BBP should now be unlocked



BiblePay Linux Guide:

Rob Original Sanctuary Guide:

Testnet Thread - Testing Sanctuaries

Togo Sanctuary Notes:

Dash Masternode Guides:

VIVO Masternode Guide:

More References:


QUESTION: How to deal with fees when sending? Does amount have to be 4,500,001 exactly?
Fees are OK as long as you dont click the checkbox to Subtract fees. Fees are stored in a different vector, so the vout is still 4,500,001.

QUESTION: Are we sending coins to ourself?
It is OK to send the balance to yourself or from another node (I tested both).
The important thing is to make the amount exactly 4500001 and dont click instant send or any other options.

If you are creating a Hot wallet (IE funds live on the Sanctuary) you would send the 4,500,001 to the Sanctuary wallet.
Now that we know cold wallets work, the recommended way is to send the funds To the cold wallet (IE the home controller wallet).

QUESTION: Does the Masternode actually hold coins?
In a Hot masternode scenario, the masternode holds the coins, otherwise the masternode wallet is empty.
Biblepay puts a lock on the escrow when the masternode starts.

QUESTION: What are the rpc settings doing? Can the Home Wallet now control the Linux Wallet? or reverse of that?
These config settings only allow the home controller wallet to start and stop the masternode. This is not only to safeguard your eventual 4,500,001 BBP escrow if it goes up in value (to prevent vultr host from stealing it), but also because of Proof-Of-Service. Dash has created POSE, which monitors how much uptime your masternode has stayed up and eventually becomes important if we have more than about 800 masternodes, these nodes start falling to the back of the payment queue and do not get paid if they need restarts. When they fail and need restarted, it is easy for home computer controller wallet to start the masternode again.

QUESTION: Sanctuaries are only Linux? Or will there be a Windows solution to this?
They are linux only, primarily because the proof-of-service software we use only runs on linux.
No windows solution is currently scheduled, unless our stratis Proof-of-concept is really well received.

QUESTION: Is a static IP required?
Static ip is required, thats primarily why we recommend web hosts for this.
If your node fails to vote when its asked to you lose your sanctuary payment.

QUESTION: Is much bandwidth required ? Any calculations on this?
Very low bandwidth is required, only 10% more than a normal node,
Except since you are a full PoSE node you would be servicing inbound connections, however these are split among all the nodes.
Im running one with 1023 connections and its taking 40kbps so its pretty low.
You can see the network graph in the qt wallet btw (Tools | Network Traffic).

QUESTION: Is it OK to run a masternode on a dedicated machine with a high speed internet connection?
1) If you do go down, you will lose your sanctuary payment, and if you fall out of the payment queue it might take 24 hours to get back in.
2) If your dynamic IP changes, you will have to re-create your whole sanctuary! The Escrow is tied to the static IP. <- This is a real pain..

QUESTION: How long will masternode with 40 GB storage last?
Our blockchain size is only 17 Megs right now with 21000 blocks,
with our small blockchain size and 7 minute blocks, we should technically sync fast and stay small for a long time

QUESTION: My wallet has multiple receiving addresses including masternode address. If I send coin to other address, will it affect masternode?
Or when I run the masternode, is that masternode address locked?
1) Enable coin control features:

Settings > options > wallet > enable coin control features.

2) Go to send and click on "Inputs..", you should see the escrow amount being locked (you can unlock it by right clicking on it > unlock).

QUESTION: Why use cold wallet setup vs hot wallet setup?
To not leave your 4.5M BBP vulnerable on a web host. A cold Sanctuary means you can keep your BBP off site, in an encrypted wallet (in your controller wallet) where the coins are safer.

Would your computer withstand a DOS attack:
You can shut off your RPC port at home and run a private node, and add a firewall, and encrypt the wallet and even leave the coins in cold storage.

Easier and cheaper to run a VPS:
Based on my experience with the pool the only way to have 99.9% uptime is on a VPS. Too much happens on home networks that make it unreliable. Because we implement proof-of-service, you should consider the VPS option to keep your IP from changing and to ensure you receive your sanctuary rewards.

QUESTION: For a cold masternode setup, does the Controller Wallet have to stay online 24/7 like the Masternode Wallet?
No- controller only needs to be online to start the sanctuary.

QUESTION: Is it possible to setup multiple masternodes on one VPS?
Since you need a static IP per sanctuary, it can only be done via a lot of hacking, so without hacking - its not possible, and if you do pay for a block of IPs at the VPS, then it requires extremely advanced network config scripts to get it to work.


Block Reward Breakdown:
Emission Schedule:


QUESTION: How to view sanctuary payments?

   masternode winners 100

As far as "luck" of winning the spot, we are using an algorithm where the nodes rank is determined by how close its vin is to the blockhash its voting on, so its really luck. Its ranking the winner based on blockhash uint256 minus masternode vin (this is called sanctuary delta), with the smallest delta ascending.

PRE_ENABLED means no chance of winning the vote, as the sanctuary is not trusted yet.

NOTE: If a sanctuary goes offline or falls into a bad state like "WATCHDOG_EXPIRED" it takes 30 hours for the sanctuary to fall out of the payment queue


Anyone can submit a proposal to the community requesting funding for work,
here are some ideas of work we need done:

NOTE: Creating a proposal costs 2500 BBP

0. Setup a BiblePay Wallet to receive funds at:

1. Create a Forum Post of the Proposal in the BiblePay Forum:
Production Proposal Section:
Example Proposal:

2. Create a Proposal with the BiblePay Wallet: br /> Top menu "Proposals" >>> "Proposal Add"

- Proposal Name
- Proposal Amount (How many BiblePay coins needed)
- Discussion URL (BiblePay Forum Post link)
- Funding Receiving Address (BiblePay address)
- Expense Type

NOTE: With Windows or Linux GUI Wallet, you can find your Receiving Address by clicking File >> Receiving Addresses
and right click copy Address, you can also create new addresses (and can also label them!)

QUESTION: How to calculate BiblePay price?
Use the USD per BBP value at CoinMarketCap:
In the future we may use a moving average

NOTE: Once the proposal is entered through the Pool, it goes into Prepared state and then after a little whiles goes into Submitted state
once it is in Submitted state you can see it in the gobject list and you can post your vote commands

   gobject list

Approval occurs when yes votes minus no votes equals 10% or more of the total available votes.

QUESTION: How to sell BiblePay after I get funded?
BiblePay is listed for trade on a few exchange, you can trade it for Bitcoin, Litecoin, USD (Dollars), etc
and then you may have to send Bitcoin somewhere else to convert it to Dollars

To Read & Watch:
Understanding the Governance and Budget System

Using Decentralized Governance: Proposals, Voting, and Budgets

Anyone Can Apply for Dash Treasury Funds: A 3-Step Tutorial

8 Steps to a Successful Proposal

Budget Proposals and the Problem of “Extra Money”

Evaluating How Much a Dash Budget Proposal is Worth

QUESTION: Are proposals funded all at once or in payments throughout the month? All at once.

QUESTION: What happens to budget funds that do not get allocated/spent on any proposals?
Coins are destroyed (equivalent to burnt, or not expanding the money supply) and opportunity to spend that allocation is lost for one month.

QUESTION: What is our current budget/proposal schedule? how to look it up? How many coins are in the budget?

View next Superblock and Check Budget:

 getsuperblockbudget 24600

Subtract the Super Block from the Current Block
Multiply 7 minute block rate, divide by 60 minutes, divide by 24 hours, and that is how many days until the superblock runs. ~3 Days before that the approved proposals will be moved into budgets, they will need to be voted on and then ~1 Day before the superblock the budgets will be frozen.

Block Rewards & Emission Schedule:

Type command "getgovernanceinfo" to view how many coins are available in this months budget cycle

NOTE: Proposals are not the same as budgets. The proposals become budgets after they reach a supermajority and have a triggerheight for a superblock.

There are two phases each expense has to go through: proposal and budget.
The week before the superblock, we need to run the budget process (from the pool), and what happens is every proposal that fits in the budget will move to the Budget voting list. (Sorted by expense type (IE Charity, IT, PR, or P2P), votes descending , while Charity has the highest priority).

Anyway, once the budget is established it needs to be voted on by the sanctuaries. They need to vote on the budget before the deadline which is 24 hours before the superblock hits. So we need to be voting on it Id say T-3. Then T-1 the budget is frozen and cannot be changed.

When we believe the budget is frozen, we issue a superblock trigger in the chain (the pool is programmed to automatically do this for us). At this point the "triggerheight" that equals the superblock will be on all the budget records.

Then we sit back and pray that the superblock is generated. After this happens, the budget items are moved to Funded.

NOTE: I was trying to reconcile the 2.8MM coin emission in the 30 day superblock cycle for one month of charity expenses, vs. the huge amount of coins we initially sold for the very first month of existence (7MM), and I was thinking, why less than half?

It turns out the reason why is our superblocks use the assumption of maximum diff and minimum block payment, to ensure that enough BBP is held back during the period regardless of the dynamic emission level - another words, it assumes each days minimum subsidy is paid to comprise the 30 day 20% total.

So if you are trying to reconcile this 5.78MM budget for one month, its based on the minimum 5,000 BBP block minus deflation (1.5% per month) * .20.


NOTE: Only Sanctuaries can Vote

Inside the BiblePay Wallet >>> Proposals tab> You can right click a proposal and click "Vote For", "Vote Against" or "Vote Abstain"

If youd like to use the command line, you can view and vote on proposals with the below commands:

View proposals:

 gobject list

NOTE: Copy the Hash value, you will need it in the next command to vote on it

Vote yes, no or abstain with a sanctuary:

 gobject vote-alias Hash funding yes SANCTUARY_NAME

Vote yes or no with many sanctuaries

 gobject vote-many Hash funding yes

Check that the YesCount, NoCount or AbstainCount has incremented

 gobject list

See all gobject commands:

 gobject help

Video Tutorial by 616westwarmoth

REMEMBER ALL: (Note from Lead Dev) We have IT integration with compassion for the inbound letters, the outbound letters, the orphan row click (biographies), and they have translators, so remember we potentially lose all that if we sponsor children from another charity.

When it comes to Charity, our entire mission is based on Charity, in this case I recommend we sacrifice every other department for Charity

Ill try to be more careful and only sponsor new children where the amount extends out to One Year (of premiums), so we have a buffer (we talked about that in the beginning)


Bulwark -
Phore -
Rapture -

1. There is no need to kill biblepayd if you simply first do biblepay-cli stop, and then edit the conf file, so you can just reverse the steps and first put the step to stop biblepay, then you can edit the conf file without problems with rpc, so then you can start biblepayd again normally

2. Sometimes two commands can be one, I don't know if it's easier for beginners to follow if there are two simple commands, or it's easier if there is just one command if they just copy/paste anyway: for example, instead of: cd ~/.biblepay/
vi biblepay.conf
it could be just
vi ~/.biblepay/biblepay.conf

3. For beginners it can be really hard to find the AppData folder on their PC (being hidden and all) to edit the conf files, so I suggest you simply replace that with GUI (wallet) instructions, which is as easy as: Tools => Open Wallet Configuration File (for biblepay.conf) and Tools => Open Masternode Configuration File (for masternode.conf)

4. "getaccountaddress SANCTUARY_NAME" can also be easily done in GUI, File => Receiving addresses... => New, also the Start alias part, there's simply a button there in GUI, but since other commands can't avoid debug console, then perhaps I would leave that as is.(edited) 5. I would move the "Financing your masternode" part somewhere above previous steps, because waiting for confirmations about the collateral tx takes more than one hour, and then you just have to wait if you did everything else already. I think it's more rational to first just do the transaction and then setup the Linux wallet in the meantime while the tx is being confirmed.

5. Next step is to create screenshots.