Skip to content

Instantly share code, notes, and snippets.

@zxygentoo
Last active July 7, 2022 09:51
Show Gist options
  • Save zxygentoo/70663b9bdee9506425f7e95fcf74e47f to your computer and use it in GitHub Desktop.
Save zxygentoo/70663b9bdee9506425f7e95fcf74e47f to your computer and use it in GitHub Desktop.
Url Parameters Semantic Definition Draftt

pixel eg.

https://app.thespace.game/@123,456

playback eg.

https://app.thespace.game/#playback/2X/16Z/123,456/12345/30000/QmdTzRdbGeEnWW2yS8kHiwF5YFUfbU4FXqDEhTAtVVtdUq

Definition

params :=
    | "@" + pixel
    | "#" + playback

pixel :=
    vector + "," + vector

vector :=
    nat (within 1 to 1000)

playback :=
    "playback" + "/" + 
    speed + "/" + 
    zoom + "/" + 
    pixel + "/" +
    block-number + "/" + 
    rewind-color-events + "/" + 
    cid

speed :=
    | "1X"
    | "2X"
    | "4X"

zoom :=
    zoom-level + "Z"

zoom-level :=
    nat (within MinZoomLevel to MaxZoomLevel)

block-number :=
    nat (>= 1)

rewind-color-events :=
    nat (within 1 to MaxRewindEvents)

cid :=
    IPFS-CID-VERSION-0 (base58 string)

nat :=
    [0-9]+

MinZoomLevel : nat = 2
MaxZoomLevel : nat = 38
MaxRewindEvents : nat = 30000
  • last param may ignore trailing "/"
  • pixel define jump to pixel,
  • playback define playback params
  • minimum share playback window will have to be limited to not smaller than roughly 4000 color events(snapper window)
  • pixel in playback define playback center pixel
  • nat with range will clamp to range bounds if above or below(parsing time validation, do not trigger faliure)
  • implementation may choose to force speed to 1X if the nat before X is not 1/2/4
  • if block-number is not within the Delta cid pointing and not one snapper window afterwards, the whole playback considered invalid(runtime check, depends on Delta data from S3/IPFS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment