Coder Social home page Coder Social logo

ico-secure's Introduction

ico-secure

A set of scripts to provide secure funds gather during ICO

Scripts differentiate between Ethereum and Bitcoin blockchains (they are located in different folders inside each step).

Setup

To setup machines you will need:

Prerequisites

Online machine: Bitcoin: synchronized bitcoind server with JSON-RPC enabled (localhost and default port will do). Ethereum: synchronized geth with WS and JSON-RPC enabled (localhost and default port will do).

Offline machine: Bitcoin: unsynchronized bitcoind server with JSON-RPC enabled (localhost and default port will do) -- it will be used for signing only. Ethereum: unsynchronized geth with WS and JSON-RPC enabled (localhost and default port will do) -- it will be used for signing only.

All machines: PHP 5.6+, Composer installed (Ubuntu: sudo apt-get install php7.0 composer) Nodejs, npm installed (Ubuntu: sudo apt-get install nodejs-legacy npm)

Preparation

In the following folders run 'composer update' command to fetch the dependencies: step2/eth, step4/eth

Bitcoin workflow is as following

Step 1

Should be done on offline computer. Scripts generate 2 lists: one secret list with private keys ( secretlist.json ), it should be kept secret. Other is a list of addresses that should be sent to investors ( publiclist.json ).

Step 2

Should be done on online computer with synchronized bitcoind installed when you need to gather funds from wallets.

Put publiclist.json from step 1 in the folder step2/btc with scripts. Edit script get_balances.php and put RECEIVER_ADDR constant to address of wallet to transfer funds to (BTC only). Enter appropriate user and password to connect to bitcoind server.

run: php get_balances.php and wait for script to complete. The results of the script work will be available in the same folder as balances.json file, it will contain current balances and (for BTC) prepared output transactions. Warning: only non-empty addresses will be dumped.

Step 3

Should be done on offline computer with (possibly) unsynchronized bitcoind installed.

Edit script sign_txs.php and enter appropriate user and password to connect to bitcoind server. Transfer balances.json file generated at step 2 from online machine to offline machine to folder step3/btc by any means (via USB flash for example). Put secretlist.json file from step 1 to step3/btc folder.

run: php sign_txs.php

The output with signed transaction will be in file signed.json . Move this file to online machine.

Step 4

Should be done on online computer with synchronized bitcoind installed. Edit script send_txs.php and enter appropriate user and password to connect to bitcoind server.

Move signed.json file from step3 to step4/btc folder. Run php send_txs.php and wait for script to push transactions to network. The output with TXIDs will be available in sent_txns.json file.

Ethereum workflow is as following

Step 1

Should be done on offline computer. Scripts generate 2 lists: one secret list with private keys ( secretlist.json ), it should be kept secret. Other is a list of addresses that should be sent to investors ( publiclist.json ).

Step 2

Should be done on online computer with synchronized geth installed when you need to gather funds from wallets.

Put publiclist.json from step 1 in the folder step2/btc with scripts. Enter appropriate user and password to connect to geth server.

run: php get_balances.php and wait for script to complete. The results of the script work will be available in the same folder as balances.json file, it will contain current balances. Warning: only non-empty addresses will be dumped.

Step 3

Should be done on offline computer with (possibly) unsynchronized geth installed.

Edit script sign_txs.php and enter appropriate user and password to connect to geth server. Transfer balances.json file generated at step 2 from online machine to offline machine to folder step3/eth by any means (via USB flash for example). Put secretlist.json file from step 1 to step3/eth folder.

run: node index.js

The output with signed transaction will be in file signed.json . Move this file to online machine.

Step 4

Should be done on online computer with synchronized geth installed. Edit script send_txs.php and enter appropriate user and password to connect to geth server.

Move signed.json file from step3 to step4/eth folder. Run php send_txs.php and wait for script to push transactions to network. The output with TXIDs will be available in sent_txns.json file.

ico-secure's People

Contributors

erupakov avatar tarikkumar7 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.