eth_requestAccounts()
GETRequest access to user's wallet accounts (opens popup)
- Usage
await window.pqcWallet.eth_requestAccounts()- Returns
Promise<string[]>- Array of account addresses
Post-Quantum Secure Browser Wallet
First browser extension with NIST-standardized post-quantum cryptography and quantum-resistant post-quantum digital signatures
PQC Wallet Extension
Post-Quantum Secure Browser Wallet
The first browser extension to bring quantum-resistant cryptography to Web3
Built on NIST-standardized post-quantum cryptography and post-quantum digital signature algorithms. Your signatures remain secure even against quantum computers.
Simple JavaScript API similar to MetaMask. Integrate PQC signatures into your dApp in minutes.
Works with Ethereum, BSC, Polygon, and any EVM-compatible blockchain.
Try the extension functionality right here in your browser
Note: "Connect Wallet" may not work in the Chrome Web Store version due to a missing popup file. Use "Get Accounts" instead after selecting your account in the extension popup.
Make sure you have the PQC Wallet Extension installed and activated.
Run a check to see output here.
Integrate PQC Wallet into your dApp with simple JavaScript API
if (typeof window.pqcWallet !== 'undefined') {
// PQC Wallet is installed
console.log('PQC Wallet found!');
} else {
// Prompt user to install
alert('Please install PQC Wallet Extension');
}
async function connectWallet() {
try {
const accounts = await window.pqcWallet.request({
method: 'eth_requestAccounts'
});
console.log('Connected:', accounts[0]);
return accounts[0];
} catch (error) {
console.error('Connection failed', error);
}
}
async function signMessage(message) {
const accounts = await window.pqcWallet.request({
method: 'eth_accounts'
});
const result = await window.pqcWallet.request({
method: 'pqc_signMessage',
params: [accounts[0], message] // account first, message second
});
console.log('Signature:', result.signature);
return result;
}
async function verifyPQCSignature(message, signature, publicKey) {
const isValid = await window.pqcWallet.verifySignature(message, signature, publicKey);
console.log('Signature valid:', isValid);
return isValid;
}
Request access to user's wallet accounts (opens popup)
await window.pqcWallet.eth_requestAccounts()Promise<string[]> - Array of account addressesGet currently connected accounts without prompting
await window.pqcWallet.eth_accounts()Promise<string[]> - Array of connected addressesSign a message with a quantum-resistant post-quantum digital signature
await window.pqcWallet.pqc_signMessage(message, account)message: string, account: stringPromise<{signature: string, publicKey: string}>request() method with params: [account, message] orderVerify a PQC signature
await window.pqcWallet.verifySignature(message, signature, publicKey)message: string, signature: string, publicKey: stringPromise<boolean> - true if valid, false otherwiseSend a transaction with signature
await window.pqcWallet.eth_sendTransaction({from, to, value, data})Promise<string> - Transaction hashGet the post-quantum digital signature public key for an account
await window.pqcWallet.pqc_getPublicKey(account)Promise<{publicKey, algorithm, keySize}>Standard Ethereum personal message signing
await window.pqcWallet.personal_sign(message, account)Promise<string> - Signature hex string// Complete integration example for PQC Wallet
class PQCDApp {
constructor() {
this.account = null;
this.init();
}
async init() {
if (typeof window.pqcWallet === 'undefined') {
console.error('PQC Wallet not installed');
return;
}
// Listen for account changes
window.pqcWallet.on('accountsChanged', this.handleAccountsChanged.bind(this));
}
async connect() {
const accounts = await window.pqcWallet.request({
method: 'eth_requestAccounts'
});
this.account = accounts[0];
console.log('Connected:', this.account);
return this.account;
}
async signWithPQC(message) {
if (!this.account) await this.connect();
const result = await window.pqcWallet.request({
method: 'pqc_signMessage',
params: [this.account, message] // account first, message second
});
console.log('PQC Signature:', result.signature);
return result;
}
async verifySignature(message, signature, publicKey) {
const isValid = await window.pqcWallet.verifySignature(message, signature, publicKey);
console.log('Signature valid:', isValid);
return isValid;
}
async getPublicKey() {
if (!this.account) await this.connect();
const keyInfo = await window.pqcWallet.request({
method: 'pqc_getPublicKey',
params: [this.account]
});
return keyInfo;
}
handleAccountsChanged(accounts) {
this.account = accounts[0] || null;
console.log('Account changed:', this.account);
}
}
// Usage
const dapp = new PQCDApp();
await dapp.connect();
const signature = await dapp.signWithPQC('Hello PQC World!');
const isValid = await dapp.verifySignature('Hello PQC World!', signature.signature, signature.publicKey);
// Listen for account changes
window.pqcWallet.on('accountsChanged', (accounts) => {
console.log('Account changed:', accounts[0]);
});
// Listen for network changes
window.pqcWallet.on('chainChanged', (chainId) => {
console.log('Network changed:', chainId);
window.location.reload();
});
// Connection events
window.pqcWallet.on('connect', (info) => console.log('Connected', info));
window.pqcWallet.on('disconnect', (error) => console.log('Disconnected', error));
Install PQC Wallet Extension and start securing your Web3 applications today