Skip to content

Add option to display runestones and inscriptions metadata #5569

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

Merged
merged 15 commits into from
Oct 8, 2024

Conversation

natsoni
Copy link
Contributor

@natsoni natsoni commented Oct 5, 2024

This PR adds basic, optional support for displaying runestones and inscriptions details within a mempool instance.


  • show runestone message:
Screen.Recording.2024-10-05.at.22.59.15.mov
  • show inscription metadata:
Screen.Recording.2024-10-05.at.20.46.06.mov
  • for text inscriptions smaller than 150 bytes, the content is rendered (we probably want to add some sanitizing here)
Screen.Recording.2024-10-05.at.23.05.45.mov

No ord-related queries will be made unless the user specifically clicks on the 'Runestone' or 'Inscription' button.


This PR needs a ord server running with index_runes flag enabled.

The mempool backend config should include the following, assuming the ord server runs on port 4321:

"ORD": {
  "ENABLED": true,
  "API": "http://localhost:4321"
}

The frontend config needs the flag "ORD": true.

@natsoni natsoni requested a review from softsimon October 5, 2024 14:27
@cla-bot cla-bot bot added the cla-signed label Oct 5, 2024
@softsimon softsimon requested a review from mononaut October 5, 2024 14:53
@mononaut
Copy link
Collaborator

mononaut commented Oct 5, 2024

tentative concept ACK.

I'll review the actual code in more depth later, but before we get too carried away with the implementation it might be worth discussing our end goals and the tradeoffs of different approaches:


it seems to me there are four main options for getting and serving inscription/rune data:

  1. Call out to an external API
  2. Run Ord
  3. Build our own indexer
  4. Decode transaction data on-the-fly

calling out to an API wouldn't be very cypherpunk of us, and building our own would be a huge waste of effort, unless we're only interested in a very limited subset of data that wouldn't justify running a full Ord node.

so we can probably rule out options 1 and 3.

then the question is whether we expect to need anything that we can't easily get without Ord.


off the top of my head, that probably includes:

  • anything involving ordinal sats (except the creation of "rare" sats)
  • rendering (some) recursive media inscriptions
    • (several of the recursive endpoints reference stuff by ordinal sat numbers or things that depend on sat numbers, which require an index)
  • inscription parent/child provenance
  • inscription numbers (different from inscription ids)
  • inscription transfers/trades
  • non-edict rune transfers/trades
  • current locations of inscriptions and runes
  • anything involving metaprotocol rules
    • e.g. whether a Rune/BRC-20/etc mint or transfer is invalid or unsuccessful

stuff we can do without an index

  • display some inscription creation metadata (content type/size/etc)
  • render simple inscriptions (anything without sat-based recursion)
  • identify & display runestone messages, including:
    • info about rune etchings and mint attempts
    • edict-based rune transfers
    • rune names, symbols & etching inscriptions

stuff we can't do with Ord alone (unless it's changed recently)

  • get inscription/rune data for unconfirmed transactions
  • track non-rune metaprotocol token balances (for BRC-20s etc)

so far the features from this PR seem achievable without Ord (and for unconfirmed transactions, maybe can't be done with Ord alone).

but obviously if we plan to implement any of the features that do strictly require Ord in future, then we may as well start using it now.

@mononaut
Copy link
Collaborator

mononaut commented Oct 5, 2024

sorry for the essay :P

@natsoni natsoni marked this pull request as ready for review October 7, 2024 11:11
@natsoni
Copy link
Contributor Author

natsoni commented Oct 7, 2024

Removed the need for the ord server: parsing of inscriptions and runestones is done client-side

Copy link
Member

@softsimon softsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool to see everything client side with no backend changes required. Subtle and informative.

tested ACK @ [8b6db76]

I'll not merge before @mononaut review and final discussions on if this is the correct approach and shippable with no frontend setting.

softsimon and others added 2 commits October 8, 2024 11:10
Copy link
Member

@softsimon softsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK @ [65f080d]

@softsimon softsimon merged commit 24ec31a into master Oct 8, 2024
13 checks passed
@softsimon softsimon deleted the natsoni/ord branch October 8, 2024 04:21
@hans-crypto
Copy link
Contributor

Regarding

// Adapted from https://github.com/ordpool-space/ordpool-parser/tree/ce04d7a5b6bb1cf37b9fdadd77ba430f5bd6e7d6/src

Please add a proper copyright notice, because you copied "substantial portions of the Software".

MIT License

Copyright (c) 2024 HAUS HOPPE

|...]

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

You are also invited to add the ordpool-parser as a dependency. This way, you won’t have to address issues or bugs that are still present in your current adaptation:

npm install ordpool-parser

This package has zero dependencies and should work without any additional configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy