--- name: ordfs description: This skill should be used when the user asks "what is ORDFS", "how to use ordfs.network", "ordfs API", "access on-chain content", "inscription gateway", "ordfs query parameters", "ordfs sequence", "ordfs directory", "ordfs preview", "recursive inscriptions", "ord-fs/json", or needs to reference, access, or serve on-chain content through ORDFS. --- # ORDFS - Ordinals File System HTTP gateway for accessing on-chain content (inscriptions) from BSV blockchain. **Live Gateway**: https://ordfs.network **Repository**: https://github.com/b-open-io/go-ordfs-server ## Quick Reference | Endpoint | Purpose | |----------|---------| | `/{txid}_{vout}` | Direct content access | | `/content/{pointer}` | Content with options | | `/content/{pointer}:{seq}` | Specific version | | `/content/{pointer}/{file}` | File from directory | | `/preview/{b64Html}` | Preview HTML code | | `/v2/metadata/{outpoint}` | Metadata only | ## Content Access Patterns ### Basic Content URL ``` https://ordfs.network/{txid}_{vout} ``` **Example**: ``` https://ordfs.network/abc123...def_0 ``` ### Outpoint Formats All formats resolve to the same content: | Format | Example | |--------|---------| | Underscore | `abc123..._0` | | Period | `abc123....0` | | Txid only | `abc123...` (defaults to vout 0) | ### Content Endpoint with Options ``` /content/{pointer}[:{sequence}][/{filepath}] ``` **Query Parameters**: | Param | Default | Description | |-------|---------|-------------| | `content` | true | Include content data | | `map` | false | Include MAP metadata | | `out` | false | Include raw output (base64) | | `parent` | false | Include parent reference | | `raw` | - | Return directory JSON instead of index.html | **Examples**: ``` /content/abc123..._0?map=true # With MAP metadata /content/abc123..._0?content=false # Metadata only /content/abc123..._0?raw # Directory listing ``` ## Sequence Versioning Track inscription updates using sequence numbers. ### Special "-1" (Latest) ``` /content/{pointer} # Same as :-1, gets latest version /content/{pointer}:-1 # Explicit latest ``` **Behavior**: Short TTL caching (60s), returns most recent version. ### Specific Sequence ``` /content/{pointer}:0 # Original inscription /content/{pointer}:5 # 5th update ``` **Behavior**: Long TTL caching (30 days), immutable content. ### Response Headers | Header | Description | |--------|-------------| | `X-Outpoint` | Current outpoint | | `X-Origin` | Original inscription outpoint | | `X-Ord-Seq` | Sequence number | | `X-Map` | JSON MAP metadata | | `X-Parent` | Parent inscription outpoint | ## Directories (ord-fs/json) Inscriptions with content type `ord-fs/json` represent directories. ### Directory Format ```json { "index.html": "ord://abc123..._0", "style.css": "abc123..._1", "app.js": "def456..._0" } ``` Values can be: - `ord://txid_vout` - Full ordinal reference - `txid_vout` or `txid` - Direct reference ### Accessing Directory Files ``` /content/{directory_pointer}/index.html /content/{directory_pointer}/style.css /content/{directory_pointer}/app.js ``` ### SPA Routing For SPAs, unknown paths fall back to `index.html`: ``` /content/{pointer}/unknown/path → Returns index.html ``` ### Raw Directory JSON Add `?raw` to get the directory listing instead of index.html: ``` /content/{pointer}?raw ``` ## Preview Endpoint Test HTML inscriptions before broadcasting. ### Base64 HTML Preview ``` /preview/{base64EncodedHtml} ``` **Example**: ```javascript const html = "
Hello!"; const b64 = btoa(html); const previewUrl = `https://ordfs.network/preview/${b64}`; ``` ### POST Preview ```bash curl -X POST https://ordfs.network/preview \ -H "Content-Type: text/html" \ -d "Hello!" ``` ## Recursive Inscriptions Reference other inscriptions from HTML/JS content. ### Pattern ```html