Skip to content

Simple command utilities to sign Mina transactions offline. Useful for cold wallets on Mina blockchain.

License

Notifications You must be signed in to change notification settings

t4top/mina-offline-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple command utilities to sign Mina transactions offline. Useful for cold wallets on Mina blockchain.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published