wallet.proto start #47

Closed
orblivion wants to merge 14 commits from wallet.proto into master
3 changed files with 683 additions and 0 deletions

76
v2/proto/wallet.proto Normal file
View file

@ -0,0 +1,76 @@
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 {
lyoshenka commented 2022-02-01 18:35:12 +01:00 (Migrated from github.com)
Review

@eukreign can you take a look at the Account part of the protobuf and see if it looks right to you please?

@eukreign can you take a look at the Account part of the protobuf and see if it looks right to you please?
eukreign commented 2022-02-02 03:40:16 +01:00 (Migrated from github.com)
Review

hard to give feedback since i don't know what this is all for and why we need it

hard to give feedback since i don't know what this is all for and why we need it
orblivion commented 2022-02-02 20:49:15 +01:00 (Migrated from github.com)
Review

In the grand scheme, we're working on a new non-custodial wallet sync system. That means we need to think about how often to sync, and thus what to sync. For that, we should have an inventory of what's in the wallet. And then we can talk about changing it if need be.

And it's also useful in its own right. It serves as documentation for whoever wants it. But also, if we make a protobuf definition, we can use it in the SDK (I'm starting to poke at this right now as well). Anybody who wants to re-implement the SDK could use it.

In the grand scheme, we're working on a new non-custodial wallet sync system. That means we need to think about how often to sync, and thus what to sync. For that, we should have an inventory of what's in the wallet. And then we can talk about changing it if need be. And it's also useful in its own right. It serves as documentation for whoever wants it. But also, if we make a protobuf definition, we can use it in the SDK (I'm starting to poke at this right now as well). Anybody who wants to re-implement the SDK could use it.
eukreign commented 2022-02-03 23:50:54 +01:00 (Migrated from github.com)
Review

The wallet is currently stored as JSON, which is already readable by pretty much every programming language and plain text tool out there (linux command line tools); not to mention readable by people via a text editor.

protobuf is nice if you absolutely have to squeeze every last bit of bytes out of your storage medium (such storing data on blockchain) but in terms of debugging and interoperability it's somewhat more limited (not every language has protobuf implementation).

I would be against adding this to the SDK since I think the wallet should be in an easily accessible format but maybe your protobuf wallet version makes sense for your sync tool, I just don't know enough about your project to provide feedback.

If you just want to document the current JSON wallet structure there is https://json-schema.org/

The wallet is currently stored as JSON, which is already readable by pretty much every programming language and plain text tool out there (linux command line tools); not to mention readable by people via a text editor. `protobuf` is nice if you absolutely have to squeeze every last bit of bytes out of your storage medium (such storing data on blockchain) but in terms of debugging and interoperability it's somewhat more limited (not every language has protobuf implementation). I would be against adding this to the SDK since I think the wallet should be in an easily accessible format but maybe your protobuf wallet version makes sense for your sync tool, I just don't know enough about your project to provide feedback. If you just want to document the current JSON wallet structure there is https://json-schema.org/
orblivion commented 2022-02-04 16:32:34 +01:00 (Migrated from github.com)
Review

Ah yes I made one thing unclear - I didn't mean that we would change the saved format. Just that we'd use the python pb libraries everywhere we could, but ultimately parse and generate json.

Overall I think Grin's idea was to use types/ as our one repository of formats and add the wallet to it. But I'll let him make his case.

Ah yes I made one thing unclear - I didn't mean that we would change the saved format. Just that we'd use the python pb libraries everywhere we could, but ultimately parse and generate json. Overall I think Grin's idea was to use `types/` as our one repository of formats and add the wallet to it. But I'll let him make his case.
orblivion commented 2022-02-04 18:50:58 +01:00 (Migrated from github.com)
Review

Here's my exploratory WIP, so you can see what it might look like:

https://github.com/lbryio/lbry-sdk/compare/master...orblivion:wallet.proto?expand=1

Here's my exploratory WIP, so you can see what it might look like: https://github.com/lbryio/lbry-sdk/compare/master...orblivion:wallet.proto?expand=1
lyoshenka commented 2022-02-08 15:41:24 +01:00 (Migrated from github.com)
Review

@eukreign i agree with you that wallet files should stay json so ppl can read them easily (though this is not a strong preference). the reason i chose protobuf to document the structure is that we already use protobufs in a few places in our code and it would let us stay consistent. if i were choosing in a vacuum, id probably choose json-schema.

@eukreign i agree with you that wallet files should stay json so ppl can read them easily (though this is not a strong preference). the reason i chose protobuf to document the structure is that we already use protobufs in a few places in our code and it would let us stay consistent. if i were choosing in a vacuum, id probably choose json-schema.
lyoshenka commented 2022-02-08 15:41:40 +01:00 (Migrated from github.com)
Review

so given that, are you still against this pr?

so given that, are you still against this pr?
eukreign commented 2022-02-09 14:18:01 +01:00 (Migrated from github.com)
Review

The WIP appears to delete a bunch of to_dict, which I've found very useful during debugging when working on the SDK. I'm still not sure what benefit this would bring to the SDK. Is the wallet sync mentioned earlier going to be implemented in the SDK? I don't want to change something that is already working well unless there is a really good reason for it; especially something as important as wallet serialization. People will be upset if they lose their funds.

The WIP appears to delete a bunch of `to_dict`, which I've found very useful during debugging when working on the SDK. I'm still not sure what benefit this would bring to the SDK. Is the wallet sync mentioned earlier going to be implemented in the SDK? I don't want to change something that is already working well unless there is a really good reason for it; especially something as important as wallet serialization. People will be upset if they lose their funds.
orblivion commented 2022-02-09 16:53:49 +01:00 (Migrated from github.com)
Review

Sure, it was a blind first go at it. I wouldn't have removed to_dict if it occurred to me that it was useful for debuging. Maybe POC would be more accurate than WIP. It was also a chance to get a better sense of the code base, including by making mistakes like this.

I agree, I'd worry about making changes to stable code at the risk of losing funds.

I think the original proposition was less about a benefit to the SDK, and more about long term uniformity and consistency of LBRY-related formats as defined in types. Perhaps it could be at a short term expense of putting it into the lbry-sdk repository. Though I could throw in, perhaps post-hoc, that long term it might in principle benefit the sdk as an extra check to make sure that the format doesn't accidentally deviate as code changes are made.

@lyoshenka - if that's right, with all that in mind perhaps I could approach the PR totally differently. If the goal is to make sure that the format defined in types is the one used in the SDK, what if I only write test cases to ensure this? Then I won't risk affecting the functionality at all. For the SDK's sake it would at worst be a small waste of development time, and at best catch some mistakes early.

As I wrote it, I actually went out of my way to use the protobuf primitives. But the Python protobuf library accepts dicts as input. I could make the test pretty simple: Take the dict coming out of the wallet functions, convert it to a protobuf object, and then check the protobuf fields to make sure they match the values in the input dict.

...and then over time, as changes are made to that core functionality of the SDK, we could choose to start to introduce the protobuf definition more directly. Or not.

As for whether the SDK is going to be touched for sync: Mostly it's about sending the wallet over the wire, which afaik (I'm still internalising the LBRY stack) is mostly what the app does. As I understand, the SDK is already handing the wallet to the app for the current wallet sync system. I was going to add some metadata, but I'm not sure if that's SDK related or app related. There will also be the issue of conflict resolutions, which may or may not be fundamentally new. I'm not sure if the SDK would be a better place for that since it handles the wallet format more directly.

Sure, it was a blind first go at it. I wouldn't have removed `to_dict` if it occurred to me that it was useful for debuging. Maybe POC would be more accurate than WIP. It was also a chance to get a better sense of the code base, including by making mistakes like this. I agree, I'd worry about making changes to stable code at the risk of losing funds. I think the original proposition was less about a benefit to the SDK, and more about long term uniformity and consistency of LBRY-related formats as defined in `types`. Perhaps it could be at a short term expense of putting it into the lbry-sdk repository. Though I could throw in, perhaps post-hoc, that long term it might in principle benefit the sdk as an extra check to make sure that the format doesn't accidentally deviate as code changes are made. @lyoshenka - if that's right, with all that in mind perhaps I could approach the PR totally differently. If the goal is to make sure that the format defined in `types` is the one used in the SDK, what if I _only_ write test cases to ensure this? Then I won't risk affecting the functionality at all. For the SDK's sake it would at worst be a small waste of development time, and at best catch some mistakes early. As I wrote it, I actually went out of my way to use the protobuf primitives. But the Python protobuf library accepts dicts as input. I could make the test pretty simple: Take the dict coming out of the wallet functions, convert it to a protobuf object, and then check the protobuf fields to make sure they match the values in the input dict. ...and then over time, as changes are made to that core functionality of the SDK, we could choose to start to introduce the protobuf definition more directly. Or not. As for whether the SDK is going to be touched for sync: Mostly it's about sending the wallet over the wire, which afaik (I'm still internalising the LBRY stack) is mostly what the app does. As I understand, the SDK is already handing the wallet to the app for the current wallet sync system. I was going to add some metadata, but I'm not sure if that's SDK related or app related. There will also be the issue of conflict resolutions, which may or may not be fundamentally new. I'm not sure if the SDK would be a better place for that since it handles the wallet format more directly.
orblivion commented 2022-02-09 20:36:16 +01:00 (Migrated from github.com)
Review

