wallet.proto start #47

Closed
orblivion wants to merge 14 commits from wallet.proto into master
Showing only changes of commit 99ad1f0c31 - Show all commits

View file

@ -5,10 +5,10 @@ package pb;
// TODO - timestamps need not be uint64 right?
message Wallet {
repeated Account accounts = 1;
string name = 2;
repeated Account accounts = 1; // Accounts associated with this wallet
string name = 2; // Human readable name for this wallet
TimestampedPreferences preferences = 3;
uint32 version = 4;
uint32 version = 4; // Wallet spec version
/*
Python had these but probably unrelated
@ -20,25 +20,40 @@ message Wallet {
}
message Account {
message AddressGenerator {
message AddressManager {
uint32 gap = 1; // uint64? not sure how big this might get
uint32 maximum_uses_per_address = 2 [json_name="maximum_uses_per_address"];
message AddressGenerator { // Meta-manager for both singular or deterministically generated addresses
lyoshenka commented 2022-01-31 23:39:53 +01:00 (Migrated from github.com)
Review

@eukreign can this name field contain any name or is it choosing from a fixed set of options?

@eukreign can this name field contain any name or is it choosing from a fixed set of options?
eukreign commented 2022-01-31 23:44:57 +01:00 (Migrated from github.com)
Review

just the two listed in the comment

just the two listed in the comment
lyoshenka commented 2022-02-01 18:34:35 +01:00 (Migrated from github.com)
Review

@orblivion can you make these oneOfs plz

@orblivion can you make these `oneOf`s plz
orblivion commented 2022-02-01 21:39:23 +01:00 (Migrated from github.com)
Review

I thought oneof was for fields (and thus types), not values. The only thing I saw for values was an enum, and that's only integers.

I thought `oneof` was for fields (and thus types), not values. The only thing I saw for values was an enum, and that's only integers.
orblivion commented 2022-02-01 22:00:24 +01:00 (Migrated from github.com)
Review

Now, if this is valuable enough that schema changes are on the table, an enum may be the way to go.

enum AddressManagerType {
  single_address = 0;
  deterministic_chain = 1;
}
Now, if this is valuable enough that schema changes are on the table, an enum may be the way to go. ``` enum AddressManagerType { single_address = 0; deterministic_chain = 1; } ```
lyoshenka commented 2022-02-08 15:33:27 +01:00 (Migrated from github.com)
Review

you're right, i meant enum

you're right, i meant enum
lyoshenka commented 2022-02-08 15:34:39 +01:00 (Migrated from github.com)
Review

if enum doesn't do strings, there are two options. one is to leave it as a string. the other is to have it as an enum but then convert that to a string on save/load.

i think leaving it as a string is fine here

if enum doesn't do strings, there are two options. one is to leave it as a string. the other is to have it as an enum but then convert that to a string on save/load. i think leaving it as a string is fine here
orblivion commented 2022-02-08 21:33:50 +01:00 (Migrated from github.com)
Review

If we need to do custom conversion code for the preferences json blob, I could do that here too.

If we need to do custom conversion code for the preferences json blob, I could do that here too.
message AddressManager { // Manager for deterministically generated addresses
// TODO - it seems like chain can be as high as (1 << 32) - 1. I think that means that uint32 should cover `gap`?
uint32 gap = 1; // Maximum allowed consecutive generated addresses with no transactions
uint32 maximum_uses_per_address = 2 [json_name="maximum_uses_per_address"]; // Maximum number of uses for each generated address
}
string name = 1;
AddressManager change = 2;
AddressManager receiving = 3;
string name = 1; // type of address generator: "deterministic-chain" or "single-address"
AddressManager change = 2; // Manager for deterministically generated change address (not used if `name` is set to `"single-address")
AddressManager receiving = 3; // Manager for deterministically generated receiving address (not used if `name` is set to `"single-address")
}
AddressGenerator address_generator = 1 [json_name="address_generator"];
map<string, string> certificates = 2;
bool encrypted = 3;
string ledger = 4;
uint32 modified_on = 5 [json_name="modified_on"];
string name = 6;
AddressGenerator address_generator = 1 [json_name="address_generator"]; // Meta-manager for both singular or deterministically generated addresses
map<string, string> certificates = 2; // Channel keys. Mapping from public key address to pem-formatted private key.
bool encrypted = 3; // Whether private key and seed are encrypted
string ledger = 4; // Which network to use ("lbc_mainnet", etc)
uint32 modified_on = 5 [json_name="modified_on"]; // last modified time in Unix Time
string name = 6; // Name for account, possibly human readable
/*
if `address_generator.name` is set to `"single-address"`:
private key for address
if `address_generator.name` is set to `"deterministic-chain"`:
root of chain of private keys for addresses
encrypted if `encrypted` is set to `true`
*/
string private_key = 7 [json_name="private_key"];
/*
public key for address if `address_generator.name` is set to `"single-address"`
root of chain of public keys for addresses if `address_generator.name` is set to `"deterministic-chain"`
*/
string public_key = 8 [json_name="public_key"];
string seed = 9;
string seed = 9; // Human readable representation of `private_key`
}
message TimestampedPreferences {