Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
6

Can I send almost 1MB transaction? To be able to send a transaction that a miner will accept, that transaction has to be a standard transaction. As defined in policy.h /** The maximum weight for transactions we're willing to relay/mine */ static const unsigned int MAX_STANDARD_TX_WEIGHT = 400000; For non-Segwit transactions, the limit is 400,000 KB / 4 = ...


3

There are currently three different ways to do this: raw transactions, PSBT in 0.17, and PSBT in 0.18. I recommend that you use PSBT in 0.18 as it is the least hassle, but I will describe all three here for you. Traditionally, you would do this with createrawtransaction, fundrawtransaction, and signrawtransactionwithkey/signrawtransactionwithwallet. One ...


3

You can only broadcast transactions if your node has synced to the point that it knows the outputs that were spent. This is because your node will always validate a transaction before it broadcasts it. If it has not synced to the point that it knows the outputs that your transaction spent, then it won't have the information necessary in order to validate the ...


3

Yes, it is theoretically possible for a transaction to be valid on both mainnet and testnet. Transactions don't contain any network specific information other than the previous txid and output index.


2

I'm not an expert in this field by any means (and my error message was different), but I spent last week trying to make Bitcoinj sign a transaction and send in raw form (i.e. without using transport protocol which Bitcoinj provides) and here's what I've learned (the hard way): You can't sign transactions like that. If you call tx.addSignedInput in a loop, ...


2

The Bitcoin Wiki entry for OP_CHECKSIG answers your question. OP_CHECKMULTISIG works the same way, just applied to each signature in the sequence. First of all, it depends on the SIGHASH type you, as the signer, choose. Most likely you will use the default SIGHASH_ALL for each of the required signatures, but you could actually use different SIGHASH methods ...


1

The sequence number is always 4 bytes, it is a fixed size, little endian, 32 bit integer which makes it always 4 bytes. What you are missing is the scriptSig. The scriptSig always begins with the size of the script (as a compact size unsigned integer). If the scriptSig is empty, then the size must still be there to say that it is a 0 length byte. So the ...


1

You almost have it, you just need to make sure you are creating a transaction with an output that your wallet can sign. Example (on regtest) bitcoin-cli -regtest addmultisigaddress 2 '["02983a79d2de8e504d00ddd2343b582acef7e17ed91b308ade8dff027a92e7716d","03548ca1916957bc06dd1c6e3639ebf7b2c3c8b1715915433c1d37cab56fb26ef0","...


1

I suspect it's considered tacky in programmer circles to post an answer to one's own question, but in this case my mistake was rather dangerous so I'd like to share the details with y'all. RECAP: My question stated that the public 'push tx' APIs weren't giving viable error messages after refusing my hex-formatted raw transactions. The answer from Mr. Chow ...


1

It's valid. In fact, pasting the transaction here actually shows a little checkmark next to the "signed" icon indicating a proper signature. It is not valid. That website did not validate anything. It just checked whether there was something in the scriptWitness field, and if there was, it was marked as signed. That checkmark does not mean that it is valid....


1

Assuming the two private keys are unrelated, the answer is no. The reason for this is simple: there are 3 unknowns (the two private keys, and the single secret k value), but only two equations (the ECDSA validation equation for both signatures). If a relation is known between the two private keys (like one is twice the other, or one is one higher than the ...


1

You can't just give Bitcoin Core the redeemScript, it won't know what to do with it. The only valid thing to give it is an address, but you have not given it an address. You need to convert your redeemScript into a P2SH address first, then you give it that address. You can use the decodescript command to get both the p2sh and p2wsh addresses for your ...


1

It seems there is some discrepancy between your estimatedFee variable and the feerate being used in the fundrawtransaction step. I think you could try simplifying your code to not use the estimatedFee during the vendorXBalance calculation, and then when calling fundrawtransaction, use the subtractFeeFromOutputs option to just have the fee deducted equally ...


1

Note that witnesses are not scripts. They do not contain opcodes. They are stack elements. Witnesses do not have explicit opcodes (witnessScripts are scripts but are single witness stack elements so their opcodes don't count). The count is used as it clearly delineates between the end of the stack items for an input and the beginning of the stack items for ...


1

The third parameter is just your outputs script (actually it's the whole outputs part of a transaction) so depending on which address you want to send the funds it will change. It's using the same format as in bitcoin transactions. The data are serialized like this TYPE | Description VARINT | Number of outputs to create 8 byte | Amount to send to the ...


1

0x30 is there it's '0' in ascii (second character in your bytes1) >>> b'\x30' b'0' You also want to extract the signature from the scriptSig before passing it to a decoder, right now it contains both the signature and the public key.


1

With java? Sign it with the program that created the raw transaction, bitcoin-cli. If the wallet is synced using signrawtransactionwithwallet If want to input the private key or the wallet is not synced and knowing the private key: Using signrawtransactionwithkey (0.17.0 RPC) signrawtransactionwithkey "hexstring" ["privatekey1",...] ( [{"txid":"id","vout":...


1

The original Bitcoin client did not have a debug console or many things that we see in modern Bitcoin software. Furthermore, it is a compiled software (C++ needs to be compiled) so you can't inspect the thing being run for its source code. However, Satoshi did publish the source code along with the pre-compiled binary. For transaction creation, you can find ...


1

You also need to acquire the UTXO's which are spendable by your private key. The private key in WIF private key format provides the information required to derive the pubkeyhash found in P2PKH(pubkeyhash) and P2WPKH(pubkeyhash) output scripts spendable by the private key. Deriving the pubkeyhash, or even address, can be done with BitcoinJS on the front-end....


Only top voted, non community-wiki answers of a minimum length are eligible