Skip to content

Settings21/Octra-Tools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Octra Wallet CLI Tool

Python CLI tool to generate Octra wallet data from seed phrase (mnemonic).

Features

  • ✅ Generate wallet from existing seed phrase
  • ✅ Generate new random seed phrase (12 or 24 words)
  • ✅ Recover from BIP39 entropy (hex) → mnemonic + keys
  • ✅ Recover from BIP39 seed (hex) → private key + address
  • ✅ Optional BIP39 passphrase support
  • ✅ Verbose output mode with:
    • Wallet Address
    • Private Key (Base64)
    • Public Key (Hex)
    • Mnemonic Phrase
    • Entropy (Hex)
    • Seed (Hex)
    • Master Chain (Hex)
    • Test Message
    • Test Signature (Base64) + verification
  • ✅ Save wallet details to JSON file

Installation

1. Install Dependencies

pip install -r requirements.txt

Required dependencies:

  • mnemonic - for BIP39 mnemonic generation/validation
  • PyNaCl - for Ed25519 cryptography

2. Verify Installation

python octra.py --help

Usage

Generate Wallet from Existing Seed Phrase

python octra.py "your twelve word seed phrase goes here today"

With verbose details and optional BIP39 passphrase:

python octra.py "your seed phrase" --verbose --passphrase "optional passphrase"

Generate New Wallet with Random Seed Phrase

Generate with 12 words (default):

python octra.py --generate

Generate with 24 words:

python octra.py --generate --words 24

Generate with verbose details and save to file:

python octra.py --generate --verbose --save octra_wallet.json

Recover from Entropy (Hex)

Convert BIP39 entropy to mnemonic and derive keys:

python octra.py --entropy-hex <ENTROPY_HEX> --verbose

With BIP39 passphrase applied during seed derivation:

python octra.py --entropy-hex <ENTROPY_HEX> --passphrase "optional passphrase" --verbose

Recover from Seed (Hex)

Derive master private key, Base64 private key, public key, and address directly from seed:

python octra.py --seed-hex <SEED_HEX> --verbose

Example Output (Verbose)

============================================================
OCTRA WALLET INFORMATION
============================================================

MNEMONIC PHRASE:
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about

WALLET ADDRESS:
octAuNz35Tc3Bfcurox4c82aZMLN3RvXDJ1T9HVTwqK7et6

PRIVATE KEY (Base64):
HrmRVVuh1mno8y896SAUSVktK8tP/w8k5alOEJ8VEDE=

PUBLIC KEY (Hex):
1e0336c5bfca95c1b6b6cff4e191142f8ef2dd2ebde87b3d78e7783e054779d9

ENTROPY:
000102030405060708090a0b0c0d0e0f

SEED:
3779b041fab425e9c0fd55846b2a03e9a388fb12784067bd8ebdb464c2574a05bcc7a8eb54d7b2a2c8420ff60f630722ea5132d28605dbc996c8ca7d7a8311c0

MASTER CHAIN:
ccaa85c7e87a2953b2f6b29423fecf01d4991b0af8c14cdd221f2969bb36e183

TEST MESSAGE:
{"from":"me","to":"test","amount":"1000"}

TEST SIGNATURE:
quvH3TaDs+2nkdj6ZjVwZWHcSX1Ro/Wt84xksHp81NMUY1inl3P2qHkmM1UGcKyaRU7lDoNe+gqPlv7Qrpp4Dg==

SIGNATURE:
Yes

============================================================
⚠️  SECURITY WARNING:
- Keep this information secure and never share it
- Anyone with access can control your wallet
============================================================

Technical Implementation

This tool implements the same algorithms as the JavaScript version:

  1. Mnemonic to Seed: Uses BIP39 to convert mnemonic to seed (supports optional passphrase)
  2. Master Key Derivation: HMAC-SHA512 with key "Octra seed"
  3. Key Pair Generation: Ed25519 signing key pair using NaCl
  4. Address Creation: SHA-256 hash of public key, Base58 encoded, prefixed with "oct"
  5. Entropy → Mnemonic: Recover mnemonic from BIP39 entropy (hex)
  6. Seed (Hex) → Keys: Recover private/public keys and address directly from seed

Security

⚠️ IMPORTANT:

  • Private key and mnemonic phrase provide full access to your wallet
  • Never share this information with anyone
  • Store in a secure and encrypted location
  • Delete output from terminal/files after securely backing up

Compatibility

This tool is 100% compatible with the existing JavaScript implementation in the Octra Extension project. Wallets generated with this tool can be used in the extension and vice versa.

Troubleshooting

Error: "Invalid mnemonic phrase"

  • Ensure your seed phrase is valid (12 or 24 words)
  • Words must be from the BIP39 wordlist
  • Check spelling and spacing

Error: "ModuleNotFoundError"

  • Run pip install -r requirements.txt
  • Ensure you're using Python 3.7+

License

Same as the Octra Extension project license.

About

Python CLI tool to generate Octra wallet data from seed phrase (mnemonic).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%