Skip to content
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

Pass specific mime-type #2339

Open
theveloped opened this issue Aug 19, 2023 · 3 comments
Open

Pass specific mime-type #2339

theveloped opened this issue Aug 19, 2023 · 3 comments

Comments

@theveloped
Copy link

Hi all, amazing work on ord love the project and what it is bringing to bitcoin. So once more props to all of you.

I'm wondering if there is a way for me to force a specific mime-type to be set in the transaction. As an example I'm working on a proposal that would use a more compact message format then the human readable json. I'd like to push the different messages on chain with a specific mime-type (e.g. application/*) it seems however now that ord allways uses a mime-type that it tries to guess form the file-extension. In this case if I'd like to directly write a, in my case protobuf message (e.g. application/protobuf) there is currently no way to achieve this as there is no file extension that will be guessed to be a protobuf message.

Is there currently a way to achieve this in ord that I'm unaware of?

@casey
Copy link
Collaborator

casey commented Aug 29, 2023

Hi all, amazing work on ord love the project and what it is bringing to bitcoin. So once more props to all of you.

Thank you!

I'm wondering if there is a way for me to force a specific mime-type to be set in the transaction. As an example I'm working on a proposal that would use a more compact message format then the human readable json. I'd like to push the different messages on chain with a specific mime-type (e.g. application/*) it seems however now that ord allways uses a mime-type that it tries to guess form the file-extension. In this case if I'd like to directly write a, in my case protobuf message (e.g. application/protobuf) there is currently no way to achieve this as there is no file extension that will be guessed to be a protobuf message.

It looks like binary protobufs use .binpb, so I opened #2389 which maps .binpb to application/protobuf. Does that work for your use case?

Is there currently a way to achieve this in ord that I'm unaware of?

Currently not, we only support mapping extensions to content types. I think passing mime types is probably a reasonable idea, so I'll leave this open to track it.

@bruffstar
Copy link

+1 ... It would be great not to be limited to inscribing only on the specified mime types. For the explorer, there would be no need to render such inscriptions and could fall back to show something generic or just leave it blank like seen here for this font file that was inscribed: https://ordinals.com/inscription/ef7dde1af2d860f635d6e6bf59374a6dbdf000d70c2b906955bd7eae088df9f2i0

@theveloped
Copy link
Author

Hi @casey I think for my current issue the proposed solution would work a charm (had never heard of the .binpb extension).

However I think this too would quickly run into limits. As an exemple some nice future updates could also match a specific message type resulting in a mime-type like so: application/protobuf; proto=org.some.Message.

I'd indeed propose to fully leave it upto the user to specify the mime-type in full. As @bruffstar specifies I most definitely don't expect all these types to be supported by the viewer.

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

No branches or pull requests

3 participants