From talking with @lyoshenka we decided json-schema makes most sense if only because the arbitrary json data in the preferences fields for the apps makes an awkward fit for protobuf. I'll close this issue, but we may reopen the question of integrating the json-schema to make sure the sdk conforms, analogously to what we've discussed here with protobuf.

From talking with @lyoshenka we decided json-schema makes most sense if only because the arbitrary json data in the preferences fields for the apps makes an awkward fit for protobuf. I'll close this issue, but we may reopen the question of integrating the json-schema to make sure the sdk conforms, analogously to what we've discussed here with protobuf.
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
}
message AddressGenerator { // Meta-manager for both singular or deterministically generated addresses
string name = 1; // type of address generator: "deterministic-chain" or "single-address"
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.
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 { // seen in sdk. do we want this here?
double ts = 1; // TODO string?
bool value = 2;
}
message EnableSync { // seen in example wallet. do we want this here?
double ts = 1; // TODO string?
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?
}
double ts = 1; // TODO string?
Preferences_ value = 2;
}
}

10
v2/python/mktest.py Normal file
View file

@ -0,0 +1,10 @@
import wallet_pb2, json
from google.protobuf.json_format import ParseDict, MessageToDict
original = json.load(open('/home/user/projects/wallet-spec/example-wallets/example_wallet'))
back_and_forth = MessageToDict(ParseDict(original, wallet_pb2.Wallet()))
open('/tmp/original', 'w').write(json.dumps(original, sort_keys=True, indent=4))
open('/tmp/back_and_forth', 'w').write(json.dumps(back_and_forth, sort_keys=True, indent=4))
print('meld /tmp/original /tmp/back_and_forth')

597
v2/python/wallet_pb2.py Normal file
View file

