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

CIP #5

Merged
merged 17 commits into from
Jul 24, 2024
Merged

CIP #5

merged 17 commits into from
Jul 24, 2024

Conversation

will-break-it
Copy link
Owner

@will-break-it will-break-it commented Jul 12, 2024

@will-break-it
Copy link
Owner Author

cc: @rhyslbw

Copy link
Contributor

@rhyslbw rhyslbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start @will-break-it.

  1. I suggest focusing on the CIP now in this repo, so can drop 02-Synchronisation.puml to remove the duplication. The generated output docs/02-Synchronization-Sequence.svg is also out of date since it has the async projection, whereas it's been hidden in the source file.
Screenshot 2024-07-16 at 05 39 43
  1. One of the traditional operational challenges of serving stateful clients is session management during times of scaling. I think it's worth specifying the server can disconnect clients at any time (since they can just reconnect and resume)

There's some open questions unanswered in the CPS but I think we can worth responses in after doing some more prototyping, so let's just look to lock down a first version here and then we can come back to it.

docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/messages/server/rewards.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/messages/server/rewards.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/src/02-Synchronization-Sequence.puml Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/messages/server/rewards.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Show resolved Hide resolved
docs/CIP/CIP-XXXX/messages/client/subscribe.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved

- [`heartbeat`](./messages/client/heartbeat.md): Connection management/ keep alive
- [`subscribe`](./messages/client/subscribe.md): Define topics of interest & authentication
- [`unsubscribe`](./messages/client/unsubscribe.md): Graceful disconnect from server
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this as an useless message which only effect is to increase the complexity without advantages.

  • I don't see a real use case where a wallet doesn't want to stop following transactions for its addresses.
  • Most likely clients may choose to simply disconnect without caring about this: being no advantages for them in implementing this, there is an high probability many companies will prefer to save money to implement it.
  • The server needs to unsubscribe the client on disconnect anyway:
    • to protect from unexpected close,
    • to not waste resources for lazily wrote clients which simply disconnect.

I'd simply remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iccicci If you have ten accounts in your wallet and want to remove one of them, you might want to be able to unsubscribe.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes @ginnun , in theory yes... but which is the use case?

Since others can still send transactions to addresses bound to that account, what does it means "I want to remove an account"?

To me sounds as "if somebody still send me coins on one of these addresses, I'm no longer interested: it's fine if I do not track them".

When I want to stop using an account, I'll stop sharing addresses bound to it with other to ask for payments, but I'm still interested (much interested) in transactions which give me something.

What am I missing?
Thank you

Copy link
Contributor

@ginnun ginnun Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are still the account owner, but you are no longer interested in monitoring it on a given subscription. One person can have multiple installations of the wallet, e.g., mobile and desktop, simultaneously.

A wallet will probably allow you to remove a wallet address via the UI (Lace does), why should server still send events related to it?

  • After some time, you may want to decrease the number of subscriptions in your mobile wallet while keeping everything active on the desktop. You may want to hide it for some reason.
  • You may want to drop an unused subscription because you want to.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense...
Probably we can just mark it as optional for the clients.

docs/CIP/CIP-XXXX/messages/client/subscribe.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Show resolved Hide resolved
docs/CIP/CIP-XXXX/messages/client/subscribe.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved

The `signature` field is generated by signing with the [extended account private key](https://input-output-hk.github.io/adrestia/static/Ed25519_BIP.pdf) a SHA256 HMAC hashed string. The prehash string is constructed by concatenating the subscribed blockchain(s) + timestamp.

The server verifies the signature and timestamp before serving any data to the client. If any part of the `subscribe` message is invalid, the server sends an error and closes the connection.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention a timestamp window since we will use timestamp for signature verification and try to guess it on the server? Should the timestamp be in a 60ms window, meaning the server tries 60 times before failing?

docs/CIP/CIP-XXXX/messages/client/subscribe.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved

Address encoding varies depending on the blockchain network. In Cardano the protocol servers bech32 encoded addresses.

### Extensions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to define how extensions will be supported under this standard. Best to take inspiration from cardano-foundation/CIPs#462.

@will-break-it will-break-it changed the title CIP Draft CIP Jul 22, 2024
Copy link
Contributor

@rhyslbw rhyslbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a review on @ginnun's PR, but it really applied here instead. I didn't pick this up in my first review.

#9 (comment)

docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
docs/CIP/CIP-XXXX/README.md Outdated Show resolved Hide resolved
@will-break-it will-break-it merged commit eb17bba into main Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants