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

Add Skynet support #2866

Closed
wants to merge 6 commits into from
Closed

Conversation

peterjan
Copy link

@peterjan peterjan commented Apr 5, 2022

This PR adds support for resolving Skylinks, which are used to resolve content on the Skynet network, much like IPFS. The ENS protocol already supports using a sia://[skylink] hash as a content hash and is able to resolve it. Even Metamask's browser extension supports loading web apps hosted on Skynet via ENS, as well as Cloudflare's eth.link.

More information on Skynet can be found here.
More stats on the underlying decentralized storage network can be found here

Closes #2853

@ricmoo
Copy link
Member

ricmoo commented Apr 5, 2022

Please link to more info on the protocol and any stats on usage, adoption, etc. Also including examples of large projects using it is appreciated.

And please do not add dependencies. There is a base64 coder available in ethers already.

@peterjan
Copy link
Author

peterjan commented Apr 5, 2022

Please link to more info on the protocol and any stats on usage, adoption, etc. Also including examples of large projects using it is appreciated.

Added more info.

And please do not add dependencies. There is a base64 coder available in ethers already.

The problem with "@ethersproject/base64" is that it does not support RFC 4648.
I made it URI safe manually to avoid having to update the base64 package but definitely open to suggestions on how to handle this better.

I couldn't find any unit testing but I manually verified it.
This content hash 0x90b2c6052000f25672e1c1400cc49c1473ee41ae013a926b7d4dc05d3d7c496a0701cf4fc8a9
should resolve to sia://IADyVnLhwUAMxJwUc-5BrgE6kmt9TcBdPXxJagcBz0_IqQ, which you can see here

Thank you for taking a look!

@peterjan peterjan marked this pull request as ready for review April 5, 2022 08:49
@dghelm
Copy link

dghelm commented Apr 5, 2022

Please link to more info on the protocol and any stats on usage, adoption, etc. Also including examples of large projects using it is appreciated.

Hello! In addition to PJ's edits mentioning Cloudflare and Metamask, making this PR was requested of us by ETH.LIMO who are a team trying to build a more decentralized resolver infrastructure.

In addition to working with ENS to get contenthash support, within the ETH ecosystem, 1inch also deploys to Skynet.

As for usage and context, the Sia storage network has been active since 2015, and currently stores 2.4 PB. (The network has never incentivized storage for empty or garbage data.) Skynet (launched in 2020) is built by the same team and is an extension of the protocol that pushes it into web-accessible data, with a current focus on decentralized front-ends.

@peterjan
Copy link
Author

@ricmoo, should be ready for another 👀 - thanks in advance!

@ricmoo
Copy link
Member

ricmoo commented Apr 11, 2022

I don’t use Buffer in ethers (adds a lot of overhead in the browser builds), there is the arraying and hexlify functions for this, but don’t worry about that. Your PR is clear and concise enough for me to add this. :)

Do you have some test ENS names with skynet content hashes set?

@dghelm
Copy link

dghelm commented Apr 11, 2022

Do you have some test ENS names with skynet content hashes set?

Here are a few:
skynetlabs.eth
skynet-ens.eth
skysend.eth

@peterjan
Copy link
Author

peterjan commented Apr 12, 2022

Your PR is clear and concise enough for me to add this. :)

Thanks for doing that @ricmoo we're excited to get this in!

@peterjan
Copy link
Author

@ricmoo kind reminder :)

@eth-limo
Copy link

We're looking forward to this addition!

@ricmoo ricmoo added the on-deck This Enhancement or Bug is currently being worked on. label Apr 22, 2022
@ricmoo
Copy link
Member

ricmoo commented Apr 22, 2022

I’ve been focused on v6 for the last week, but will be going through the “on-deck” issues next week. :)

@dghelm
Copy link

dghelm commented May 19, 2022

HI @ricmoo -- please let me know if there's anything we can do from the Skynet side to support finishing up the PR!

ricmoo added a commit that referenced this pull request May 20, 2022
@ricmoo
Copy link
Member

ricmoo commented May 21, 2022

Added in 5.6.7. Please comment on #2853 if there are any problems.

Thanks! :)

@ricmoo ricmoo closed this May 21, 2022
@ricmoo ricmoo added enhancement New feature or improvement. and removed on-deck This Enhancement or Bug is currently being worked on. labels May 21, 2022
Woodpile37 pushed a commit to Woodpile37/ethers.js that referenced this pull request Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to ENS's getContentHash for skylinks
4 participants