Standard List
DidType
Type of account bound to
web3mq
.Only 'eth' and 'starknet' wallets are currently supported.
// 1. if you connect eth wallet
const didType = "eth";
// 2. if you conncet starknet wallet;
const didType = "starknet";
DidValue
address of account bound to
web3mq
.Currently only eth and starknet wallet addresses on the public chain are supported.
import { connect } from "get-starknet";
// 1. if you connect eth wallet
const didValue = window.ethereum.selectedAddress;
// 2. if you conncet starknet wallet;
const starknet = await connect();
if (!starknet) {
return;
}
const [didType] = await starknet.enable();
Master PrivateKey
The master privete key is the key generated by signature with js-sha256, and then the final string is encrypted with AES-GCM.
import { Client } from "@web3mq/client";
const { secretKey: privateKey } = Cleint.register.getMainKeypair({
password: "your enter password",
did_type: "your did type",
did_value: "your did value",
});
Master PublicKey
The master public key is the key generated by signature with js-sha256, and then the string generated by @noble/ed25519.
import { Client } from "@web3mq/client";
const { publicKey } = Cleint.register.getMainKeypair({
password: "your enter password",
did_type: "your did type",
did_value: "your did value",
});
Sign Content
Sign Content of Master Keypair
signature content in the form of a string consisting of
password
, did_value, did_type is used to generate the master key pair
import { Client } from "@web3mq/client";
const { signContent } = await Client.register.getMainKeypairSignContent({
password: "your enter password",
did_value: "your did value",
did_type: "your did type",
});
Sign Content of Register
The signature body used for registration is passed as a string consisting of mainPublicKey, didType, didvalue, userid, signContentURI.
import { Client } from "@web3mq/client";
const { signContent } = await Client.register.getRegisterSignContent({
mainPublicKey: "your master public key",
didType: "your did type",
didValue: "your did type",
userid: "your userid",
signContentURI: window.location.origin,
});
Temporary PrivateKey
Generate the temporary private key in hex string format using @noble/ed25519.
import ed from "@noble/ed25519";
let privateObj = ed.utils.randomPrivateKey();
let TempPrivateKey = Array.from(privateObj, (byte: any) =>
("0" + (byte & 0xff).toString(16)).slice(-2)
).join("");
Temporary PublicKey
Generate the temporary public key in hex string format using @noble/ed25519.
import ed from "@noble/ed25519";
let privateObj = ed.utils.randomPrivateKey();
let pubkeyObj = await ed.getPublicKey(privateObj);
let TempPublicKey = Array.from(pubkeyObj, (byte: any) =>
("0" + (byte & 0xff).toString(16)).slice(-2)
).join("");
Userid
String starting with
user:
encrypted by did_type + did_value + timestamp with sha3_224
import { sha3_224 } from "js-sha3";
const timestamp = Date.now();
const did_type = "eth";
const did_value = window.ethereum.selectedAddress;
const userid = `user:${sha3_224(did_type + did_value + timestamp)}`;
Web3MQ API Endpoints
During this initial testing phase, we've hosted complete networks of Web3MQ nodes in different regions around the globe. Connect to these endpoints below, to access the Web3MQ Testnet.
https
- https://testnet-us-west-1-1.web3mq.com
- https://testnet-us-west-1-2.web3mq.com
- https://testnet-ap-jp-1.web3mq.com
- https://testnet-ap-jp-2.web3mq.com
- https://testnet-ap-singapore-1.web3mq.com
- https://testnet-ap-singapore-2.web3mq.com
wss
- wss://testnet-us-west-1-1.web3mq.com
- wss://testnet-us-west-1-2.web3mq.com
- wss://testnet-ap-jp-1.web3mq.com
- wss://testnet-ap-jp-2.web3mq.com
- wss://testnet-ap-singapore-1.web3mq.com
- wss://testnet-ap-singapore-2.web3mq.com
Wallet Address
The wallet address on the public chain, currently only
eth
andstarknet
wallet addresses are supported.
import { Client } from "@web3mq/client";
const didValue = await Cleint.register.getAccount("your wallet type");
Wallet Sign
Get the signature by evoking the Client.sign method with signContent, address and walletType.Currently only
eth
andstarknet
wallet signatures are supported.
import { Client } from '@web3mq/client';
const { sign } = Client.register.sign(signContent: 'your sign content',address: 'your enter wallet address',walletType: 'your enter wallet type');
BlockChain Type
The wallet type on the public chain, currently only
eth
andstarknet
type wallets are supported.
// 1. if you connect eth wallet
const wallet_type = "eth";
// 2. if you conncet starknet wallet;
const wallet_type = "starknet";