Integration info

Epic Cash Integration Information for Services

Kindly refer to the information below for integrating Epic Cash on your service platform. If you require assistance or additional information such as legal documentation, please send an email to contact@epic.tech.

The Epic Cash project relies on its community to help foster adoption. All services offering Epic Cash on their platforms do so voluntarily and without any payments from the project.

Project information

DENOMINATIONS

Project name:

EPIC Private Internet Cash

Coin name:

Epic Cash

Ticker symbol:

EPIC

Singular and plural:

EPIC

Precision:

10−8 (8 decimal places)

DEVELOPMENT

Code repository:

Project fork of:

Grin

Source model:

Open source

Initial release:

Version 2.2.2 on September 2, 2019

Latest release:

Version 2.3.0-1 on September 13, 2019

Country of origin:

United States of America

LEDGER

Timestamping method:

Proof-of-Work

Issuance schedule:

Proof-of-Work and treasury block rewards

Hash functions:

RandomX, ProgPow, and CuckAToo31+

Block reward:

16 EPIC per block

Block time:

60 seconds on average

Block explorer:

Circulating supply

1124000

Maximum supply:

21,000,000

API Index has more APIs and option to request new ones

ADDITIONAL INFORMATION

Brief description:

Epic Cash is designed to be a currency for everyone and combines the privacy-protecting MimbleWimble protocol with sound economics and fair distribution.

Description:

Epic is a MimbleWimble-based coin with fungible, fast, and highly scalable transactions. 3 billion people have no access to or are under-served by the modern financial system. Reaching these people is our responsibility. We will be airdropping to new users as in the early days of Bitcoin. We see our project as returning to Crypto’s roots. We want what Satoshi originally intended: True P2P Internet cash, open to all.

Key differentiators:

Grin and Beam are two popular MimbleWimble-based projects. We are differentiated in a few key ways:

  • Three different algorithms that allow CPU, GPU, and ASICs to mine for the coin, we achieve the most diversely distributed PoW coin.
  • A unique “Bitcoin-like” emission schedule, where our emission rate is accelerated relative to Bitcoin’s, but will match Bitcoin’s coin supply and emission schedule sometime in 2028, to let the currency serve as an ideal store of value.
  • By combining several of the best privacy and scalability technologies together, we aim to create a currency which can serve as an ideal medium of exchange.

Main application:

Privacy-protecting peer-to-peer internet cash. Store of value and medium of exchange.

Development status:

Active mainnet. Network is complete, tested, and working.

Epic Cash is not a security token.

Epic Cash did not have a premine, token sale, or fundraising. It had an open source community launch

Technical Instructions for Exchange Integration

Example of receiving EPIC through exchange node

//
//  How receive epic cash from extrernal exchange service user and check if user is in database.
//  Copyrights by Fast Epic Team 2019. Enjoy and use this little crazy software.
//  
//

const url = require('url')
const fs = require('fs')
const MongoClient = require('mongodb').MongoClient;

//
// link to server where users database is
//
const urlmongo = "mongodb://localhost:27017/epic";

const baseDirectory = __dirname +"/public/"

//
// dbepic for connection to database
//
var dbepic = null

//
//  https server listen for connection from ( epic-wallet send -d "https://exchangedomane:443/username" 0.01 )
//  must be correct ssl keys no self=signed.
//
const proxy2 = https.createServer({
  		key: fs.readFileSync('./ssl/server.key'),
  		cert: fs.readFileSync('./ssl/server.cert')
	},	(req, res) => {

      //
      // check if it is POST ( epic-wallet use POST method )
      //
	  if(req.method=="POST") {
 
        //
        //  for users collecction in database
        //
	    const col = dbepic.collection('users')

	    //
	    //  function finduser will find username in https://exchangedomane:443/username/v2
	    //
	    //
	    var  ma1 = finduser(req.url)
	  	
	  	//
	  	// if no username 
	  	//
	  	//
	    if(ma1=="v1") { res.end(); return; }
	    //if(ma1=="v2") { res.end(); return; }
	    
	    console.log('new user', ma1);

	  	(async function(){
	        
	        try{
                //
                //  finding in database if user is reguster in exchange 
                //
	  	 		let r = await col.findOne({ident:ma1})
	  	 		
	  			if(r) nextstep(req, res, r); else res.end();	

	  		} catch(err){
	  			
	  			console.log(err)
	  		}

	  	})();	

	 } else {

			res.end("Only for epic-wallet connections");
	 }


})


//
// create connection to dataabase 
//
MongoClient.connect(urlmongo, { useNewUrlParser: true }, function(err, db) {
  	
  	if (err) throw err;
 	
 	dbepic = db.db("epic")

  	// Now that server https is running

	proxy2.listen(443, () => {
	  
	})
})

//
//  we have to run epic-wallet -e listen on local machine.
//  and to this epic-wallet will be redirected connection.
//
nextstep = (req,res, who)=>{
  
  
  if ( req.method=="POST"){
                            
    let chuck = ''
    req.on('data', (chunk) => {
        chuck +=  chunk.toString();
    });
    req.on('end', () => {
          
      //
      // in this place we have all request send from external epic-wallet
      // we can use JSON.parse(chuck) to ready sent transaction and store it in database or check value
      //

      let n = req.url.lastIndexOf('/')
      
      n = req.url.substring(n)
      
      // 
      // n hold method name which we send to listen wallet
      //
      const options = {
          hostname: "localhost",
          port: 3415,
          path: '/v1/wallet/foreign'+n,
          method: 'POST',
          headers: {
          'Content-Length': req.headers['content-length']
          }
      }
      
      const req2 = http.request(options, res2 => {
        
        console.log(`statusCode: ${res2.statusCode}`)
        
        let chuck2 =""
        res2.on('data', (chunk)=>{
          chuck2 +=chunk.toString()                                      
        })

        res2.on('end', ()=>{                                      
          res.end(chuck2)
        })
    
      })

      req2.on('error', error => {
        console.error(error)
      })
      
      req2.write(chuck)
      req2.end();
    
    })
  }


}


//
// function find username in url request
//
function finduser(tek){
  
  var n = tek.indexOf("/", 0);
  var n1 = -1
  var ret = null
  

  if(n==0) {

     n1= tek.indexOf("/", 2);
  }

  if (n1==-1) {
     ret = tek.substring(n+1,tek.length)
  } else {
     ret = tek.substring(n+1,n1)
  }

  return ret
}

Wallet Worker Setup Instructions

const { spawn } = require('child_process')

var arg = [];


let wallet = spawn('epic-wallet', arg, {cwd:arg[3]} )


setTimeout(function(){
                       process.send(wallet.pid)
                      },3000);

wallet.stdout.on('data', (data) => {
                console.log(` wallet stdout: ${data}`);
            })

wallet.on('error', (error)=>{
              console.log(error)
            })
wallet.on('close', (code)=>{
              console.log("close ",code)
            })

Example of reading transactions from epic wallet node

//
//  How look at txs from epic-wallet. It works with walletworker.js file
//  This example is most hardcore than our receive epic cash example
//  but if you understand how it works then it will open your mind for many hidden possibilities.
//
//  Copyrights by Fast Epic Team 2019. Enjoy and use this little crazy software.
//  
//

const { spawn, fork } = require('child_process')
const http = require("http")


let port = 1111 // take from epic-wallet.toml owner_api port

retrieve_txs = (transactionid)=>{

 
    (async function(){
        try{
                  // folder where you keep your wallet db, seed, toml
                  let cwd = '/home/myserver/epic/wallet'
                  
                  // you need set PATH for folder where you keep epic-wallet executable file  
                  // we use fork because it make our process more fast and scalaable.
                  let wallet = fork('walletworker', ["--pass", "passwordtoyourwallet",'-d', cwd, 'owner_api'])
                  
                  // when wallet start and send message then we start the game
                  wallet.on('message', function(msg) {

                    //options to  request
                    const options = {
                      hostname: 'localhost',
                      port: port,
                      path: '/v2/owner',
                      method: 'POST',
                      headers: {
                        'Content-Type': 'application/json',
                        'Authorization':'Basic '+Buffer.from("epic:"+passfrom_api_secure).toString('base64')
                      }
                    }

                    // data to request - we ask for retrieve_tx from owner api.
                    const data = JSON.stringify({
                      "jsonrpc": "2.0",
                      "method": "retrieve_txs",
                      "params": [true, null, null],
                      "id": 1
                    })
                   
                   // here we build request to wallet
                   const req = http.request(options, res => {
                        console.log(`statusCode: ${res.statusCode}`)
                        
                        // if bad answer from wallet we kill it here and in system process list
                        if(res.statusCode!=200) {

                          wallet.kill()
                          console.log("kill process ", msg, " because "+res.statusCode);
                          // kill in system list 
                          let killer = spawn("kill",[msg]);
                          killer.stdout.on('data', (data) => {
                              console.log(` Killer stdout: ${data}`);
                          });


                          killer.stderr.on('data', (data) => {
                              console.log(` Killer stderr: ${data}`);
                          });

                          killer.on('close', (code) => {
                              console.log(`Killer process exited with code ${code}`);
                              
                          });                           
                                  
                          return;
                       } // end if


                       let chuck = "" 
                       
                       res.on('data', d => {
                          chuck = chuck +d
                       })

                       res.on('end', ()=>{

                             
                             wallet.kill()
                             
                             let txs = JSON.parse(chuck)

                             // here we check txs if has transactionid or other parameters which we catch in the first example

                             console.log("kill process ", msg);
                             
                             // kill all wallet process

                             let killer = spawn("kill",[msg]);
                             killer.stdout.on('data', (data) => {
                                      console.log(` Killer stdout: ${data}`);
                             })


                              killer.stderr.on('data', (data) => {
                                        console.log(` Killer stderr: ${data}`);
                              })

                              killer.on('close', (code) => {
                                        console.log(`Killer process exited with code ${code}`);
                                        
                              }) 

                       })

                    }) // end of request 

                    req.on('error', error => {
                        console.error(error)
                    })
                    
                    //we here made request to wallet
                    req.write(data)
                    
                    req.end()

                })
  

      } catch(err){
        console.log(err);
      }

    })(); 


}