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

fix: video NFT are not showing correctly on mobile phone #117

Closed
pedroferreira1 opened this issue Sep 13, 2021 · 1 comment
Closed

fix: video NFT are not showing correctly on mobile phone #117

pedroferreira1 opened this issue Sep 13, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@pedroferreira1
Copy link
Member

pedroferreira1 commented Sep 13, 2021

Acceptance criteria

NFT videos must play correctly on mobile phones and desktop browsers

@pedroferreira1 pedroferreira1 added the bug Something isn't working label Sep 13, 2021
@pedroferreira1 pedroferreira1 self-assigned this Sep 13, 2021
@msbrogli msbrogli assigned r4mmer and unassigned pedroferreira1 Sep 13, 2021
@r4mmer
Copy link
Member

r4mmer commented Sep 15, 2021

Summary

Problems with video NFT preview are believed to be a download bandwidth limitation on IPFS (where the files are hosted).

Motivation

Public IPFS hosting has it's bandwidth limitations, but this delay are perceived by the end user as a bug on the explorer preview.

Guide-level explanation

The ipfs.io server is used by default to serve files, this proved to be slow on video downloads (specially for 5MB and up).

There are a few alternatives to using this service:

  1. Use cloudfare public ipfs
  2. Host our own IPFS node
  3. Host the files on S3

Cloudfare public ipfs

This would be the simplest solution, since we would just change the ipfs domains on each metadata.
As explained here the cloudfare ipfs gateway will work with the https://cloudfare-ipfs.com domain and with a custom domain if DNS is configured properly.

Cloudfare has an advantage over normal ipfs since it caches the content near the delivery to make subsequent requests faster.
The cloudfare ipfs gateway also has a higher limit on download bandwidth, making this a better choice than ipfs.io.

Pros

  • Fast delivery and cache
  • IPFS Security advantages
  • No aditional costs

Cons

  • Continue to rely on external service

Host our own IPFS node

This way we can undo the limit on download bandwidth and have a backup for all NFT files.
But this would incur the aditional charges of hosting the IPFS node and storage for the files.
The security advantages of IPFS are highly desirable as well.
Since the path on the IPFS network is defined by the hash of the contents any changes on the files would change the path, and since the path is on the token creation details any modification of the files or it's contents could be verified and posibly alerted.
This also minimizes the human error part of the process.
Hosting our own node makes it posible to cache files (using cloudfront for instance) to minimize the usage of the node bandwidth.

A serious downside of serving directly out of the node is that the bandwidth consumption may be very elevated.
ipfs/kubo#3429
ipfs/kubo#3065

Pros

  • IPFS Security advantages
  • Manageable limit on bandwidth
  • Backup files on our storage
  • Guaranteed service even if node with original file goes down
  • No external service

Cons

  • Aditional costs for hosting, storage and bandwidth usage.
  • IPFS may need many nodes to guarantee a high throughput of data.

Host the files on S3

The S3 solution for hosting files is cheaper (for hot storage) and faster.
It can be configured with cache to achieve high download speeds (similar to cloudfare-ipfs).
Reliable delivery with speed but at the cost of the security the IPFS provides.

Pros

  • No limit on bandwidth
  • Backup files on our storage
  • Guaranteed service even if node with original file goes down

Cons

  • Lose IPFS Security advantages
  • Aditional costs for storage and bandwidth usage.

Final considerations

A mixed approach could be a better solution.
If we create a domain for ipfs (i.e. ipfs.hathor.network or hathor-ipfs.network) and redirect this to the cloudfare ipfs gateway.
Then we could run our own node for backup and management of NFT files we serve (as well as guarantee their existence on the IPFS network).
This way we would use the cloudfare gateway and our node would serve as backup if needed.
The serving through our domain would make a change to a hosted IPFS node simpler.
If later we decide that the best solution is to host our IPFS node we can just point the domain to our network of nodes and no changes on the metadata will need to be made.

@r4mmer r4mmer closed this as completed Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants