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

IBC as layered-interchangeable-protocol-stack #45

Closed
cwgoes opened this issue Mar 18, 2019 · 8 comments
Closed

IBC as layered-interchangeable-protocol-stack #45

cwgoes opened this issue Mar 18, 2019 · 8 comments
Labels
brainstorming Open-ended brainstorming.

Comments

@cwgoes
Copy link
Contributor

cwgoes commented Mar 18, 2019

I think it will help to conceptualize IBC as a layered protocol stack (similar to the IP in this sense).

Layers:

  1. Consensus Primitives (ICS ?: IBC threat model & security assumptions #2)
  2. Connection (ICS 3: IBC connection lifecycle, protocol negotation handshake #3)
  3. Channel (ICS 4: Channel & Packet Semantics #34)
  4. Packet (ICS 5: Packet semantics #36)
  5. Application (various)

The key insight is that lower layers (lower numbers) have no "knowledge" of higher layers - none of their security properties are dependent on those of higher layers, they rather provide primitives and security properties using which higher layers derive their primitives and security properties.

Furthermore, higher-layer protocols should:

  • Only depend on the protocol one layer below them
    For example, channel semantics should not depend on the kind of lite client proof used.
  • Explicitly enumerate the primitive set they require from that protocol
    Then it will be easy to instantiate variants of different layers while retaining security guarantees.

This may seem banal but I think it will end up being important that we keep the hierarchy strict.

@cwgoes cwgoes added the brainstorming Open-ended brainstorming. label Mar 18, 2019
@cwgoes cwgoes changed the title IBC as layered-protocol-stack IBC as layered-interchangeable-protocol-stack Mar 18, 2019
@mossid
Copy link

mossid commented Mar 20, 2019

This requires the block in consensus primitives need to specify the state structure. I think using KVStore is okay, I cannot imagine any use case of the block not using KVStore for its state.

Also, are we considering to send negotiation messages as a form of Datagram? This will also make Connection / Channel required to know about the Packet layer.

@cwgoes
Copy link
Contributor Author

cwgoes commented Mar 20, 2019

Datagram (the name could be changed) is the top-level opaque data blob that the top-level IBC handler will need to parse and interpret - so IBC packets, connection negotiation messages, header update messages, version upgrade messages, fraud proofs, etc. are all datagrams. Does that concept make sense?

@jackzampolin
Copy link
Member

Big fan of this. This makes a ton of sense @cwgoes

@cwgoes cwgoes pinned this issue Mar 21, 2019
@ethanfrey
Copy link
Contributor

Great idea to keep these clearly defined levels that only depend on one clear interface.

Then it is easy to add orthogonal power...
Support 2 consensus engines, different channel semantics (in-order, timeout, receipts), and multiple application logic.
Each is a new dimension to multiply with the others

👍

@ebuchman
Copy link
Member

Can we foresee places where the abstractions might leak ?

@ethanfrey
Copy link
Contributor

@ebuchman
I left a comment where app state definition was in consensus layer.

It is not necessarily a leaking abstraction, I think it can cleanly be moved to another level, but shows the leakiness of our thinking on ibc and how tough it is to mentally separate these layers.

@cwgoes
Copy link
Contributor Author

cwgoes commented Mar 26, 2019

Can we foresee places where the abstractions might leak ?

I could foresee future optimizations that would traverse layers (as also exist in TCP/IP I think), but at the moment I can't think of any protocol-level "layer leakage" other than would result accidentally from imprecise design - although the layers I listed may not be the final set or ordering.

@cwgoes
Copy link
Contributor Author

cwgoes commented Jul 29, 2019

This has been reflected in the protocol design.

@cwgoes cwgoes closed this as completed Jul 29, 2019
@cwgoes cwgoes unpinned this issue Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming Open-ended brainstorming.
Projects
None yet
Development

No branches or pull requests

5 participants