Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add describe-guard primitive #851
base: master
Are you sure you want to change the base?
Add describe-guard primitive #851
Changes from 1 commit
767b7d0
c305913
1e7acdf
48539c9
9feea04
7051b5d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How should we handle type-specific metadata? I'm guessing we should only have
type
be common and everything else varies, but for some that's JSON no-no. What about adetails
field which is a varying object? Or is that overthinking itThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main motivating purpose for this was providing information to apps / wallets / etc about what keys they should sign with. So the big thing my immediate use case wants from this is public keys. Beyond that I really don't know. Probably the most important criteria is that any changes we make down the road can be done in a backwards-compatible manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess one other high level question is whether we should put the case-specific data at the same level or if we should make some kind of generic object wrapper to make it easier to decode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was what I was trying to suggest with
details
, let's do that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK this is where it gets interesting.
First, it should have
fun
andargs
fromUserGuard
.(Note that all of these (including other types) should probably try to stay consistent with JSON field names. This is maybe why a
details
field could be good, to make it really clear that we're enumerating the constructor JSON-style)Second: wasn't it a motivation to show all keysets? This is where we might be able to traverse the guard structure. Let's look at the JSON of a gas station with a key:
So, first, it might be nice to try to pretty-print in a
desc
field. More importantly, we can walk the args in that any time we find aTGuard
argument, we can find keysets! Then we dump them in akeysets
field. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds promising! I'm also thinking about the scenario where maybe you have a smart wallet that allows different keysets in different situations. Is there a way the smart wallet module could somehow expose what keys it's accepting? I'm imagining situations where it's not necessarily static. For instance, maybe you have a smart wallet designed to make funds available to beneficiaries on the event of death or loss of owner's keys. In this situation you might have a time delay. If it's been less than a year since the last transaction, only allow the owner's key. Otherwise allow some multi-sig of social recovery with maybe a family member plus an attorney or something.