請教ETH的公鑰簽名問題 - 數位貨幣

By Ida
at 2022-02-06T19:22
at 2022-02-06T19:22
Table of Contents
直接建一個可以run node.js的環境import web3.js
var web3 = new Web3(new Web3.providers.HttpProvider('rpc位址'));
//連結rpc
var privateKey = '0x你的私鑰'
var tx = {
gasPrice: '0x瓦斯費',
gasLimit: '0x瓦斯上限',
to: '0x發送地址或合約',
value: '0x主鏈幣金額',
data: '0x00'
//純傳弊用0x00合約互動要
//call methods.myMethod.encodeABI
}
//設定tx內容
var signed = web3.eth.accounts.signTransaction(tx,privateKey)
//用私鑰簽名
web3.eth.sendSignedTransaction(signed. rawTransaction)
//廣播交易
基本的簽名廣播流程大概是這樣,只要web3.js支援的鏈都可以這樣做。
Good luck
----
Sent from BePTT on my iPhone 11
--
var web3 = new Web3(new Web3.providers.HttpProvider('rpc位址'));
//連結rpc
var privateKey = '0x你的私鑰'
var tx = {
gasPrice: '0x瓦斯費',
gasLimit: '0x瓦斯上限',
to: '0x發送地址或合約',
value: '0x主鏈幣金額',
data: '0x00'
//純傳弊用0x00合約互動要
//call methods.myMethod.encodeABI
}
//設定tx內容
var signed = web3.eth.accounts.signTransaction(tx,privateKey)
//用私鑰簽名
web3.eth.sendSignedTransaction(signed. rawTransaction)
//廣播交易
基本的簽名廣播流程大概是這樣,只要web3.js支援的鏈都可以這樣做。
Good luck
----
Sent from BePTT on my iPhone 11
--
Tags:
數位貨幣
All Comments

By Rebecca
at 2022-02-05T06:25
at 2022-02-05T06:25

By Hedy
at 2022-02-09T02:43
at 2022-02-09T02:43

By Dinah
at 2022-02-05T06:25
at 2022-02-05T06:25

By Daph Bay
at 2022-02-09T02:43
at 2022-02-09T02:43

By Todd Johnson
at 2022-02-05T06:25
at 2022-02-05T06:25

By Eden
at 2022-02-09T02:43
at 2022-02-09T02:43

By Queena
at 2022-02-05T06:25
at 2022-02-05T06:25

By Bethany
at 2022-02-09T02:43
at 2022-02-09T02:43

By Agatha
at 2022-02-05T06:25
at 2022-02-05T06:25
Related Posts
請教ETH的公鑰簽名問題

By Elizabeth
at 2022-02-06T16:29
at 2022-02-06T16:29
投資人逃難 1月加密貨幣每周17億資金撤離

By Franklin
at 2022-02-06T15:45
at 2022-02-06T15:45
幣託交易失敗

By Elvira
at 2022-02-06T00:44
at 2022-02-06T00:44
想組建鏈遊公會 有人有興趣嗎?

By Megan
at 2022-02-05T18:01
at 2022-02-05T18:01
Smart Waifu NFT

By Rosalind
at 2022-02-05T16:56
at 2022-02-05T16:56