QRCode Protocol
Introduction
This document show the QR code protocol supported by the TokenPocket wallet. Note that there are several QR code entrances in TokenPocket wallet, and the scanning functions of individual entrances are slightly different, which will be explained below.
TokenPocket Android 1.6.7 has already supported new version of the QR code protocol. Watch wallet in 1.6.7 and above versions will use new protocol. For details, please refer to EVM TRON EOSIO Solana BTC
TokenPocket supports qrcode protocol as follows:
Receipt qrcode
Create Eos Account qrcode
Import BTC watch-wallet qrcode
DApp login qrcode
DApp call wallet to transfer tokens qrcode
DApp call wallet to sign tx qrcode
DApp call wallet to sign message qrcode
WalletConnect
Add DApp to Favorites qrcode
Open DApp qrcode
Receipt qrcode
The EVM network support two kinds of receipt qrcode
0xbc4ca0eda7647a8ab7c1161c2e118a18a936f13d
ethereum:0x4122131cd452e9729546b79f9f4e00c12e1d1c22
The EOSIO network support two kinds of receipt qrcode
//account
xiao1111aaaa
// ScanProtocol
{
"address": "xiaoyuantest", //receiver account
"amount": "0",
"symbol": "EOS",
"contract": "eosio.token",
"precision": 4,
"protocol": "ScanProtocol",
"blockchain": "EOS",
"action": "transfer"
}
BTC, TRON, Cosmos, SOL,IOST,Polkadot, use address or account(IOST) to generate receipt qrcode
Create Eos Account
The qrcode is used to create Eos account
{
"account": "pubyeoaad33k", //the account to be created
//owner to the new account
"owner": "EOS7eZbMjyMxtp35sg6xHcqtEHzEYb7ahzdHRAGcYgcJW8k8V8PnS",
//active to the new account
"active": "EOS7eZbMjyMxtp35sg6xHcqtEHzEYb7ahzdHRAGcYgcJW8k8V8PnS",
"blockchain": "EOS", //network
"action": "createAccount"
}
Import BTC wallet-wallet
{
"action": "watchWallet",
"data": [{
"blockchain": "BTC",
"extend_key": [{
"key": "xpub6C7EYVsBR5Py964wD6Z71W5imraHCesnM9ofzAeKHXnow7yEzVJVgyZJub7VMDwuNYdwJLCgMrkzLhbdB6kbkLqXzzNg",
"path": "m\/44'\/0'\/0'" //general
}, {
"key": "ypub6X2988R6rReDapW3dLojxVhw8MxiDU76xi16jhjHECfAaGTxdBp1tb4gJwNvvrU7Ye4uX5KjtAQPPtaZEf4j6pLWU",
"path": "m\/49'\/0'\/0'" //segwit
}, {
"key": "zpub6rJrhc86dyTzQsBQNXujoTvAbGfFUr3TwQUdjy6SZgPkQmmFtRJRab92vhyMZufh7LSA5CcCiNaXRXr9TPAhPe32Z",
"path": "m\/84'\/0'\/0'" //nativeSegwit
}]
}]
}
Watch-wallet and Cold-wallet
So far, The watch-wallet and cold-wallet only supported by EVM series networks, EOS, TRX, BTC, SQL
Note: The QR code generated by the watch-wallet can be scanned at the QR code entry on the cold wallet homepage. but signed QR code generated by cold-wallet must b scanned at the QR code entry dialog box that pops up on the wallet-wallet


