Giter VIP home page Giter VIP logo

mina-offline-util's Introduction

mina-offline-util

This is a simple CLI app for signing Mina Protocol transactions offline. The signed transactions can later be broadcasted from a different computer with internet connection to the Mina network. This app is useful for managing air-gapped cold wallets.

demo screenshot

Preparation

  • Node.js is required to run this script. Install Node.js on both your online and offline computers.

  • On online computer, checkout the source code and install all dependencies.

git clone https://github.com/t4top/mina-offline-util.git
cd mina-offline-util
npm install
  • Copy the script file (index.js), its configuration (package.json) and its dependencies (node_modules folder) to your offline computer using a USB stick.

Note: index.js, package.json and node_modules must all remain in the same folder.

Usage

  • Execute below command on the offline computer to start the app.
node index.js
  • The app will show an interactive CLI that will guide you through the steps. Follow the prompts and enter appropriate values. Above gif image is a sample screen capture of the CLI in action.

  • Copy the output JSON of the script to your online computer using a USB stick.

Broadcast signed transactions

  • The output JSON should look like below.

For signed payment transaction:

{
  "signature": {
    "field": "14753603935....",
    "scalar": "20270149766...."
  },
  "publicKey": "B62qmd....",
  "data": {
    "to": "B62qmd....",
    "from": "B62qmd....",
    "fee": "10000000",
    "amount": "10000000000",
    "nonce": "0",
    "memo": "Payment Transfer",
    "validUntil": "4294967295"
  }
}

For signed stake delegation transaction:

{
  "signature": {
    "field": "20501294904....",
    "scalar": "17717981555...."
  },
  "publicKey": "B62qmd....",
  "data": {
    "to": "B62qmd....",
    "from": "B62qmd....",
    "fee": "10000000",
    "nonce": "1",
    "memo": "Stake Delegation",
    "validUntil": "4294967295"
  }
}

Something went wrong please try again. Error was: unknown.

  • Wait few minutes for the transaction to be propagated through the network. Confirm this on the Mina Explorer.

License

Apache-2.0

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.