Solana session intent specification#201
Conversation
|
Closed #200 to move things here. I went through the draft and had a few questions. The lean voucher makes sense to me if Are you aiming for one canonical channel program, or would any program that implements this instruction set and state model be compatible? I noticed metering is entirely server-side in this draft, with the voucher only authorizing cumulative payment. Was that intentional? I had also written up sections on replay protection, crash safety for distributed servers, and Ed25519 instruction introspection that may be worth pulling into this draft if useful. |
|
Thanks @alexanderattar, appreciate your help! Any compatible program with the spec should be usable, this is why we're proposing |
Co-authored-by: jo <17280917+dev-jodee@users.noreply.github.com>
Spec Preview
|
| |--------|--------|-------|----------| | ||
| | 0 | 32 | `channelId` | Raw Solana address bytes | | ||
| | 32 | 8 | `cumulativeAmount` | u64 little-endian | | ||
| | 40 | 8 | `expiresAt` | i64 little-endian; `0` = no expiration | |
There was a problem hiding this comment.
Voucher expiration signing is ambiguous. The HTTP shape exposes expiresAt as an ISO 8601/RFC 3339 string, but the signed Borsh payload uses an i64.
There was a problem hiding this comment.
Addressed with latest
| |-------|------|----------|-------------| | ||
| | `channelId` | string | REQUIRED | Channel this voucher authorizes | | ||
| | `cumulativeAmount` | string | REQUIRED | Total authorized spend (base units) | | ||
| | `expiresAt` | string | OPTIONAL | Voucher expiration (ISO 8601) | |
There was a problem hiding this comment.
why do you need expiration on both the vouchers and the sessions?
I think this will get pretty complicated to manage, and also introduces a number of edge cases which you need to guard against, like griefing from setting very low expiresAt values
There was a problem hiding this comment.
Addressed with latest
|
@lgalabru -- thank for updating this! Now that there are many proposals for sessions (evm, tempo, and solana) but we have not defined the "generic" intent, we run some risk of divergences on common fields or control flows. Do you mind if we push fwd a generic spec and then rebase this spec on top of this? Alternative is moving forward with this spec, and then rebasing changes I expect that we can get a draft for the generic session intent up next week and move pretty quickly to get it approved. Would this work for you? This shouldn't block actual implementation of the method / sdks as long as you can rebase changes in. |
|
@brendanjryan sounds like a great plan! |
Specification draft for MPP
sessionintent, driving an implementation that will the audited and maintained by Solana Foundation (not ready for review)