You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note, that in the current implementation, this function retrieves the entries one at a time and may take a longer time when querying large lists, so be aware of that, when you retrieve lists with many entries.
728
+
Note, that in the current implementation, this function retrieves the entries one at a time and may take a longer time when querying large lists, so be aware of that, when you retrieve lists with many entries. Keep in mind if only the listName is passed it will not retrieve the entire list instead only the first 10 elements in the list.
For getting a better understanding about how Sharings and Multikeys work, have a look at `Security <https://evannetwork.github.io/docs/developers/concepts/sharings.html>`_ in the evan.network wiki.
19
22
20
23
Following is a sample for a sharing info with these properties:
@@ -36,12 +39,17 @@ Following is a sample for a sharing info with these properties:
36
39
* ``secret area`` - available for all members
37
40
* ``super secret area`` - available for ``0x03``
38
41
42
+
Keep in mind, that an actual sharings object only stores the sha3-hashes of every property. For example, sharings for the user `0x01` were actually to be found
43
+
at the property `"0x5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2"`.
44
+
For the sake of understanding, the following sample uses clear text properties. For an example of an actual sharings object, please refer to the :ref:`getSharings <sharing_getSharings>`
45
+
example section.
46
+
39
47
.. code-block:: typescript
40
48
41
49
{
42
50
"0x01": {
43
-
"82745": {
44
-
"*": {
51
+
"*": {
52
+
"82745": {
45
53
"private": "secret for 0x01, starting from block 82745 for all data",
46
54
"cryptoInfo": {
47
55
"originator": "0x01,0x01",
@@ -50,16 +58,18 @@ Following is a sample for a sharing info with these properties:
50
58
}
51
59
}
52
60
},
53
-
"90000": {
54
-
"secret area": {
61
+
"secret area": {
62
+
"90000": {
55
63
"private": "secret for 0x01, starting from block 90000 for 'secret area'",
56
64
"cryptoInfo": {
57
65
"originator": "0x01,0x01",
58
66
"keyLength": 256,
59
67
"algorithm": "aes-256-cbc"
60
68
}
61
-
},
62
-
"super secret area": {
69
+
}
70
+
},
71
+
"super secret area": {
72
+
"90000": {
63
73
"private": "secret for 0x01, starting from block 90000 for 'super secret area'",
64
74
"cryptoInfo": {
65
75
"originator": "0x01,0x01",
@@ -70,8 +80,8 @@ Following is a sample for a sharing info with these properties:
70
80
}
71
81
},
72
82
"0x02": {
73
-
"82745": {
74
-
"*": {
83
+
"*": {
84
+
"82745": {
75
85
"private": "secret for 0x02, starting from block 82745 for all data",
76
86
"cryptoInfo": {
77
87
"originator": "0x01,0x02",
@@ -80,28 +90,30 @@ Following is a sample for a sharing info with these properties:
80
90
}
81
91
}
82
92
},
83
-
"90000": {
84
-
"secret area": {
93
+
"secret area": {
94
+
"90000": {
85
95
"private": "secret for 0x02, starting from block 90000 for 'secret area'",
86
96
"cryptoInfo": {
87
97
"originator": "0x01,0x02",
88
98
"keyLength": 256,
89
99
"algorithm": "aes-256-cbc"
90
100
}
91
-
},
92
-
"super secret area": {
101
+
}
102
+
},
103
+
"super secret area": {
104
+
"90000": {
93
105
"private": "secret for 0x02, starting from block 90000 for 'super secret area'",
94
106
"cryptoInfo": {
95
107
"originator": "0x01,0x02",
96
108
"keyLength": 256,
97
109
"algorithm": "aes-256-cbc"
98
110
}
99
111
}
100
-
},
112
+
}
101
113
},
102
114
"0x03": {
103
-
"90000": {
104
-
"secret area": {
115
+
"secret area": {
116
+
"90000": {
105
117
"private": "secret for 0x03, starting from block 90000 for 'secret area'",
106
118
"cryptoInfo": {
107
119
"originator": "0x01,0x03",
@@ -121,7 +133,7 @@ There are two functions to share keys with another user:
121
133
122
134
- :ref:`extendSharing <sharing_extendSharing>` is used to edit a sharings configuration that has been pulled or "checked out" with :ref:`getSharingsFromContract <sharing_getSharingsFromContract>`. Hash keys have to be shared manually, if required. :ref:`extendSharing <sharing_extendSharing>` make no transaction, so the contract isn't updated - this has to be done with :ref:`saveSharingsToContract <sharing_saveSharingsToContract>`. See function documentation :ref:`below <sharing_extendSharing>` for an example with hash key and storing updates.
123
135
124
-
Be careful when performing multiple updates to sharings synchronously. As sharings are retrieved as a single file from a smart contract, updated and then saved back to it, doing two or more updates in parallel may overwrite each other and lead to unexpected and most probably undesired results.
136
+
Be careful when performing multiple updates to sharings synchronously. As sharings are retrieved as a single file from a smart contract, updated and then saved back to it, doing two or more updates in parallel may overwrite each other and lead to unexpected and most probably undesired results.
125
137
126
138
Perform sharing updates for the same contracts **one after another**, this goes for :ref:`addSharing <sharing_addSharing>` **and** for :ref:`extendSharing <sharing_extendSharing>`. When wishing to speed things up, :ref:`extendSharing <sharing_extendSharing>` can be used, but its updates need to be performed synchronously as well. Keep in mind, that single updates will be made off-chain and therefore be performed much faster than multiple updates with :ref:`addSharing <sharing_addSharing>`.
0 commit comments