4

I wish to add a few more fields to the wallet file & save it in the keystore so that I can manage them better. For instance, consider the following:

{
    "address": "f028b78f23b5aa70f820dfe4fd0ab9cc48a7e823",
    "crypto": {
        "cipher": "aes-128-ctr",
        "cipherparams": {
            "iv": "50e5a41470ca12e4af407bdbfd6a8ac3"
        },
        "ciphertext": "995965d208a1513da4f89bc7326de3f089af137f48b1253eac29edbdce11f438",
        "kdf": "scrypt",
        "kdfparams": {
            "dklen": 32,
            "n": 262144,
            "p": 1,
            "r": 8,
            "salt": "facb3bc59bd6a983a9aed2da7cab1c5073e92dbf79992567525c6cc959d6fe9c"
        },
        "mac": "a28b2fa30f760d46170a893ae0c9e54d92f680f8e9c0eb4000877f76befc8667"
    },
    "id": "36ecb1c2-86df-4bea-9be4-08c2cb5742ae",
    "version": 3
}

I wish to add the fields: owner, type, label & passwordHint into this as follows:

{
    "address": "f028b78f28b5aa70f820dfe4fd0ab9cc48a7e8c5",
    "crypto": {
        "cipher": "aes-128-ctr",
        "cipherparams": {
            "iv": "50e5a41470ca12e4af407bdbfd6a8ac3"
        },
        "ciphertext": "995965d208a1513da4f89bc7326de3f089af137f48b1253eac29edbdce11f438",
        "kdf": "scrypt",
        "kdfparams": {
            "dklen": 32,
            "n": 262144,
            "p": 1,
            "r": 8,
            "salt": "facb3bc59bd6a983a9aed2da7cab1c5073e92dbf79992567525c6cc959d6fe9c"
        },
        "mac": "a28b2fa30f760d46170a893ae0c9e54d92f680f8e9c0eb4000877f76befc8667"
    },
    "id": "36ecb1c2-86df-4bea-9be4-08c2cb5742ae",
    "version": 3,
    "ownder": 'Liam Nelson',
    "label": 'Test Account',
    "type": 'Ethereum Classic',
    "passwordHint": 'Test Password'
}

How can I read a file from geth console; I tried using loadScript, it fails. Tried require(fileName), it reads but parsing fails!! Think it works depending on the file format!

I tried to require fs for file read/write. But seems the library doesn't exist.

Isn't geth console based on node console? Why are the fundamental libraries missing?

  • I think until the geth/ethereum people do not actively endorse additional arbitrary metadata it is bad practice to rely on the extendibility of the wallet format. Even IF it works. Would be better to store your additional information in an own file and load it in your DApp. Either via LoadScript or your JS application – Roland Kofler Aug 3 '16 at 11:52
  • Well isn't it a simple JSON file; I may probably use a meta key to chunk everything I want to put in there. I am managing close to 10/20 wallets & its getting overwhelming to understand whats what especially with ETC in the picture. – Jikku Jose Aug 5 '16 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.