-
Notifications
You must be signed in to change notification settings - Fork 4
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
Creating a cryptolink claim from node to node (cross-signing claims) #213
Comments
Adding @emmacasolin here into this as there is some cross over between the notifications work and this work. You 2 should meet up to plan out and work out the kinks of the design of this system. |
Consider this the next priority after you finish up with the Notifications and Gestalts article @emmacasolin and when @joshuakarp finishes up with the R&D article, (while also reviewing my post-merge review of the nodes cli). |
To create a cryptolink from
|
From chat with @emmacasolin , I envisage the above process should work out of the box with the I think the only issue I see is steps 2 and 3. If However, take a step back and think of the use case of establishing a claim between nodes. The 2 nodes are likely to be owned by the same entity/person, so I don't think it's an issue to assume they need to be online at the same time. |
This is why notification sending should be delay-tolerant.
They enter a queue for sending. So if they cannot be sent now, it can be
retried later.
This is basically the same as email.
This queuing can be done later, we can add delay tolerant feature for
after release.
…On 8/13/21 3:37 PM, Josh wrote:
From chat with @emmacasolin <https://github.com/emmacasolin> , I
envisage the above process should work out of the box with the
|notifications| domain.
I think the only issue I see is steps 2 and 3. If |Y| reads the
notification at some later date, but |X| is offline, obviously it
can't send this "I accept" notification back. At the present time, I
don't believe any kind of async messaging for notifications is
possible
https://en.wikipedia.org/wiki/Message_passing#Asynchronous_message_passing
<https://en.wikipedia.org/wiki/Message_passing#Asynchronous_message_passing>.
However, take a step back and think of the use case of establishing a
claim between nodes. The 2 nodes are likely to be owned by the same
entity/person, so I don't think it's an issue to assume they need to
be online at the same time.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#213 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE4OHJV2MKAWG52JXKRYUTT4SVRBANCNFSM5AZCAPUQ>.
|
Clarifying the steps. This is currently fully synchronous, no delay tolerance.
So you have to use a bidirectional grpc stream because Y has to send a message to X, and X has to respond with a message and Y has to respond again. |
For the bidirectional grpc streaming see the grpc utils. And the tests associated. It shows how to use the async generator abstractions for reading and writing on a bidirectional stream. It's better than using stream API. It fits into the promise style. So Y has to do X has to do You'll need to have a timeout applied to both sides. So that the transaction is completed with a certain amount of time. If there's no timeout, it's possible to lock the sigchain forever. Make sure that if any exception occurs that there's a |
I know we have a connection timeout already inside the underlying Basically we need to find out how GRPC connection errors are raised locally. We're not talking about the errors being serialised back to the client which is handled by the grpc utils. We're talking about what happens locally on each agent/node when the actual connection/network breaks. You should be able to trigger a network break, by breaking the connection that |
From the GRPC client's perspective you should be either receiving a connection interruption if there was a |
Imagine on the grpc client.
|
@joshuakarp you also need permission handling here:
This permission is similar to vault sharing permission, in that Once the cross signing completes, the Consider that you now need to have notification message types like: Different notifications can be presented to the end user and can be displayed differently or different required data in their payloads. @tegefaulkes this will be relevant to the GUI. |
@joshuakarp can you update this issue with the MR that you are working on that addresses this. |
MR created for this issue https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/209 |
Due to intermediate resources being created for this interaction between 2 agents to sign each node. We will need deadline to each interaction step. To simplify, you can have a single deadline for the entire interaction from step 2 onwards.
Both X and Y would need a deadline starting from step 2. To implement a deadline, there are 2 ways:
If the deadline fails it's an exception in the interaction. Upon this exception you need to throw the relevant error to the other side of the interaction, and then finish up and clean up any intermediate resources. Remember to UNLOCK your domains! |
Deadlines will be implemented in a later MR. |
MR has been merged https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/209. Closing issue. |
@joshuakarp remember if there are new issues that came of out that implementation, you should list them out there too (and cross link under additional context). |
Further issues stemming from this MR have been created:
|
This will be resolved in !209 https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/209
Specification
!195 has changed the way that node -> node cryptolink claims will need to be created.
Recall that a claim (e.g. a cryptolink) has the following structure:
For a keynode, these claims are stored on the node's sigchain.
Therefore, suppose a node
X
wants to establish a cryptolink to nodeY
. Both nodes require a claim on their respective sigchain that states they have a cryptolink to the other.However, we require that any claim from a node -> node be signed by both nodes. Therefore, node
X
will need to sign both its own claim, andY
's claim on its sigchain (and vice-versa).This allows any arbitrary node to easily verify the claim. Suppose
A
receives the cryptolink claim fromX
, stating that it has a cryptolink toY
.A
would verify the claim withX
's public key, but importantly,A
doesn't need to see the corresponding claim onY
's sigchain - it only needs to verify this claim onX
's sigchain withY
's public key.We need a procedure in place to synchronise the creation of these claims between nodes.
Additional context
Tasks
This will likely make use of the
notifications
domain. The following process (or some other variation of it) will need to be implemented:To create a cryptolink from
X
toY
:X
sends a "cryptolink request" of some sort toY
Y
(at some point in time) accepts this request.X
creates the claim, and transfers the 'unsigned' claim toY
Y
checks the claim to see its correct, signs it, and sends it back toX
X
checks the claim again and signs it itself.X
adds this claim to its sigchainY
's sigchainSee the following code snippet for a working prototype of this process:
This will require refactoring the
createClaim
utility function inclaims/utils
. See this todo note:utils.test.ts
should be extended to ensure multiple signatures can be added and subsequently verified (currently, they only test claims where 1 signature exists).The text was updated successfully, but these errors were encountered: