-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Waiting] mod: Lit protocol token gated casts #92
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Left some notes
``` | ||
|
||
## `/api/cast-embeds-metadata/by-url` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider renaming these endpoints. I suggest /embed-metadata/by-casts
and /embed-metadata/by-urls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, but that means no backwards compat; will have to let integrators know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, but that means no backwards compat; will have to let integrators know
return decryptedString; | ||
} | ||
|
||
// async function retrieveFromIrys(id: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed if was used for debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm yeah this was an alternate way of doing it, that I thought may make sense in some scenarios
// 1. Encryption | ||
// <Blob> encryptedString | ||
// <Uint8Array(32)> dataToEncryptHash` | ||
const { ciphertext, dataToEncryptHash } = await LitJsSdk.encryptString( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming encryption is happening on server to save client bundle size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, also Mini-apps can't load arbitrary JS today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theoretically this backend function here could be run a secure JS env on a client; not sure how much their lib depends on node apis directly
{ | ||
type: "textarea", | ||
ref: "plaintext", | ||
placeholder: "Content to token gate", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this doesn't use the cast text content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question - the cast contents includes mentions (that won't work) and special renderers (like textcuts) that Mini-apps can't directly use. Additionally casts include embeds that we can't easily render if we added them to the encrypted contents, and token gated casts would probably still include or be able to include the cast body; so it'd be a bit confusing to have the cast text appearing/disappearing, or for it to somehow be encrypted when submitted.
In short, I'm not sure our abstractions are particularly close to supporting it in a graceful manner
73aea35
to
3543d13
Compare
This PR:
lit-protocol
andlit-protocol-renderer
mini-appsThere's a blocker right now for releasing this Miniapp:
Lit protocol is upgrading to v3 (mainnet) which is called Habanero, and is scheduled for December. The v3 testnet is not persistent, is unstable, and has breaking changes every couple days, requiring a node package update to fix.
Other todos:
It creates links using the new gateway: https://github.com/mod-protocol/gateway , which would need to be deployed first
Demo (broken due to cayenne downtime)
Depends on #101