Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

export legacy wallets in a friendly way for automatic import in cardano-wallet #4278

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Commits on Mar 17, 2020

  1. implement export-wallets for Byron reboot migration

    This little command-line tool extract the name and encrypted XPrv of
    known wallets and spits them back in a user-friendly format on stdout.
    
    $ export-wallets --mainnet --wallet-db-path state-wallet-mainnet/wallet-db --keyfile state-wallet-mainnet/secret.key
    [
        {
            "encrypted_root_private_key": "5da58210e3f6e2b1e24659158554f91bb5970202ba0e0cd2d32767ce3c2893c29515a5469493f6133857c0dc86f127aa70e46d047424e07f7221715357bfb35052aed22cefd53ea7d75b5804add54e653c21e03ffd7c01cb8f6c033f7d383cc127046148d89a1828b76bdb46b56f6fec06d31b5b412dc68ab4b5ffa2418e7e8d",
            "name": "My Wallet",
            "passphrase_hash": "31347c387c317c57434478796c7064635a736853367a6d3150766d54456a34667038795a34623145557868627765347a36596645413d3d7c48544739445a456d4f2b79535a6a705a76553145614d795a437170732b43347330704738414562745638773d"
        }
    ]
    
    The format matches exactly the JSON format expected by the
    cardano-wallet for restoring legacy wallet from xprv.
    KtorZ committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    f63761e View commit details
    Browse the repository at this point in the history
  2. Return 'null' for 'passphrase_hash' when there's no passphrase set

    $ export-wallets --mainnet --wallet-db-path state-wallet-mainnet/wallet-db --keyfile state-wallet-mainnet/secret.key
    [
        {
            "encrypted_root_private_key": "b824f5268bdf05d783b0c594936e51c65d6d155021ddcbdb3370bb7a51caba4bedece046fc9d12143ce900d8238e444904e08a85af80299b012e7f12030a2ab6d3d1cf6fc565476c17326baebddcf31c5e3409ba697b9bf04ac588cb59868c22d043e0237a3ba2eb167d1504dd93f788fc4a72503a261cf338ad7e4cf8837aff",
            "name": "My Wallet",
            "passphrase_hash": null
        },
        {
            "encrypted_root_private_key": "5da58210e3f6e2b1e24659158554f91bb5970202ba0e0cd2d32767ce3c2893c29515a5469493f6133857c0dc86f127aa70e46d047424e07f7221715357bfb35052aed22cefd53ea7d75b5804add54e653c21e03ffd7c01cb8f6c033f7d383cc127046148d89a1828b76bdb46b56f6fec06d31b5b412dc68ab4b5ffa2418e7e8d",
            "name": "My Wallet",
            "passphrase_hash": "31347c387c317c57434478796c7064635a736853367a6d3150766d54456a34667038795a34623145557868627765347a36596645413d3d7c48544739445a456d4f2b79535a6a705a76553145614d795a437170732b43347330704738414562745638773d"
        }
    ]
    KtorZ committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    148076e View commit details
    Browse the repository at this point in the history
  3. regen nix files

    cleverca22 committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    787e72e View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2020

  1. fail when given a non-existing database path

    Before that, the script would simply create a new empty database and pretty much
    fail to export every wallet in the keystore
    KtorZ committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    da6645c View commit details
    Browse the repository at this point in the history
  2. re-generate nix machinery

    KtorZ committed Mar 18, 2020
    Configuration menu
    Copy the full SHA
    9b53dc1 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2020

  1. Configuration menu
    Copy the full SHA
    1702a9e View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2020

  1. returns wallets with no metadata if prv key exists

    Name is therefore set to null.
    KtorZ committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    776a638 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    996a17f View commit details
    Browse the repository at this point in the history
  3. re-generate nix machinery

    KtorZ committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    6054e7e View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2020

  1. Configuration menu
    Copy the full SHA
    13f5729 View commit details
    Browse the repository at this point in the history
  2. show in the JSON export whether a passphrase is empty or not

      ```json
      $ export-wallets --mainnet --keyfile state-wallet-mainnet/secret.key
      [
          {
              "encrypted_root_private_key": "18b952a968ccbac047f9c227dd05fced84ba85a1f83daf54f0a3c0de3e5664502678b1ba34a0b44ce22a2b54f39830570bdfeeed0a2f8586aa988fa5399987252b81f30b3c1e4c39e1edb16a4c7975eea106fc5d12d3b4fa516b9332f777defba949a42ef709a2d2f5c64057e99987c545b6e014f8cd9502bd5b800ddc6e10b7",
              "is_passphrase_empty": true,
              "name": null,
              "id": "f1aaaf1e1e6db1255ec2d59d50c5db892ff20330",
              "passphrase_hash": "31347c387c317c5743424875746242496c6a66734d764934314a30727a79663076657375724954796376766a793150554e377452673d3d7c54753434596d6e547957546c5759674a3164494f7974474a7842632b432f7862507657382b5135356a38303d"
          },
          {
              "encrypted_root_private_key": "6d9e6a5135d373fb62eadaf02bc8f5ecf35148806721c704c6dbfcf818ff958f1fc4a933542c423f5b8621cfe6404c4b208f2c96f6246082dffbc9fb1029a79ed33651377731e0e59e0233425a55257782c5adaa768da0567f43c1c6c0c18766ed0a547bb34eb472c120b170a8640279832ddf18002887f03c15dea59705422d",
              "is_passphrase_empty": false,
              "name": null,
              "id": "05377e480bd68a2da04f00c39ce5886e4746ed1f",
              "passphrase_hash": "31347c387c317c574342652b796362417576356c2b4258676a344a314c6343675375414c2f5653393661364e576a2b7550766655513d3d7c2f376738486c59723174734e394f6e4e753253302b6a65515a6b5437316b45414941366a515867386539493d"
          }
      ]
      ```
    KtorZ committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    c1815b7 View commit details
    Browse the repository at this point in the history