Check Site

Check the site info on Storage3 and verify the signature of the latest deployment

Overview

What is Check Site Service

BTFS is an open decentralized network. Anyone can create a decentralized website whose address ends with .on.btfs.io through Storage3's services.

In order to increase the transparency of decentralized websites deployed via Storage3, we provide a site query service. Now, users can visit Check Site to query website information, such as deployer, source code, latest deployment CID and related signatures, etc.

Schematic Diagram

The figure below shows the basic use cases of users using the Check Site service. You can also learn how developers deploy websites and sign the message of the latest deployment on Storage3 here.


Check Site

When the user queries the domain name of the website, if the website exists, relevant information will be returned. The fields are explained as follows:

Site Info

Contains basic information about the domain name and owner of the website

FieldExplanationExample
Storage3 URLURL address similar to site_name.on.btfs.io, site_name is specified by the Storage3 developer usertronscan.on.btfs.io
OwnerWeb3 account of the site deployer, either a Tron address or a BTTC address

Last Deployment

Information about the last deployment of this site

FieldExplanationExample
Source CodeSource code of this website
CIDCID (Content Identifier) is a unique identifier used to represent content addressed by its content, rather than its location. It is a cryptographic hash of the content's data and is used to retrieve the content from the BTFS network.
Gateway URLURL provided by BTFS Gatewaygateway.btfs.io/btfs/{CID}
DNS query commandCommand to check the mapping of Storage3 URL to BTFS CID

Signature and Verification

To verify that website content is from the owner, we provide a signature verification feature. Publishers can sign key messages after deployment. These signatures can be verified in native code or by a third party.

FieldExplanation
SignerA person or entity that creates a digital signature.
MessageA piece of information that is signed by the signer.
SignatureA digital signature is a mathematical scheme for verifying the authenticity of digital messages or documents. It is used to ensure that the message was not tampered with during transmission.

Local Verification Code

We use the following local JavaScript code to verify the signature, and you can also run these code to verify the signature yourself.

import { ethers } from 'ethers';   // [email protected] 
import TronWeb from 'tronweb';    // [email protected]

export const verifyEthSignature = (message, signature, address) => {
  if (!message || !address || !signature) return false;
  const _signingAddress = ethers.utils.verifyMessage(message, signature);
  return _signingAddress.toLowerCase() === address.toLowerCase();
};

export const verifyTronSignature = async (message, signature, address) => {
  if (!message || !address || !signature) return false;
  const HttpProvider = TronWeb.providers.HttpProvider;
  const fullNode = new HttpProvider('https://api.trongrid.io');
  const solidityNode = new HttpProvider('https://api.trongrid.io');
  const eventServer = new HttpProvider('https://api.trongrid.io');
  const tronWeb = new TronWeb(fullNode, solidityNode, eventServer);

  const messageHex = tronWeb.fromUtf8(message);
  const addressBase58 = tronWeb.address.fromHex(address);
  var res = await tronWeb.trx.verifyMessage(messageHex, signature, addressBase58);
  return res;
};

Third-party Verification Signature

In addition to local code verification, you can also verify signatures through third-party tools.

  • For the signature of the Tron address, it can be verified on Tronscan
  • For the signature of BTTC address, it can be verified on Signator