I know that Level 3 doesn't exist theoretically, but I'm hoping that the die has been cast for a few fundamentals. Will a third-party introduction confer permission to use a capability host's bootstrap methods? If not, has any consideration been given for an additional bootstrap interface exposed on third-party introduced connections?
--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
Visit this group at http://groups.google.com/group/capnproto.
The bootstrap interface will be exposed on all connections made through the associated VatNetwork. There's no fundamental difference between a connection made as a result of a three-party interaction vs. one made directly; in fact, during a three-party introduction, if the introductees already have a preexisting connection open, they'll just use that.
With that said, on a VatNetwork that has more than two parties, since the bootstrap interface is effectively public to everyone on the network, it's important that the bootstrap interface itself not grant any meaningful authority. It should only be used as a way to exchange other forms of capabilities for Cap'n Proto capabilities. For example, it might have a restore() method that takes a SturdyRef (or some other sort of unguessable token) and returns the live ref.
The bootstrap interface will be exposed on all connections made through the associated VatNetwork. There's no fundamental difference between a connection made as a result of a three-party interaction vs. one made directly; in fact, during a three-party introduction, if the introductees already have a preexisting connection open, they'll just use that.10-4. I was (wrongly) operating under the assumption that authorization should be rolled into connection negotiation before exchanging Capnproto messages (and maybe that's okay for levels 2 and prior).Â
With that said, on a VatNetwork that has more than two parties, since the bootstrap interface is effectively public to everyone on the network, it's important that the bootstrap interface itself not grant any meaningful authority. It should only be used as a way to exchange other forms of capabilities for Cap'n Proto capabilities. For example, it might have a restore() method that takes a SturdyRef (or some other sort of unguessable token) and returns the live ref.The intended use for my misguided "additional bootstrap interface" is to authenticate a public key holder's private key ownership (on a transport that handles encryption for free). Instead it sounds like I should be looking at a bootstrap method like```  decrypt @n (encrypted :Data) -> (decrypted :Data);```Then I can verify that the public key holder decrypts some nonce.
FWIW, I'm currently working on implementing the VatNetwork I describe above in terms of ed25519 / curve25519.
FWIW, this might not be optimal from a simplicity or performance
perspective. You're using the key pair for identification, not
non-repudiation, and you can get this using just DH as a primitive.
See, for example, triple-DH. The idea is that each party publishes a
Curve25519 public key and the corresponding private key is used for
identification by demonstrating the ability to do DH with the
corresponding private key.
The performance improvement is non-negligible, IIRC. This replaces a
signature operation with a variable-base scalar multiplication. It
also avoids needing a copy of the ed25519 code, which isn't *that*
similar to curve25519.
With that said, on a VatNetwork that has more than two parties, since the bootstrap interface is effectively public to everyone on the network, it's important that the bootstrap interface itself not grant any meaningful authority. It should only be used as a way to exchange other forms of capabilities for Cap'n Proto capabilities. For example, it might have a restore() method that takes a SturdyRef (or some other sort of unguessable token) and returns the live ref.
Hmm, well, I haven't actually implemented any three-party RPC stuff yet. :)
Do you have RPC working in Javascript at this point?
I would think that in the use case you describe, you'd usually have the two browsers talking to some specific object on the server before they want to connect to each other (otherwise, how did they find out about each other in the first place?). So instead of using the bootstrap interface, you'd do the negotiation through that shared object.
For instance, say you have a video chat room app that uses RTC. Each user would first connect to some chat room at the server, which would be represented as a Cap'n Proto object. Then they'd exchange RTC initiation info through that object.
--
Hmm, I'm not sure if I understand what you mean by "fourth party". Let me state my best guess and you can tell me if I'm wrong.Alice, Bob, and Carol (the first three parties) are all browsers. Alice has RTC connections to Bob and Carol, and wishes to introduce Bob to Carol.Dave, the fourth party, is a server somewhere. You believe you need this server to help negotiate connections. Dave exports a bootstrap interface that can be used for this.What I don't see here is why Dave is needed. Why can't Alice facilitate the introduction directly?
BTW, I would *love* to have a Cap'n Proto transport that automagically uses WebSocket for browser<->server, WebRTC for browser<->browser, and IP for server<->server. :)
--
It seems that what we'd really like here is if one RTC offer and answer could be reused for multiple connections. Then, Bob and Carol would both give an offer and an answer to Alice when they first connect, and Alice would be able to pass an "answer" in ThirdPartyCapId and an "offer" in RecipientId, allowing Bob and Carol to form a connection without any additional round trip back to Alice.
Assuming WebRTC isn't awesome enough to support that, I would argue that what you are doing here should be built into your transport layer spec. That is, over an RTC connection, you'd send messages like:  message RtcMessage {   union {    rpcMessage @0 :Rpc.Message; # standard RPC message    sendOffer @1 :SendOffer;    sendAnswer @2 :SendAnswer;    # Messages for RTC handshake, sent in response to an introduction.   }  }These special messages would be handled entirely in the transport (aka VatNetwork) implementation so that the application layer never sees them. The application can still define its own bootstrap interface as desired.
> The lack of a WebSocket server API in the browser makes the> browser-provides-to-WebSocket-server case a little goofy, but I think I got it figured.I think the way around this is that whenever a browser is introduced to a server, the browser initiates the connection, regardless of who is the provider and who is the receiver. When a server is told to receive a capability from a browser, the server waits, expecting an incoming connection.
I think that in this transport:- browser<->browser = WebRTC, always initiated via a 3-party introduction.- browser<->server = WebSocket, always browser-initiated, either as a result of an introduction or for bootstrap.- server<->server = Whatever standard Cap'n Proto IP-based transport protocol we come up with.
On the server<->server case, I'll probably be back hat-in-hand for help integrating that transport through libuv.