Bridges get a boost!

filecoin Nov 09, 2021

Faster Bridge-to-Filecoin throughput, plus CID-based deal queries!

Textile's mission to accelerate the open exchange of information across society is first and foremost about keeping humanity's data safe for the future. This means creating systems that promote the exchange of data and information across borders and through time.

Lately, we've been doubling down on Filecoin as this means to safeguard humanity's data. We are committed to getting as many bytes as possible on the Filecoin Network, because we believe this is the most direct path to enabling every individual, organization, and community to own, control, and preserve their data into the future.

To this end, we've been developing Bridges — an open protocol for permissionless off-chain storage from blockchains. You can read about our initial announcement of Bridges here.

What are Bridges?

Bridges make it possible for developers and their users to start storing data off-chain from just about any blockchain without any conversions, signups, developer tokens, or secrets exchanged.

The data is stored on IPFS and Filecoin, so for those who aren't familiar, Filecoin brings an incentive layer to decentralized storage, with all of the benefits of the IPFS stack, such as cryptographically verifiable data, p2p data exchange, deduplication, and more.

So what we have is a means for decentralized app developers to easily and seamlessly store user data, app data, NFT assets, and more, off-chain on a purpose-built storage blockchain (such as Filecoin), and then reference that data whenever and however they like.

We're building a Bridge to just about every blockchain we can get out hands on. We started with NEAR, and now also support Ethereum and Polygon, with more to come.

@textileio bidbot is storing 213TB+ of data on Filecoin and is used in Textile's bridges between Filecoin and @NEARProtocol, @0xPolygon, and @ethereum, among other users. 😎
blog.textile.io/native-filecoin...

Pooja Sha (pooja.eth)

What's new?

Today, we are pleased to announce the next release of Bridges, with higher throughput and a bunch of query super powers.

So far, the focus of the Bridges has been ease-of-use. We're happy with the minimalist API that we've come up with, and are excited with how little code it takes to integrate Bridges into existing decentralized app flows. But now that things are working nicely and teams are starting to integrate Bridges into their apps and services, its time to focus on throughput!

Thanks to some early discussions with Polygon's https://mintnft.today team, we were able to target two key features that make using Bridges for NFT minting even more awesomer!

Faster throughput from upload, to batching, to deal making, to Filecoin deal on-chain.

Thanks to the increasing popularity of Bridges, throughput is already on the up and up. But to give it a boost, we've reduced the amount of time an off-chain Validator will wait before sending the uploaded data to the Auctioneer for Filecoin deal-making. The Auctioneer will also "pad" the data (when required) to make it more attractive to Filecoin miners. All in all, this is already leading to faster on-chain deals. Of course, your data is already available over IPFS the whole time, so even if wait times are "slow" to make it on-chain, your data is safely available over the IPFS CDN.

More nuanced GraphQL query APIs, plus two new default APIs.

The Bridge SDKs now support querying and retrieving by data CID. This feature is a bit understated, so I'll repeat it here for clarity: you can now query for Filecoin deal status by individual IPFS CID! This means data that you add over the Bridge is now indexed by upload CID, and linked back to deals on the Filecoin network. For NFT platforms, this means the data you upload over the Bridge can be accessed over IPFS and via Filecoin! Couple that with the free storage your currently get thanks to Bridges, and you have one helluva powerful storage platform for all your NFT assets!

Here's a super simple example of just how easy it is to upload data to IPFS and Filecoin from dApp, and then access it again later to check on deal status, find the miner(s) who have your data, and more!

import { providers } from "ethers";
import { init } from "@textile/eth-storage";

await window.ethereum.request({ method: 'eth_requestAccounts' });
const provider = new providers.Web3Provider(window.ethereum);
const wallet = provider.getSigner();

const storage = await init(wallet);

const blob = new Blob(["Hello, world!"], { type: "text/plain" });
const file = new File([blob], "welcome.txt", {
  type: "text/plain",
  lastModified: new Date().getTime(),
});

await storage.addDeposit();

const { cid } = await storage.store(file);

const { request, deals } = await storage.statusByCid(cid["/"]);
console.log(request.status);
for (const deal of deals) {
    console.log(`Stored with ${deal.miner} with status ${deal.deal_status}`);
}
const res = await storage.fetchByCid(cid["/"]);
consooe.log(await res.text())
// Hello, world!

That's it! And the first six lines or so are just boilerplate ethersjs code anyway! Jump on over to our Discord and ask for details if you don't believe me!

What's next?

The Textile team has been quietly working with the fine folks from The Graph on indexing cross-chain Bridge contract state(s) in both Ethereum/Polygon and NEAR. Some of you might have seen the recent announcement from The Graph about support for NEAR:

The Graph’s upcoming integration with NEAR is a must-have for Textile’s Filecoin Bridge system. We now have a truly cross-chain indexing solution that lets developers build Filecoin-aware dapps across the most important blockchains in the ecosystem.

Now that NEAR indexing is available in beta on The Graph’s hosted service, we will be rolling out a Bridge sub-graph for folks to try out! Stay tuned for more details on this, and an upcoming blog post where we outline how you can start querying Bridge state via The Graph yourself.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.