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
Field | Explanation | Example |
---|---|---|
Storage3 URL | URL address similar to site_name.on.btfs.io, site_name is specified by the Storage3 developer user | tronscan.on.btfs.io |
Owner | Web3 account of the site deployer, either a Tron address or a BTTC address |
Last Deployment
Information about the last deployment of this site
Field | Explanation | Example |
---|---|---|
Source Code | Source code of this website | |
CID | CID (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 URL | URL provided by BTFS Gateway | gateway.btfs.io/btfs/{CID} |
DNS query command | Command 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.
Field | Explanation |
---|---|
Signer | A person or entity that creates a digital signature. |
Message | A piece of information that is signed by the signer. |
Signature | A 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.
Updated 11 months ago