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

feat: swap stream #147

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
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
79 changes: 79 additions & 0 deletions CIPs/cip-147.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
cip: 147
title: Swap Stream
author: Aaron Goldman (@aarongoldman), Mohsin Zaidi (@smrz2001)
discussions-to: <URL to a topic under the CIP category on the Ceramic forum: https://forum.ceramic.network/c/cips>
status: Draft
category: <Core | Networking | Interface | RFC | Meta>
created: 2023-08-21
edited: 2023-08-23
requires: <EIP number(s)>
replaces: <EIP number(s)>
---

<!--PROPOSE A NEW CIP-->

<!--NOTE:
You can leave these HTML comments in your CIP and delete the visible text guides, they will not appear and may be helpful to refer to if you edit your CIP again.-->

<!-- STEPS TO SUBMIT A CIP:
1. Complete the header above.
2. Fill in as much content as is appropriate for the status of your CIP.-->

<!--ADDITIONAL INSTRUCTIONS FOR HEADER SECTION ABOVE-->

<!--[title]: Give your issue a concise, descriptive title prefixed by either its *type* for standards CIPs or its category for other CIPs. (i.e. Core: Protocol Upgrade, Meta: Define CIP Process, etc.).-->

<!--[category]: Here is a description of category terms.
- `Core`: an CIP that affects the core protocol.
- `Networking`: an CIP thst affects the networking layer (i.e. libp2p or syncing).
- `Interface`: an CIP that affects the Ceramic API or provider interface.
- `RFC`: an CIP that proposes an implementation standard (i.e. doctypes, document configurations, or document schemas).
- `Meta`: an CIP that affects the governance process for CIPs.-->

<!--[requires]: A list of CIP(s) that this CIP depends on. *Optional.-->

<!--[replaces]: A list of CIP(s) that this CIP replaces. *Optional.-->

## Simple Summary
A new stream type where the stream state corresponds to the latest event.

## Abstract
A Swap Stream enables you to replace the entire content of a stream. This is different from existing Ceramic streams,
which consist of a sequence of PATCH operations that must all be considered in order to determine the state of the
stream.


## Motivation
When dealing with a Patch Stream, aggregating the stream state requires following events back to the Init Event. A Swap
Stream SWAP operation allows a Ceramic node to ignore previous data in the stream, and a STOMP operation allows the node
to ignore previous headers and data. This removes the need to constantly follow events back to the Init Event.


## Specification
<!--The technical specification should describe the syntax and semantics of any new feature.-->
Specification goes here.


## Rationale
<!--The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->
Rationale goes here.


## Backwards Compatibility
<!--All CIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The CIP must explain how the author proposes to deal with these incompatibilities. CIP submissions without a sufficient backwards compatibility section may be rejected outright.-->
Backwards compatibility goes here.


## Implementation
<!--The implementations must be completed before any CIP is given status "Final", but it need not be completed before the CIP is accepted.-->
Implementation goes here.


## Security Considerations
<!--All CIPs must contain a section that discusses the security implications/considerations relevant to the proposed change. Include information that might be important for security discussions, surfaces risks and can be used throughout the life cycle of the proposal. E.g. include security-relevant design decisions, concerns, important discussions, implementation-specific guidance and pitfalls, an outline of threats and risks and how they are being addressed. CIP submissions missing the "Security Considerations" section will be rejected. An CIP cannot proceed to status "Final" without a Security Considerations discussion deemed sufficient by the reviewers.-->
Security considerations go here.


## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).