76 lines
3.1 KiB
Protocol Buffer
76 lines
3.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package pb;
|
|
|
|
import "google/protobuf/struct.proto";
|
|
|
|
// TODO - timestamps need not be uint64 right?
|
|
|
|
message Wallet {
|
|
repeated Account accounts = 1; // Accounts associated with this wallet
|
|
string name = 2; // Human readable name for this wallet
|
|
TimestampedPreferences preferences = 3;
|
|
uint32 version = 4; // Wallet spec version // TODO string? uint32?
|
|
}
|
|
|
|
message Account {
|
|
message AddressGenerator { // Meta-manager for both singular or deterministically generated addresses
|
|
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; // 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"]; // 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 with a password
|
|
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; // Human readable representation of `private_key`. encrypted if `encrypted` is set to `true`
|
|
}
|
|
|
|
message TimestampedPreferences {
|
|
EnableSync enable_sync = 1 [json_name="enable-sync"];
|
|
EncryptOnDisk encrypt_on_disk = 2 [json_name="encrypt-on-disk"];
|
|
Preferences local = 3;
|
|
Preferences shared = 4;
|
|
|
|
message EncryptOnDisk {
|
|
uint32 ts = 1;
|
|
bool value = 2;
|
|
}
|
|
message EnableSync {
|
|
uint32 ts = 1;
|
|
bool value = 2;
|
|
}
|
|
message Preferences {
|
|
message Preferences_ {
|
|
string type = 1; // TODO 'object' -- anything else?
|
|
google.protobuf.Struct value = 2;
|
|
string version = 3; // TODO string? uint32?
|
|
}
|
|
uint32 ts = 1;
|
|
Preferences_ value = 2;
|
|
}
|
|
}
|