Ruby Connect
  • Ruby Connect Background
  • Developer Docs
    • Ruby Frontend Architecture
    • Backend Functionalities
    • Truffle Deployment Guide
  • Tutorial
    • Connect Your Wallet
    • Test Tokens & Faucets
    • Ruby Account Registration
    • Ruby Account Login
    • Privacy Token Minting
    • Transfer Privacy Tokens
    • Redeem Privacy Tokens
  • FAQ
    • FAQ
  • Launch App
Powered by GitBook
On this page
  • Register
  • Mint
  • Redeem
  • Transfer
  1. Developer Docs

Backend Functionalities

The backend functionalities are all defined in src/ruby/client_base.js , which is mostly self-explained with rich comments. We list 4 main APIs that are most important here:

Register

ClientBase.register(secret)

User inputs his or her private secret and the algorithm will generate a Ruby public/private key pair. The Ruby public key will be sent in a transaction to register an account in the contract.

Mint

ClientBase.mint(value)

Create a transaction to convert a specified amount of the user's plain tokens to an equivalent amount of encrypted Ruby tokens.

Redeem

ClientBase.redeem(value)

Create a transaction to convert a specified amount of the user's encrypted Ruby tokens back to an equivalent amount of plain tokens. Note that the transaction will include necessary cryptographic zeroknowledge proof to guarantee that this is a valid burn operation.

Transfer

ClientBase.transfer(receiver, value, decoys)

Create a transaction to transfer a specified amount of the user's encrypted Ruby tokens from the current user to a receiver. Note that the transaction will include necessary cryptographic zero-knowledge proof to guarantee that this is a valid transfer operation.

PreviousRuby Frontend ArchitectureNextTruffle Deployment Guide

Last updated 2 years ago