Unlocking the Power of Web3: Pin Your Files on Decentralized Web with NUM-Powered API Service

Numbers
Numbers Protocol
Published in
5 min readMar 6

--

Translation: Chinese | Hindi | Polish | French| Vietnamese

For many, owning crypto can be a challenge because of the lack of utility the tokens have outside of holding and staking. With token utility being a challenge towards mainstream adoption, the Numbers Protocol team is super excited to announce NUM tokens newest and hopefully most impactful use case to date.

Introducing NUM Powered Web3 API service!

Advertised as the next iteration of the World Wide Web, Web3.0 envisions an internet that leverages blockchain technology to create decentralized applications that can operate without intermediaries and allow users to retain more control over their data.

As attractive as that sounds, Web3.0 is still in its early stages with few services available to access Web3 services such as decentralized storage. Available services such as Infura and Pinata fill some of the Web3 void, however they require lengthy subscriptions to access. Being a decentralized photo network for Web3.0 and seeing a need for a more accessible Web3 API service as well as an opportunity to leverage NUM utility, we created an on-demand Web3 API service powered by NUM that users can leverage to pin files on decentralized Web as well as other Web3 file actions.

Let us see how it works!

First we need to create a Capture account and acquire a valid Capture Token. The easiest way to create a Capture account is by downloading Capture App and signing up via the app. Alternatively you can leverage services such as API and SDK to create a Capture Account. More details can be found here.

To obtain your Capture Token you can login with your credentials using the API to obtain your token. See below:

curl -X POST https://api.numbersprotocol.io/api/v3/auth/token/login/ \

-H “Content-Type: application/json” \

-d ‘{“email”: “user@example.com”,”password”: “your_password”}’

Sample response:

{

“auth_token”: “02e6fd05701f49a8d1bd94bf814cfcf0eba5b98a”

}

With Capture Token in hand we are ready to go! Let us find a file we want to pin to decentralized storage. The Numbers pin file API requires either a file url or file object to work. For this example we will be using file url. Click here to see the example file we are using in this example.

Numbers Pin File API Details:

API Endpoint: https://eoqctv92ahgrcif.m.pipedream.net

Cost: 0.025 NUM + Gas (~0.004 NUM per transaction) per file per month. No Gas is required if paid with Credits.

Method: POST

Description:
This API endpoint allows developers to pin a file to IPFS via the Numbers Gateway (https://ipfs-pin.numbersprotocol.io/ipfs/).

Authentication:
This API requires a valid token for Authorization. The token should be passed in the headers of the request using the following format: “Authorization: token YOUR_CAPTURE_TOKEN”

Header:
Authorization: token $YOUR_CAPTURE_TOKEN (required)
Content-Type: application/json

Request Body (required):
fileURL (string) or file (object): Either the URL of the file to be pinned or the file object itself must be specified. If the fileURL is used, it should be passed as a string. If the file object is used, it should be the direct upload from the system.

Request Body (optional):
pin (boolean): true to pin the file (default: true)
version (integer): CID version (default: 1)

Putting all of this together in Postman we get the following:

Response:

Done! The file has been pinned on IPFS. You can view the link here.

Check out the full dev doc here: https://docs.numbersprotocol.io/developers/more-tools/ipfs-pin-file-to-ipfs

As mentioned before, a key feature is the on-demand nature of the Numbers API. This means that uses are charged only for the files you pin making it a cost-effective solution. It is also important to point out that Numbers API is powered by NUM meaning all API calls are funded with NUM token or credits in your Capture Account (For this particular API it is 0.025 NUM per file + Gas fees). This is why it is necessary to create a Capture Account and top up your Capture Account wallet with sufficient funds otherwise your files may be unpinned. To acquire NUM you can acquire them on centralized exchanges such as KuCoin or Gate.io. Alternatively you can use Pancake Swap or Uniswap as an additional means of acquiring NUM. For NUM Credits you can acquire them in Capture App via in-app purchase.

Being able to utilize NUM to gain access to tangible services is an important step forward for expanding NUM’s utility and usefulness. We hope as we move forward, NUM can continue to play an important role in not only the Numbers Protocol ecosystem but also the Web3 space. We hope you are excited as we are.

About Numbers Protocol

Numbers is building a decentralized photo network for creating community, value, and trust in digital media. Its Numbers Protocol redefines digital visual media as assets and is the backbone of a suite of tools for registering and retrieving images and videos in the Numbers network.

These include:

  • Capture App: The first blockchain camera in the world that users can easily register photos and use Web3.0 applications.
  • Numbers API: Developers and enterprises can implement Numbers API to register photos and access their Web3.0 addresses and certificates.
  • Certificates: content authenticity certificates with on-chain provenance
  • Numbers Search Engine: The first Web3.0 NFT search engine that helps users verify the history of NFTs and prevent potential NFT fraud.

Numbers champion the purity of digital media and enable people to think more critically about the interactions between our images and the world around us. The goal of Numbers is to tokenize authentic photos (including images and videos) to create a decentralized photo network in Web3.

Website | Twitter | Telegram | Discord | Medium

--

--

Numbers
Numbers Protocol

https://numbersprotocol.io ;Decentralized Photo Network for Web 3.0 For creating community, value, and trust in digital media.