-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Recursion #1082
Comments
If we decide to allow https://github.com/casey/ord/issues/786 then being able to reference other inscriptions on the same sat that occur in the future could allow for some limited mutability. I'm imagining a prime inscription referencing the sat's subsequent inscriptions to use as an input to its rendering logic. A simple example could be a "counter" inscription that rendered a number that was incremented each time a new inscription was created on the sat. Or a "guest book" inscription that would allow future owners of the sat to add an entry to a log. This would fit nicely with the Syntactically it would be enough to have a pointer to the next inscription on a sat:
|
BIP-322 fixes this methinks A creator commits to a message. The message defines a protocol for combining a number of assets. The web client combines the requisite resources strictly by inscription ID. |
For HTML content, the only thing you need to do is change the way 'preview' pages are displayed? When you show an HTML inscription in the iframe on your inscription page, you have a csp header: But when in preview mode, it displays the HTML directly from your site (not in an iframe), and you add the csp header: To be consistent, maybe just load the preview in an iframe too (using the full page) and make the headers and sandbox the same as the iframe above. Then there is nothing more to do for this issue, at least for html content. |
Is this possible yet? |
I take it this needs to be a standard of some sort that extends how Ordinal explorers interpret URLs? Can someone please point me to, or give me an example of, how such a reference would look inside a piece of HTML? |
Totally agree with @sjalq on the significance of this issue for generative art. No need to change ordinals, just adopt a convention to avoid excessive code duplication on the blockchain. Current method: copying all code into <script> tags for each iteration - not ideal but better than images. Two possibilities:
My preference is the ord:// scheme, as it provides a straightforward interpretation initially (likely just a relative URL) while leaving room for future development. |
@cognitive-canvas I've been playing around with this and I think the easiest, lowest hanging fruit on this is if we can just access inscriptions via the inscription id (as I tried to do in this HTML inscription: https://ordinals.com/content/adcc57e8f9099025804863e2cca2bb1bc305f9289832f5a233bc6202d449057ci0) @casey is we can change the explorer's CSP to something like:
This would allow is to use plain inscription id's as resources and would allow us to compose both code and images. What can I do to help facilitate this? ========= From the looks of the code, we only need to modify this: |
@sjalq, indeed, using script-src and img-src with 'self' seems to be the best approach (perhaps with minor adjustments, as mentioned below). This will function in all scenarios, whether or not an iframe is present, and will only allow content from the same domain. The team's primary concern appears to be ensuring that this doesn't introduce new vulnerabilities, since 'self' can theoretically refer to other pages within the domain, not just the ordinals. By using something like script-src: 'https://ordinals.com/content', you can effectively close that security gap. |
For the sake of showing effort, below is what I propose as the exact configuration.
If similar constraints are desired for images and styles, I would recommend:
|
I think @sjalq is making some reasonable suggestions on this. It would open the door for some exciting generative collections that utilise recursion. Not sure if this has been discussed on Discord or other avenues since April. |
@sjalq Does this work? I was unable to get a CSP header with a bare path to work, e.g If bare path directives don't work, I believe it'll be necessary to use two CSP headers, which would be, omitting
Note the The first header allows any requests to the current origin, and the second header allows requests to any origin, but only at paths beginning with There are a few things that inscriptions may want to have access to, for example the current block height, the content of other inscriptions, the current location of the inscription, the current block time, etc. To avoid having to add these to the CSP header individually, I suggest we put them under a common path prefix, and allow access to anything under that prefix. I like the
Inscriptions could then access |
@casey , sorry bud I was distracted. I see you just took things live already! Thanks for including this! |
SVG and HTML inscriptions should be able to access other inscriptions and use their content. They should be sandboxed such that they can't reach any external URLs.
Serve at a separate origin, and enforce same origin policy.
Relative inscription numbers can be used to reference inscriptions made within a single transactions, where the inscription ID isn't known in advance.
Note slashes in URLs, so that relative URLs are appended correctly.
The text was updated successfully, but these errors were encountered: