hyperledger-labs / zeto

Privacy-preserving implementations of fungible and non-fungible tokens, using UTXO as the underlying transaction model
Apache License 2.0
20 stars 10 forks source link

File based key management for babyjubjub keys #23

Closed jimthematrix closed 4 weeks ago

jimthematrix commented 1 month ago

Similar to Ethereum v3 key files to persist encrypted private keys, save the private key in a JSON file like below:

{
    "crypto" : {
        "cipher" : "aes-128-ctr",
        "cipherparams" : {
            "iv" : "6087dab2f9fdbbfaddc31a909735c1e6"
        },
        "ciphertext" : "5318b4d5bcd28de64ee5559e671353e16f075ecae9f99c7a79a38af5f869aa46",
        "kdf" : "pbkdf2",
        "kdfparams" : {
            "c" : 262144,
            "dklen" : 32,
            "prf" : "hmac-sha256",
            "salt" : "ae3cd4e7013836a3df6bd7241b12db061dbe2c6785853cce422d148a624ce0bd"
        },
        "mac" : "517ead924a9d0dc3124507e3393d175ce3ff7c1e96529c6c555ce9e51205e9b2"
    },
    "id" : "3198bc9c-6672-5ab3-d995-4942343ae5b6",
    "version" : 3
}
jimthematrix commented 4 weeks ago

fixed by #26

It turns out the keystorev3 format works completely fine with a private key for the Babyjubjub curve. As such we don't need to include the actual key management capability, but instead encourage clients to use an existing solution like that demonstrated in the integration test (/go-sdk/integration-test/e2e_test.go)