Categories
Cryptocurrency Ethereum Mastering Development

Kovan transaction never being mined

I have setup an Infura account to send transactions on the kovan network. This is the code I want to use to send ether to another account (current one has 1 ether from a faucet): var Web3 = require(‘web3’); var web3 = new Web3(‘wss://kovan.infura.io/ws/v3/<PK>’); var Tx = require(‘ethereumjs-tx’); target='<target address 0x>’ priv='<priv key 0x>’ address= […]

Categories
Bitcoin Cryptocurrency Mastering Development

Sequence valid before time

I’m studying sequence, and I set a transaction valid after 512 seconds. First of all I use regtest and I start from clean blockchain, after that I mine 114 blocks. At this point miner creates a transaction and tries to send it My decode transaction { “txid”: “59ff4adafb47a5b22c6434af38f6e138c9008356778ed8b308c48029d7d4032f”, “hash”: “1bef48f96d18f1c78021b7e4b0a7d5285f6f7d2cc8c7adc31671820e367c3d70”, “version”: 2, “size”: 191, “vsize”: […]

Categories
Cryptocurrency Ethereum Mastering Development

problem help me gas * price + value

i see all topic , but yet not slove my problem . please help me <pre> var EthereumTx=require(‘ethereumjs-tx’).Transaction const Web3=require(‘web3’) const web3 = new Web3(‘https://rinkeby.infura.io/v3/85xxxxxxxxxxx2af25e829b8d9df‘) const account1=’0xbd77caf08fe49d3f5aef6f83fc23b8d2129b468f’ const main = async () => { const count = await web3.eth.getTransactionCount(‘0xxxxxxxxxxxxxxxf5aef6f83fc23b8d2129b468f’); const nonce = web3.utils.toHex(count); const block = await web3.eth.getBlock(‘latest’); const gasLimit = web3.utils.toHex(3000000) const gasPrice = […]

Categories
User Help

Passing the output of GetKeyboardLayout into LoadKeyboardLayout doesn’t work

Question Why passing the output of GetKeyboardLayout (after formatting it to hex) into LoadKeyboardLayout doesn’t work? The docs for GetKeyboardLayout says (bolded by me): GetKeyboardLayout Retrieves the active input locale identifier (formerly called the keyboard layout). Return value Type: HKL The return value is the input locale identifier for the thread. The low word contains […]

Categories
Cryptocurrency Ethereum Mastering Development

Signing a raw transaction, wrong R and S values

I am trying to sign a raw transaction in javascript without relying on dependencies like web3, ethereumjs, etc. I am following the python tutorial found here, and porting to JS as I go: https://lsongnotes.wordpress.com/2018/01/14/signing-an-ethereum-transaction-the-hard-way/ I start by building out the RLP-encoded transaction: var FROM_PRIV = “00d862c318d05de0a1c25242c21989e15e35e70c55996fbc4238cd2f2f6a8f62”; //var FROM_ADDR = “8d900bfa2353548a4631be870f99939575551b60”; var NOUNCE = “80”; var […]

Categories
Bitcoin Cryptocurrency Mastering Development

nSequence doesn’t block my transaction

I’m studying how Timelock works. I’m able to create transaction with absolute time, nLocktime and OP_CLTV. Now I want to understand the relative part, and I start with nSequence. At the moment I use createrawtransaction to create my raw transaction, where bitcoin-cli createrawtransaction ‘[{“txid”:”‘$TXID'”,”vout”:’$VOUT’,”sequence”:’$TIME’}]’ ‘[{“‘$ADDR_DEST'”:’$AMOUNT’}]’ Where $TIME is: $ gdate –date ‘now + 512 seconds’ […]

Categories
Mastering Development

Not able to use the info via Terminal in the code sample

I am newbie with JS and trying to write a simple code to encrypt and decrypt the info via Javascript, the sample code is below. It is working till the encryption, but I want to take the ‘mystr’ into the decryption section back, which is however not working. Any clue would be helpful, thnaks! var […]

Categories
Bitcoin Cryptocurrency Mastering Development

Sign manually P2SH-P2WPKH with openssl

I have a very similar problem of my last post before post again, I tried a lot of time but whitout success. I studied this link but I don’t find solution. I have 50 bitcoins (total Amount) and I want to move 49.999991 It’s my compressed public key 02c142cea1c25689d233b35c0021c47194ebc99cbc6154f7de66f2c078c1e773f3 And It’s my transaction data { […]

Categories
Bitcoin Cryptocurrency Mastering Development

Sign manually P2SH-P2WPKH with openssl

I have a very similar problem of my last post before post again, I tried a lot of time but whitout success. I studied this link but I don’t find solution. I have 50 bitcoins (total Amount) and I want to move 49.999991 It’s my compressed public key 02c142cea1c25689d233b35c0021c47194ebc99cbc6154f7de66f2c078c1e773f3 And It’s my transaction data { […]

Categories
Bitcoin Cryptocurrency Mastering Development

Error 26: mandatory-script-verify-flag-failed (Data push larger than necessary)

I’ve created a raw transaction, and I get this error when I try to send it with sendrawtransaction to my local bitcoin regtest. { “error”: { “code”: -26, “message”: “mandatory-script-verify-flag-failed (Data push larger than necessary)” }, “id”: “1”, “result”: null } This is the transaction from which I want to spend: { “error”: null, “id”: […]