@ -0,0 +1,597 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: wallet.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='wallet.proto',
package='pb',
syntax='proto3',
serialized_pb=_b('\n\x0cwallet.proto\x12\x02pb\x1a\x1cgoogle/protobuf/struct.proto\"w\n\x06Wallet\x12\x1d\n\x08\x61\x63\x63ounts\x18\x01 \x03(\x0b\x32\x0b.pb.Account\x12\x0c\n\x04name\x18\x02 \x01(\t\x12/\n\x0bpreferences\x18\x03 \x01(\x0b\x32\x1a.pb.TimestampedPreferences\x12\x0f\n\x07version\x18\x04 \x01(\r\"\xba\x04\n\x07\x41\x63\x63ount\x12J\n\x11\x61\x64\x64ress_generator\x18\x01 \x01(\x0b\x32\x1c.pb.Account.AddressGeneratorR\x11\x61\x64\x64ress_generator\x12\x33\n\x0c\x63\x65rtificates\x18\x02 \x03(\x0b\x32\x1d.pb.Account.CertificatesEntry\x12\x11\n\tencrypted\x18\x03 \x01(\x08\x12\x0e\n\x06ledger\x18\x04 \x01(\t\x12 \n\x0bmodified_on\x18\x05 \x01(\rR\x0bmodified_on\x12\x0c\n\x04name\x18\x06 \x01(\t\x12 \n\x0bprivate_key\x18\x07 \x01(\tR\x0bprivate_key\x12\x1e\n\npublic_key\x18\x08 \x01(\tR\npublic_key\x12\x0c\n\x04seed\x18\t \x01(\t\x1aY\n\x0e\x41\x64\x64ressManager\x12\x0b\n\x03gap\x18\x01 \x01(\r\x12:\n\x18maximum_uses_per_address\x18\x02 \x01(\rR\x18maximum_uses_per_address\x1a{\n\x10\x41\x64\x64ressGenerator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12*\n\x06\x63hange\x18\x02 \x01(\x0b\x32\x1a.pb.Account.AddressManager\x12-\n\treceiving\x18\x03 \x01(\x0b\x32\x1a.pb.Account.AddressManager\x1a\x33\n\x11\x43\x65rtificatesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb0\x04\n\x16TimestampedPreferences\x12G\n\x0b\x65nable_sync\x18\x01 \x01(\x0b\x32%.pb.TimestampedPreferences.EnableSyncR\x0b\x65nable-sync\x12R\n\x0f\x65ncrypt_on_disk\x18\x02 \x01(\x0b\x32(.pb.TimestampedPreferences.EncryptOnDiskR\x0f\x65ncrypt-on-disk\x12\x35\n\x05local\x18\x03 \x01(\x0b\x32&.pb.TimestampedPreferences.Preferences\x12\x36\n\x06shared\x18\x04 \x01(\x0b\x32&.pb.TimestampedPreferences.Preferences\x1a*\n\rEncryptOnDisk\x12\n\n\x02ts\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x08\x1a\'\n\nEnableSync\x12\n\n\x02ts\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x08\x1a\xb4\x01\n\x0bPreferences\x12\n\n\x02ts\x18\x01 \x01(\x01\x12\x42\n\x05value\x18\x02 \x01(\x0b\x32\x33.pb.TimestampedPreferences.Preferences.Preferences_\x1aU\n\x0cPreferences_\x12\x0c\n\x04type\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0f\n\x07version\x18\x03 \x01(\tb\x06proto3')
,
dependencies=[google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_WALLET = _descriptor.Descriptor(
name='Wallet',
full_name='pb.Wallet',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='accounts', full_name='pb.Wallet.accounts', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='name', full_name='pb.Wallet.name', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='preferences', full_name='pb.Wallet.preferences', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='version', full_name='pb.Wallet.version', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=50,
serialized_end=169,
)
_ACCOUNT_ADDRESSMANAGER = _descriptor.Descriptor(
name='AddressManager',
full_name='pb.Account.AddressManager',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='gap', full_name='pb.Account.AddressManager.gap', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='maximum_uses_per_address', full_name='pb.Account.AddressManager.maximum_uses_per_address', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, json_name='maximum_uses_per_address'),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=475,
serialized_end=564,
)
_ACCOUNT_ADDRESSGENERATOR = _descriptor.Descriptor(
name='AddressGenerator',
full_name='pb.Account.AddressGenerator',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='name', full_name='pb.Account.AddressGenerator.name', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='change', full_name='pb.Account.AddressGenerator.change', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='receiving', full_name='pb.Account.AddressGenerator.receiving', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=566,
serialized_end=689,
)
_ACCOUNT_CERTIFICATESENTRY = _descriptor.Descriptor(
name='CertificatesEntry',
full_name='pb.Account.CertificatesEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='pb.Account.CertificatesEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='value', full_name='pb.Account.CertificatesEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=_descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001')),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=691,
serialized_end=742,
)
_ACCOUNT = _descriptor.Descriptor(
name='Account',
full_name='pb.Account',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='address_generator', full_name='pb.Account.address_generator', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, json_name='address_generator'),
_descriptor.FieldDescriptor(
name='certificates', full_name='pb.Account.certificates', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='encrypted', full_name='pb.Account.encrypted', index=2,
number=3, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ledger', full_name='pb.Account.ledger', index=3,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='modified_on', full_name='pb.Account.modified_on', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, json_name='modified_on'),
_descriptor.FieldDescriptor(
name='name', full_name='pb.Account.name', index=5,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='private_key', full_name='pb.Account.private_key', index=6,
number=7, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, json_name='private_key'),
_descriptor.FieldDescriptor(
name='public_key', full_name='pb.Account.public_key', index=7,
number=8, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, json_name='public_key'),
_descriptor.FieldDescriptor(
name='seed', full_name='pb.Account.seed', index=8,
number=9, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_ACCOUNT_ADDRESSMANAGER, _ACCOUNT_ADDRESSGENERATOR, _ACCOUNT_CERTIFICATESENTRY, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=172,
serialized_end=742,
)
_TIMESTAMPEDPREFERENCES_ENCRYPTONDISK = _descriptor.Descriptor(
name='EncryptOnDisk',
full_name='pb.TimestampedPreferences.EncryptOnDisk',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ts', full_name='pb.TimestampedPreferences.EncryptOnDisk.ts', index=0,
number=1, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='value', full_name='pb.TimestampedPreferences.EncryptOnDisk.value', index=1,
number=2, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1039,
serialized_end=1081,
)
_TIMESTAMPEDPREFERENCES_ENABLESYNC = _descriptor.Descriptor(
name='EnableSync',
full_name='pb.TimestampedPreferences.EnableSync',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ts', full_name='pb.TimestampedPreferences.EnableSync.ts', index=0,
number=1, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='value', full_name='pb.TimestampedPreferences.EnableSync.value', index=1,
number=2, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1083,
serialized_end=1122,
)
_TIMESTAMPEDPREFERENCES_PREFERENCES_PREFERENCES_ = _descriptor.Descriptor(
name='Preferences_',
full_name='pb.TimestampedPreferences.Preferences.Preferences_',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='type', full_name='pb.TimestampedPreferences.Preferences.Preferences_.type', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='value', full_name='pb.TimestampedPreferences.Preferences.Preferences_.value', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='version', full_name='pb.TimestampedPreferences.Preferences.Preferences_.version', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1220,
serialized_end=1305,
)
_TIMESTAMPEDPREFERENCES_PREFERENCES = _descriptor.Descriptor(
name='Preferences',
full_name='pb.TimestampedPreferences.Preferences',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ts', full_name='pb.TimestampedPreferences.Preferences.ts', index=0,
number=1, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='value', full_name='pb.TimestampedPreferences.Preferences.value', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_TIMESTAMPEDPREFERENCES_PREFERENCES_PREFERENCES_, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1125,
serialized_end=1305,
)
_TIMESTAMPEDPREFERENCES = _descriptor.Descriptor(
name='TimestampedPreferences',
full_name='pb.TimestampedPreferences',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='enable_sync', full_name='pb.TimestampedPreferences.enable_sync', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, json_name='enable-sync'),
_descriptor.FieldDescriptor(
name='encrypt_on_disk', full_name='pb.TimestampedPreferences.encrypt_on_disk', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, json_name='encrypt-on-disk'),
_descriptor.FieldDescriptor(
name='local', full_name='pb.TimestampedPreferences.local', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='shared', full_name='pb.TimestampedPreferences.shared', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_TIMESTAMPEDPREFERENCES_ENCRYPTONDISK, _TIMESTAMPEDPREFERENCES_ENABLESYNC, _TIMESTAMPEDPREFERENCES_PREFERENCES, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=745,
serialized_end=1305,
)
_WALLET.fields_by_name['accounts'].message_type = _ACCOUNT
_WALLET.fields_by_name['preferences'].message_type = _TIMESTAMPEDPREFERENCES
_ACCOUNT_ADDRESSMANAGER.containing_type = _ACCOUNT
_ACCOUNT_ADDRESSGENERATOR.fields_by_name['change'].message_type = _ACCOUNT_ADDRESSMANAGER
_ACCOUNT_ADDRESSGENERATOR.fields_by_name['receiving'].message_type = _ACCOUNT_ADDRESSMANAGER
_ACCOUNT_ADDRESSGENERATOR.containing_type = _ACCOUNT
_ACCOUNT_CERTIFICATESENTRY.containing_type = _ACCOUNT
_ACCOUNT.fields_by_name['address_generator'].message_type = _ACCOUNT_ADDRESSGENERATOR
_ACCOUNT.fields_by_name['certificates'].message_type = _ACCOUNT_CERTIFICATESENTRY
_TIMESTAMPEDPREFERENCES_ENCRYPTONDISK.containing_type = _TIMESTAMPEDPREFERENCES
_TIMESTAMPEDPREFERENCES_ENABLESYNC.containing_type = _TIMESTAMPEDPREFERENCES
_TIMESTAMPEDPREFERENCES_PREFERENCES_PREFERENCES_.fields_by_name['value'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT
_TIMESTAMPEDPREFERENCES_PREFERENCES_PREFERENCES_.containing_type = _TIMESTAMPEDPREFERENCES_PREFERENCES
_TIMESTAMPEDPREFERENCES_PREFERENCES.fields_by_name['value'].message_type = _TIMESTAMPEDPREFERENCES_PREFERENCES_PREFERENCES_
_TIMESTAMPEDPREFERENCES_PREFERENCES.containing_type = _TIMESTAMPEDPREFERENCES
_TIMESTAMPEDPREFERENCES.fields_by_name['enable_sync'].message_type = _TIMESTAMPEDPREFERENCES_ENABLESYNC
_TIMESTAMPEDPREFERENCES.fields_by_name['encrypt_on_disk'].message_type = _TIMESTAMPEDPREFERENCES_ENCRYPTONDISK
_TIMESTAMPEDPREFERENCES.fields_by_name['local'].message_type = _TIMESTAMPEDPREFERENCES_PREFERENCES
_TIMESTAMPEDPREFERENCES.fields_by_name['shared'].message_type = _TIMESTAMPEDPREFERENCES_PREFERENCES
DESCRIPTOR.message_types_by_name['Wallet'] = _WALLET
DESCRIPTOR.message_types_by_name['Account'] = _ACCOUNT
DESCRIPTOR.message_types_by_name['TimestampedPreferences'] = _TIMESTAMPEDPREFERENCES
Wallet = _reflection.GeneratedProtocolMessageType('Wallet', (_message.Message,), dict(
DESCRIPTOR = _WALLET,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.Wallet)
))
_sym_db.RegisterMessage(Wallet)
Account = _reflection.GeneratedProtocolMessageType('Account', (_message.Message,), dict(
AddressManager = _reflection.GeneratedProtocolMessageType('AddressManager', (_message.Message,), dict(
DESCRIPTOR = _ACCOUNT_ADDRESSMANAGER,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.Account.AddressManager)
))
,
AddressGenerator = _reflection.GeneratedProtocolMessageType('AddressGenerator', (_message.Message,), dict(
DESCRIPTOR = _ACCOUNT_ADDRESSGENERATOR,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.Account.AddressGenerator)
))
,
CertificatesEntry = _reflection.GeneratedProtocolMessageType('CertificatesEntry', (_message.Message,), dict(
DESCRIPTOR = _ACCOUNT_CERTIFICATESENTRY,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.Account.CertificatesEntry)
))
,
DESCRIPTOR = _ACCOUNT,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.Account)
))
_sym_db.RegisterMessage(Account)
_sym_db.RegisterMessage(Account.AddressManager)
_sym_db.RegisterMessage(Account.AddressGenerator)
_sym_db.RegisterMessage(Account.CertificatesEntry)
TimestampedPreferences = _reflection.GeneratedProtocolMessageType('TimestampedPreferences', (_message.Message,), dict(
EncryptOnDisk = _reflection.GeneratedProtocolMessageType('EncryptOnDisk', (_message.Message,), dict(
DESCRIPTOR = _TIMESTAMPEDPREFERENCES_ENCRYPTONDISK,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.TimestampedPreferences.EncryptOnDisk)
))
,
EnableSync = _reflection.GeneratedProtocolMessageType('EnableSync', (_message.Message,), dict(
DESCRIPTOR = _TIMESTAMPEDPREFERENCES_ENABLESYNC,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.TimestampedPreferences.EnableSync)
))
,
Preferences = _reflection.GeneratedProtocolMessageType('Preferences', (_message.Message,), dict(
Preferences_ = _reflection.GeneratedProtocolMessageType('Preferences_', (_message.Message,), dict(
DESCRIPTOR = _TIMESTAMPEDPREFERENCES_PREFERENCES_PREFERENCES_,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.TimestampedPreferences.Preferences.Preferences_)
))
,
DESCRIPTOR = _TIMESTAMPEDPREFERENCES_PREFERENCES,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.TimestampedPreferences.Preferences)
))
,
DESCRIPTOR = _TIMESTAMPEDPREFERENCES,
__module__ = 'wallet_pb2'
# @@protoc_insertion_point(class_scope:pb.TimestampedPreferences)
))
_sym_db.RegisterMessage(TimestampedPreferences)
_sym_db.RegisterMessage(TimestampedPreferences.EncryptOnDisk)
_sym_db.RegisterMessage(TimestampedPreferences.EnableSync)
_sym_db.RegisterMessage(TimestampedPreferences.Preferences)
_sym_db.RegisterMessage(TimestampedPreferences.Preferences.Preferences_)
_ACCOUNT_CERTIFICATESENTRY.has_options = True
_ACCOUNT_CERTIFICATESENTRY._options = _descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001'))
# @@protoc_insertion_point(module_scope)