EVM network

This document show evm network qrcode protocol in TokenPocket. The TokenPocket Android version supports this protocol from 1.6.7, and EVM network watch-wallet uses this protocol interact with cold wallet, also the new version of the app will compatible with old version qrcode protocol.

Sign transaction

ethereum:signTransaction-version=1.0&protocol=TokenPocket&network=ethereum
&chain_id=1&data=
    {
    	"from": "0x8894E0a0c962CB723c1976a4421c95949bE2D4E3",
    	"gas": "0x5208",
    	"chainId": 1,
    	"to": "0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42",
    	"value": "0x38d7ea4c68000",
    	"type": "0x2",
    	"maxFeePerGas": "0x11853fe080",
    	"maxPriorityFeePerGas": "0x4a817c80",
    	"nonce": "0x0"
    }


ethereum:signTransaction //action there is sign evm transaction
data //transaction data

//sign transaction result
ethereum:signTransactionSignature-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"rawTransaction":"xxxx"
 }

Sign and send transaction

ethereum:signAndSendTransaction-version=1.0&protocol=TokenPocket&network=ethereum
&chain_id=1&data=
    {
    	"from": "0x8894E0a0c962CB723c1976a4421c95949bE2D4E3",
    	"gas": "0x5208",
    	"chainId": 1,
    	"to": "0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42",
    	"value": "0x38d7ea4c68000",
    	"type": "0x2",
    	"maxFeePerGas": "0x11853fe080",
    	"maxPriorityFeePerGas": "0x4a817c80",
    	"nonce": "0x0"
    }

ethPersonalSign

 ethereum:personalSign-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"message":"abcdeea",
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42" //optional, if set app will use the wallet with this address to sign message
 }
 ethereum:personalSignSignature-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"signature":"xxx", 
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42" //sign address
 }

ethSignTypedDataLegacy

ethereum:signTypedDataLegacy-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"message": [{
		"type": "string",
		"name": "Message",
		"value": "Hi, Alice!"
	}, {
		"type": "uint32",
		"name": "A number",
		"value": "1337"
	}],
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42" //optional, if set app will use the wallet with this address to sign message
 }
 ethereum:signTypedDataLegacySignature-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"signature":"xxx",
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42"  //sign address
 }

ethSignTypedData

ethereum:signTypeData-version=1&protocol=TokenPocket&network=ethereum&chain_id=1&data={
          "message":{"types": {
		"EIP712Domain": [{
			"name": "name",
			"type": "string"
		}, {
			"name": "version",
			"type": "string"
		}, {
			"name": "chainId",
			"type": "uint256"
		}, {
			"name": "verifyingContract",
			"type": "address"
		}],
		"Person": [{
			"name": "name",
			"type": "string"
		}, {
			"name": "wallet",
			"type": "address"
		}],
		"Mail": [{
			"name": "from",
			"type": "Person"
		}, {
			"name": "to",
			"type": "Person"
		}, {
			"name": "contents",
			"type": "string"
		}]
	},
	"primaryType": "Mail",
	"domain": {
		"name": "Ether Mail",
		"version": "1",
		"chainId": 1,
		"verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
	},
	"message": {
		"sender": {
			"name": "Cow",
			"wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
		},
		"recipient": {
			"name": "Bob",
			"wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
		},
		"contents": "Hello, Bob!"
	}
	},
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42"//optional, if set app will use the wallet with this address to sign message
}

//sign result
 ethereum:signTypeDataSignature-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"signature":"xxx", 
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42" //sign address
 }

ethSignTypedData_V4

ethereum:signTypeDataV4-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"message":{
	  "domain": {
		"chainId": 1,
		"name": "EtherMail",
		"verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
		"version": "1"
	 },
	  "message": {
		"contents": "Hello,Bob!",
		"from": {
			"name": "Cow",
			"wallets": ["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF"]
		},
		"to": [{
			"name": "Bob",
			"wallets": ["0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", "0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57", "0xB0B0b0b0b0b0B000000000000000000000000000"]
		}]
	},
	"primaryType": "Mail",
	"types": {
		"EIP712Domain": [{
			"name": "name",
			"type": "string"
		}, {
			"name": "version",
			"type": "string"
		}, {
			"name": "chainId",
			"type": "uint256"
		}, {
			"name": "verifyingContract",
			"type": "address"
		}],
		"Group": [{
			"name": "name",
			"type": "string"
		}, {
			"name": "members",
			"type": "Person[]"
		}],
		"Mail": [{
			"name": "from",
			"type": "Person"
		}, {
			"name": "to",
			"type": "Person[]"
		}, {
			"name": "contents",
			"type": "string"
		}],
		"Person": [{
			"name": "name",
			"type": "string"
		}, {
			"name": "wallets",
			"type": "address[]"
		}]
		}
	},
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42" //optional, if set app will use the wallet with this address to sign message
 }
 ethereum:signTypeDataV4Signature-version=1.0&protocol=TokenPocket&network=ethereum&chain_id=1&data={
	"signature":"xxx", 
	"address":"0xdA5535939971B55c0Ecf4dAc961a8854D0aFad42" //sign address
 }

Normative References

https://github.com/ethereum/EIPs/blob/9e393a79d9937f579acbdcb234a67869259d5a96/EIPS/eip-681.md

Last updated