Skip to content
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

Custom active permission #86

Merged
merged 89 commits into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
15fbf7f
Custom active permissions
Jul 25, 2018
7a13f4d
Update bsip-0040.md
Jul 25, 2018
aed7556
Update bsip-0040.md
Jul 25, 2018
e928c44
Update bsip-0040.md
xeroc Jul 25, 2018
e8fabfd
Update bsip-0040.md
Jul 25, 2018
5ebcbb6
Update bsip-0040.md
Jul 25, 2018
a825307
Update bsip-0040.md
Jul 25, 2018
239b7a2
Update bsip-0040.md
Jul 25, 2018
28f96ba
Update README.md
Jul 25, 2018
10fa5ad
Comments from pmconrad
Jul 27, 2018
815a50c
add more detailed asserts description and milestones
Jul 27, 2018
8591695
include more assert descrption and lisght rewriting
Jul 27, 2018
824549e
Update bsip-0040.md
Jul 27, 2018
71e57c5
Update bsip-0040.md
Jul 27, 2018
54d0ee6
Update bsip-0040.md
Jul 27, 2018
1083311
Update bsip-0040.md
Jul 27, 2018
189ceec
Update bsip-0040.md
Jul 27, 2018
cb79a4f
Update bsip-0040.md
Jul 27, 2018
e6cc5f1
Update bsip-0040.md
Jul 27, 2018
75faa36
Update bsip-0040.md
Jul 28, 2018
5b5e550
Update bsip-0040.md
Jul 28, 2018
7ae9f94
Update bsip-0040.md
Jul 28, 2018
55aa5b0
Update bsip-0040.md
Jul 28, 2018
ef397f0
Update bsip-0040.md
Jul 28, 2018
bcfa32f
Update bsip-0040.md
Jul 28, 2018
5da66a4
Update bsip-0040.md
Jul 28, 2018
6c64b50
Update bsip-0040.md
Jul 28, 2018
8207e24
Update bsip-0040.md
Jul 28, 2018
e2d9022
Update bsip-0040.md
Jul 28, 2018
fccca20
Update bsip-0040.md
Jul 28, 2018
2bcc40a
Update bsip-0040.md
Jul 28, 2018
4349e8d
Update bsip-0040.md
Jul 28, 2018
2051ff3
Update bsip-0040.md
Jul 28, 2018
6df4a38
remove length, add price as explicit allowed conversion
Jul 29, 2018
ba625b1
remove contains only, and add attibute_assert
Jul 29, 2018
1d4aa42
Update bsip-0040.md
Jul 29, 2018
523ed86
Update bsip-0040.md
Jul 29, 2018
07b6fa0
Update bsip-0040.md
Jul 29, 2018
ab5500d
attribute assert nesting
Jul 29, 2018
0e8e9ad
add economics
Jul 29, 2018
e145ede
add wording and defition of match for authority
Jul 30, 2018
d5e6f75
change dict to tuple
Jul 30, 2018
15a0514
more details on attribute_assert and where permission is stored
Jul 30, 2018
d77a526
consistent use of "list of"
Jul 30, 2018
6c7a90a
Update bsip-0040.md
Jul 30, 2018
41a2403
Update bsip-0040.md
Jul 30, 2018
cf72eaa
add logical assert
Jul 30, 2018
f0d16bb
Update bsip-0040.md
Jul 30, 2018
63f6ddc
Include either or example
Jul 30, 2018
b7282a5
fix formatting of new example
Jul 30, 2018
9b07069
include milestone differentation
Jul 30, 2018
12355d6
clarify milestone procedure
Jul 30, 2018
2222cea
moved examples out of specifications
Jul 30, 2018
b1864f8
moving around
Jul 30, 2018
03f24f0
more cleaning up
Jul 30, 2018
8dce372
change typos
Aug 2, 2018
34d0086
clarify month call
Aug 2, 2018
651e00c
Update bsip-0040.md
Aug 2, 2018
8893727
Update bsip-0040.md
Aug 2, 2018
5d92967
add enabled flag
Aug 2, 2018
b8f2691
include new comments
Aug 3, 2018
871b93d
more detail for Example: Simple transfer
Aug 3, 2018
d036c8c
calrify child operations of proposals
Aug 3, 2018
ecf22d4
add reviewers
Aug 3, 2018
7d1468e
updated Outline of handling incoming transactions
Aug 3, 2018
d9466f2
Update bsip-0040.md
Aug 3, 2018
5ddc6cd
Update bsip-0040.md
Aug 5, 2018
40b7ae4
proposals can be created by anyone
Aug 7, 2018
552b5c4
include multi-sig example
Aug 7, 2018
6a00164
Update bsip-0040.md
Aug 8, 2018
5dcf316
Update bsip-0040.md
Aug 9, 2018
3ac2159
update economics
Aug 9, 2018
f1f9755
add length and eq to number comparison
Aug 9, 2018
0919eae
Update bsip-0040.md
Aug 9, 2018
78100ed
add `contains, not_contains`
Aug 9, 2018
a1ce8ab
Update bsip-0040.md
Aug 9, 2018
e9c8e9b
add neq
Aug 10, 2018
f9c2df5
Clarify duration
Aug 10, 2018
bd2af37
If beneficial for performance or complexity sections
Aug 10, 2018
0c43bfd
Update bsip-0040.md
Aug 10, 2018
0f2a433
Update bsip-0040.md
Aug 10, 2018
982348c
add `remaining_executions`
Aug 10, 2018
64338a4
Update bsip-0040.md
Aug 10, 2018
02bb9e5
Milestone 4 in separate section
Aug 10, 2018
1d0a341
Update bsip-0040.md
Aug 10, 2018
e749319
Update bsip-0040.md
Aug 10, 2018
51d46da
Update bsip-0040.md
Aug 12, 2018
b560291
Update bsip-0040.md
Aug 13, 2018
b0dfaa5
Update bsip-0040.md
Aug 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ Number | Title |
[37](bsip-0037.md) | Allow new asset name to end with a number | oxarbitrage | Protocol | Installed
[38](bsip-0038.md) | Add target collateral ratio option to short positions | Abit More | Protocol | Installed
[39](bsip-0039.md) | Automatically approve proposals by the proposer | Fabian Schuh | Protocol | Draft
[40](bsip-0040.md) | Custom active permission | Stefan Schießl | Protocol | Draft
87 changes: 87 additions & 0 deletions bsip-0040.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
BSIP: 0040
Title: Custom active permissions
Authors:
Alex Megalokonomos <https://github.com/clockworkgr>
Fabian Schuh <https://github.com/xeroc>
Stefan Schießl <https://github.com/sschiessl-bcp>
Status: Draft
Type: Protocol
Created: 2018-07-25
Discussion: https://github.com/bitshares/bitshares-core/issues/1061
Worker: <Id of worker proposal>

# Abstract

Strengthening user security is one of the main factors to elevate BitShares. Inlight of recent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In light" - two words

hacking and phishing attempts this becomes even more important. The need for a more sophisticated
account security preceeded the idea for a finer-grained control of account permissions.
We propose to add an additional authority to the account, called Custom Active (Permission). The
permission contains a list of operationid-to-authority mappings that each grant access to the respective
operation as if it were the active permission of the account. Additionally, the arguments of said operation
can be restricted.

# Motivation

Any successfull hacking or phishing attempt on any of the web wallets that are powered by the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: successfull

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

BitShares Blockchain is bad publicity. The user needs to be educated in account security, and this BSIP
aims to ensure all technical possibilities are met while being flexible to allow many use-cases.

Examples:
- Witness Key: Only allows update signing key and publish price feed
- Trading Key: Only allows limit orders (arguments restricted to desired markets), update margin position and transfers (arguments restricted to certain accounts)
- Proposal Update Key: Approve proposals (2FA comes to mind)
- Faucet Key: Allow only to create accounts
The above list of named keys is nothing that is known to the backend as the backend should have an abstract implementation.
The UI should provide a button "Create Trading Key" that properly configures the respective custom active permission entry.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI changes are out of scope for a BSIP. Remove this line, or replace "should" with "could" to make it clear that this is not part of the specification.


# Rational
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rationale


The description here is more on a superficial level and no recommendation how it can best be implemented.
Custom active permission is a list of custom active authorities. A `custom active authority` contains an `operation_id`, an `authority` (just like with active permission) and `assert`s than can be used to restricted arguments. When a transaction is signed with such an authority the backend checks if the contained operation has a corresponding custom active authority entry and if so acts as if the active authority of the corresponding account is given. It also checks if the arguments are in the allowed range.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restricted


A Custom Active Permission looks like follows (in JSON for clarification, backend serializes and stores in a different way):
```
custom_active_permission = list of custom_active_authority items
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: the list here means or logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to make that clearer in Rational and Outline of handling incoming transactions

custom_active_authority = {
operationid,
auhtority,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

assert
}
```

Example:
Assume account A and B and some unrelated key K. Furthermore A has a custom active authority in the following way:
```
custom active authority = {
operationid: 0 (transfer),
authority: {
threshold: 1
key_auth: [K, 1]
account_auth: []
},
assert: {
to: B
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this is just an illustration of a possible serialization, not a specification of the serialized format.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added as well

```
That has the consquence now that a a transfer transaction sending funds away from A can be signed with key K as long as the receiver is B.

# Specifications
Requirements to modify the backend includes
* Extend the account object to store custom active permission
* Extend `account_update` or create a new operation to allow changing the custom active permission
* Operation-specific authorities (if present) must be evaluated in incoming transactions
* Additional committee parameters may be needed to limit the extend of usage of this feature

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please elaborate:

  • can an account specify different authorities for the same operation but different asserts (i. e. require key 1 for transfer to Alice and key 2 for transfer to Bob)?
  • list possible assertions for each operation
  • specify assert logic, e. g. multiple fields/values, boolean operations, supported operators...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have included a more detailed description, please see here

https://github.com/sschiessl-bcp/bsips/blob/patch-1/bsip-0040.md

# Discussion

To be found in the [issue](https://github.com/bitshares/bitshares-core/issues/1061).

# Summary for Shareholders

Bad publicity in terms of security can have very negative effect on the BTS value. This BSIP allows that traders can e.g. use a trading key, witnesses can use their witness key and a faucet can use a faucet key. If then for some reason the key or witness/faucet server becomes compromised, such a key can do little harm to the account holders, minimizing the risk.

# Copyright

This document is placed in the public domain.