Retirement Accounts

From BiblePay Wiki
Jump to: navigation, search


Biblepay is the first cryptocurrency to integrate retirement accounts into the core. Retirement accounts are a facility to allow you to store money in a deflating asset, similar to sweeping money into a money market account.

Note: A major difference with retirement accounts however, is the only way to trade in and out of the RBBP asset is with an opposing BiblePay trader. So, use extreme caution with retirement accounts until you feel comfortable with the way they operate.

The Retirement BiblePay Asset is a colored coin integrated in the wallet stored alongside your other coins using the same debit/credit/tx structure, except each coin is marked with a script, and restricted from being traded for BBP or being spent. So, it is not possible to withdraw RBBP and spend it on an exchange to buy BBP. The retirement coins are designated with symbol RBBP while standard BiblePay coins are designated as BBP. Note that in the trading engine, you must trade with symbol RBBP, as BBP->BBP/BBP->RBBP trades are not supported. For example, you may BUY 1000 RBBP for a certain price per BiblePay, Or Sell 1000 RBBP for a certain price per BiblePay, but you may Not buy any BiblePay or Sell any BiblePay for RBBP or BBP.

Complex Escrow Transactions

BiblePay executes Retirement trades using a complex transaction called a Signed-ORO-Escrow Transaction. This is a 4 leg transaction signed by 3 participants and transmitted to 3 parties. When an order is placed it is live in the orderbook, but so far, escrow has not been staked.
Once the wallet finds a matching participant, with matching quantity and price, a message is sent to each wallet asking them if they still want to trade. (The code automatically answers YES for each wallet).

Once an OK is given, the Buying wallet creates a complex ORO-E-T transaction, by filling in Public information about itself (IE public receiving address, amount it wants to buy, asset name, timestamp, public key signature, transaction template hex, and the limit requirements, and expectations of the counterparty). At this point one chosen sanctuary will volunteer to temporarily Hold the escrow while the trade occurs.

Note that this transaction is written in such a way, that even the sanctuary cannot cash in the escrow, as each leg of the trade is appended as a "depends-on-txid" of the prior leg starting at leg #2. So, if leg 2, 3, or 4 of the transaction fails, the BBP is actually Not Spent (since the requirements of TxID 2 or 3 or 4 that depended on #2 and up were not fulfilled). However if the buyer sends escrow to the sanctuary, and the sanctuary does not receive escrow from the Seller, the Sanctuary will have temporary control of Leg #1 (Since the Depends on Rule only Activates After leg #2 starts). In this case, if the trade is not executed within 5 minutes, the sanctuary will return the escrow back to the buyer.

NOTE: We are working HTLC also, to eliminate the possibility of Leg #1 failing.

The retirement account emission rate starts at 20,000 colored coins per block and decreases by 1% per day (or 365% per year).

Note that you cannot see the retirement balance in your wallet from the UI. You must issue an RPC command to find your balance.

Note that currently, trades will only be executed with other participants if both participants have a quantity MATCH and a PRICE MATCH. This means that even if you offer to pay more per RBBP than another participant the trade will not be executed unless the other side of the trade matches the quantity. You can overcome this by looking at 'exec orderbook' and making your trade match another participants quantity and price to force a trade through.

Please use the following commands below to access the BiblePay Retirement Account Trading System:

You must execute these commands from the RPC (TOOLS | DEBUG | RPC CONSOLE):

exec retirementbalance

Shows the current retirement account balance.

exec tradehistory

Shows the last 7 days of successfully executed trades that your wallet executed with other Biblepay wallets.


exec tradehistory

  "11/11/2017 7:47:56 PM": "BOT 1000 RBBP @ 0.0100 TOTAL 10.00BBP ORDER 000000000000000000000000000000007fccbe6e3eb5df0d57c57a7620c625cb.",
  "11/11/2017 7:47:56 PM": "SOLD 1000 RBBP @ 0.0100 TOTAL 10.00BBP ORDER 000000000000000000000000000000001e6bf632698abf26fc3648e386883e0b."

 exec orderbook 

Shows all wallets currently offering to trade RBBP. The report displays the Sell offers ranked by offer price ascending, and on the right, shows the BUY offers ranked by Highest Price to Lowest Price per RBBP descending:

Example: exec orderbook:

         Price Quantity  Amount   Total                Price  Quantity Amount     Total      
 "0": "0.0100  1000      10.00     10.00        |RBBP| 0.1200  1         0.12      0.12        ",
 "1": "                                         |RBBP| 0.0100  1000      10.00     10.12       ",
 "2": "                                         |RBBP|                                        
exec listorders

Shows the list of orders currently being offered by other participants with more order details.

exec order [  Buy/Sell/Cancel ]   Qty  Symbol [Price] 

Place a trade. You must specify if you want to buy, sell or cancel an order. Specify the quantity of RBBP and the price per BBP. Note the total order cost will be QUANTITY*PRICE in BBP.

    Examples of Placing Trades:
  • exec order buy 1000 rbbp .11 (This places a Limit order to BUY 1000 RBBP for .11BBP PER RBBP Totaling 110 BBP for the order).
  • exec order sell 1000 rbbp .11 (This places a Limit order to SELL 1000 RBBP for .11BBP PER RBBP Totaling 110 BBP for the order).
  • exec order cancel orderhash (This cancels an existing order).
  • exec order buy 1000 rbbp 1.5 (This places a Limit order to BUY 1000 RBBP for 1.50 BBP per RBBP Totaling 1500 BBP for the order).
  • Note: You may alternatively use exec trade in place of exec order.