Skip to content

Instantly share code, notes, and snippets.

@haidoan
haidoan / createAndSignTx.go
Last active October 29, 2023 08:33
Creating raw bitcoin transaction multiple input output golang
func GetPayToAddrScript(address string) []byte {
rcvAddress, _ := btcutil.DecodeAddress(address, &chaincfg.TestNet3Params)
rcvScript, _ := txscript.PayToAddrScript(rcvAddress)
return rcvScript
}
type TXRef struct{
TXHash string
TXOutputN int
}
const Web3 = require("web3");
const Tx = require("ethereumjs-tx");
const acct = "";
const receiver = "";
const chainId = 42;
const privateKey = new Buffer(
"PRIVATE_KEY",
"hex"
0xf73883024D6275D416eb4C47f91eC16d816D0cB7
0xf73883024D6275D416eb4C47f91eC16d816D0cB7
@haidoan
haidoan / haidt_gist
Created November 1, 2017 14:40
test gist for ether
hello