Transactions
eth_getTransactionByHash 中的 v, r, s 是什麼意思?
在Ethereum JSON-RPC中,我發現返回是:
Returns Object - A transaction object, or null when no transaction was found: hash: DATA, 32 Bytes - hash of the transaction. nonce: QUANTITY - the number of transactions made by the sender prior to this one. blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending. blockNumber: QUANTITY - block number where this transaction was in. null when its pending. transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending. from: DATA, 20 Bytes - address of the sender. to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. value: QUANTITY - value transferred in Wei. gasPrice: QUANTITY - gas price provided by the sender in Wei. gas: QUANTITY - gas provided by the sender. input: DATA - the data send along with the transaction.
但是我輸入命令,結果和上面的文件不一樣:
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x949f40920a86f281daccbe8e30dd60a366b22ff270647815f6bfc0402ff38e42","blockNumber":"0xce3","from":"0x047347096a6dc73f8626afb520c383a02efda314","gas":"0x15f90","gasPrice":"0x4a817c800","hash":"0x70a7552c8ab8d2621c80c8a1c149012d10a823c4619cc82235cbdfad0553310b","input":"0x021df6f4000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000","nonce":"0x178","to":"0xe2412bb63a0a25d7b8973fc6764fd246ebe62c7a","transactionIndex":"0x0","value":"0x0","v":"0x1b","r":"0xd693b532a80fed6392b428604171fb32fdbf953728a3a7ecc7d4062b1652c042","s":"0x24e9c602ac800b983b035700a14b23f78a253ab762deab5dc27e3555a750b354"}}
r
,s
和其他是什麼v
意思?而且
value: QUANTITY - value transferred in Wei
,這是什麼意思?
v
,r
,s
是交易簽名的值。它們可以用作獲取任何乙太坊帳戶的公鑰更多資訊,
r
是s
ECDSA 簽名的輸出,v
是恢復 ID。 https://bitcoin.stackexchange.com/questions/38351/ecdsa-vrs-what-is-v也適用於乙太坊。為了防止重放攻擊,乙太坊對EIP 155v
中的解釋做了進一步的調整。
value
是多少 Wei 被發送到該to
地址。1 ETH 是 10^18 wei。QUANTITY基本上意味著該值以十六進制編碼。