moontreeapp / moontree

Primary Mono Repo
6 stars 5 forks source link

update export format #525

Closed lastmeta closed 6 days ago

lastmeta commented 2 years ago

Describe The Task

currently our export json structure looks like this (unencrypted)

{
  "wallets":{
    "03d992f22d9e178a4de02e99ffffe885bd5135e65d183200da3b566502eca79342":{
      "secret":"board ... column",
      "type":"Leader",
      "cipherUpdate":{
        "CipherType":"None",
        "PasswordId":"1"
      }
    },
    "0a13376bbd9bb7bc91a68b337391c019cbd4bb8d644ccf4094cdcb323d7c2309":{
      "secret":"cR..Q9",
      "type":"Single",
      "cipherUpdate":{
        "CipherType":"None",
        "PasswordId":"1"
      }
    }
  }
}
lastmeta commented 2 years ago

include name include "secret type" (mnemonic, private key, etc)

we want to encrypt the secret and secret type

{
  "wallets":{
    "03d992f22d9e178a4de02e99ffffe885bd5135e65d183200da3b566502eca79342":{
      "name":"1",
      "secret":"board ... column",          *encrypted*
      "secretType":"12 word mnemonic",      *encrypted*
      "type":"Leader",
      "cipherUpdate":{
        "CipherType":"None",
        "PasswordId":"1"
      }
    },
    "0a13376bbd9bb7bc91a68b337391c019cbd4bb8d644ccf4094cdcb323d7c2309":{
      "name":"2",
      "secret":"cR..Q9",                      *encrypted*
      "secretType":"single private key",      *encrypted*
      "type":"Single",
      "cipherUpdate":{
        "CipherType":"None",
        "PasswordId":"1"
      }
    }
  }
}
lastmeta commented 2 years ago

adding secretType and encrypting it and the secret

Whale-Street commented 2 years ago

Upon further consideration it would be best to create a Ravencoin Improvement Proposal standard for exporting from Ravencoin wallets. https://github.com/RavenProject/rips

Our current thinking is the following JSON schema:

{
  "accounts":{"accountUniqueId": [list of wallet keys]}, *optional
  'anything else such as notes by transactions etc.',    *optional
  "wallets":{ 
    "walletUniqueId - shouldn't be private key, could be anything, typically pubkey or hash of it": {
      "secret":"ef765f49c0c887157a6d02383d4d704ccc38e6b23872f273dee74d121acfc5739a01",
      "secret_type":"mnemonic", *optional, has set values
      "wallet_type":"Single",   *optional, has set values
      "name":"1",               *optional
      'anything else'           *optional
      "cipher_type":"None",     *has set values
      "key_hash":"foo",         *cannot be null
      "encrypted_keys": []      *optional, if not present all but the values of
                                 "cipher_type" and "key_hash" are encrypted
}}}