EVM
watch-wallet qrcode. This qrcode is used to scan by cold-wallet to sign
{
"signType": "ethSignTx",
"blockchain": "ETH", //network
"action": "coldWalletSign",
"sign": {
"from": "0x8894E0a0c962CB723c1976a4421c95949bE2D4E3",
"gas": "0x5208",
"chainId": 1,
"to": "0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42",
"value": "0x38d7ea4c68000",
"type": "0x2",
"maxFeePerGas": "0x11853fe080",
"maxPriorityFeePerGas": "0x4a817c80",
"nonce": "0x0"
}
}
//rawTransaction from cold-wallet
0xf8ac82062e85013f2ed0c0828cf894eca41281c24451168a37211f0bc2b8645af4509280b844a9059cbb0000000000b79bbc09226198e8d15a05219fdd2a20cba0932621528743459250c016a00fd584c4e7bcfa0667e9f70a2
EOS
{
"type": 21,
"isHash": 0,
"blockchain": "EOS",
"action": "coldWalletSign",
"sign": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906950fa362c88e74ec1a4b00000000013015a4b966ea3055000000572d3ccdcd0190b1cad3684f8deb00000000a8ed32322190b1cad3684f8deb602483a5c79a9f98e803000000000000045450540000000000000000000000000000000000000000000000000000000000000000000000000000" //待冷钱包签名的数据
}
// signature
SIG_K1_KjDBR53j7r4kMfF4KAYXrETK7mgKcG9q1t6MKShxvY2SufCiVc4pq1Ny9hKPsK5WKzXvjX
TRX
{
"signType": "tronSignTx",
"useTronHeader": true,
"blockchain": "TRX",
"action": "coldWalletSign",
"sign": "b80514c0a5a9c498a60c8f76cdf45787e9522b16cc1" //data to sign it is the txID of tron tx
}
357e608c6e2a96da63d878be2a63fda3b0c778c69116e5000d56f05a4e2b3b3a86d85622a0810d64a2ece2ef44bd8bbb0bb7bcc4b21dc36c2cb7700
Solana
{
"signType": "solanaSignTxMessages",
"blockchain": "SOL",
"action": "coldWalletSign",
"sign": {
"messages": ["87PYrB1jCEXWCkMKRvnub8UekEvf4LMp32PXBuNPMzdYqGU825U5iSw9UjKn81EeaxBtEZkS38auGm11m3LS1RsNrMd94VEax3ZpmQFyqxDGepsk871fFcKdXHAi3dR"]
}
}
["2quWLViqnUoDu3vih55mhzV4FJK5dPL6unEZm6Sm82JKiq2fLQj8xEqr3xbp5gmYTHyDdcCz"]
BTC
{
"blockchain": "BTC",
"action": "coldWalletSign",
"sign": "XU\/JbsIwEP2XufQSwI4dx86xKouAA5XoIhUO401BlJIShwZQ\/r2uqq6jmdEs743eXGDzUjWhhuLpAqHdWCjAS+k8WkOJ9TznmCllNTEStWSCEhpzhop5LY2lXGvHspxxLXguZGq0gwQqDGW8tFsNuLpaDchXRI\/bIz43DgraJ8NelkQF1rVQkATCqYpzqM1hU4US6zKCP5tFo2fuNPnAASrKkWRWCk8VyangUgmPXvpU5ZqaVKNnnnBJLZM5dOsE9k34\/hKtPbg61sBGvG7R5WYadsHN7Nw+4sL4ufHn5ZG9if34n1jZJX\/442mbGXtLp7y+pmy0vbnb3U+25+PDeFudlu51\/8OXfcbIL0uHPdGtu3c="
//note that the sign data is compress by zlib and base64 encode, the origin text is:
{
"inputs": [{
"txid": "f88efadc93fb8cd14bbe35734b647682cbe",
"path": "m\/49'\/0'\/0'\/0\/0",
"value": 2.0E-5,
"index": 0,
"type": "scripthash",
"scriptPubKeyHex": "a914a05d86f19071c2baf3f0481d387"
}],
"outputs": [{
"address": "3F4sxae7cJtaPcfLcfzTv3w6oG",
"value": 1.0E-8
}, {
"address": "3GJx5cdQWGkpyTeqo",
"value": 1.330000000000002E-6
}]
}
}
//the data is compress by zlib and base64 encode, decode by base64 and decompress by zlib to get signature
ZZDdbQAgCIRXQn4ExgGB/UcobdomTe9BY8S78wOEHx042fiuseYlFm3KPPwqjSb8ihGce4winyV4iXOw1hyoN2E99mul5+7K0Gp6TPmYHEf3ivfmge7RBEike+/ufAtwW/zR0fDDjvmQyAdP0b3bZjQpkd8oFErYFe+bn0lA/98HSG3KcdhibL4OY4OueR5mDA2wrbUpIO83WQBxm1Rkw4voiqipcQp9RVpe7E3Qz4pjfFieQQknkkxlerxG53UBQSnd2MaQuUqSBNq8JBhV2W4PPZhLOKehRoo21o7u5rPDZ5tgJFBb2Bf7i9nj0ctjcegneNkxEr0tCPe8x4EWwdelESPih8cH
WalletConnect
DApp login, transfer, sign tx, sign message
The DApp qrcode protocol is consistent with DeepLink, for details, please refer to:
Add DApp to Favorites
{
"title": "Etherscan",
"url": "https://etherscan.io/",
"icon_url": "https://etherscan.io/images/logo-ether.png?v=0.0.2",
"protocol": "TIP-001",
"protocol_version": "1.0",
"chain_list": [{
"network": "ethereum",
"chain_id": "1"
}],
"desc": "Etherscan is a Block Explorer and Analytics Platform for Ethereum, a decentralized smart contracts platform",
"full_screen": 0,
"hori_vert": 0,
"title_color": "0xffffff",
"navi_color": "0x2890fe"
}
Add DApp to Favorites use TIP-001 protocol, for more details:
Open DApp
{
"url": "https://dapp.mytokenpocket.vip/referendum/index.html#/",
"chain": "EOS",
"source": "xxx"
}
Last updated