Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
10

Introduction The key to finding out where a piece of code is without already knowing where it is is to start at the thing that will eventually lead to what you want to find. These can be logically thought through. For example, for relay and validation, these all occur after a node has received a block or transaction, so begin at the point where a block or ...


8

Dorier is correct that Neutrino/SPV nodes are not full nodes, because they do not verify the entirety of the blockchain, leaving potential room for attack. However, the portrayal that Neutrino is no better than other SPV modes is not correct. Neutrino is a form of SPV which improves greatly over other implementations in regards to privacy. All SPV modes ...


6

No, it won't. That's also not possible without rebuilding the UTXO set from scratch, as the unspent outputs being spent need to be known to validate spends against. If you want to force a revalidation from scratch, start with -reindex-chainstate. This will blow away the UTXO set, and recreate it from the blocks on disk, and revalidate everything in the ...


4

I think that's an incorrect impression. The code involved in CVE-2018-17144 was relatively recent (the UTXO handling logic was written in 0.8 (released feb 2013), and underwent a few small changes after, and a large improvement in 0.15). If by "original code" you refer to the code written by Satoshi, this issue is unrelated, as fairly little of that code is ...


4

That's because although the Bitcoin blockchain has a current height of 574080, your full node has synced until 195807 (the output "blocks": 195807 after running getblockchaininfo command). Block 195876, the one that you are querying, has not synced yet on your node. As you said, you have just installed Bitcoin Core. It take many hours (or sometimes days ...


4

It is of course already using vbytes; anything else doesn't make sense. Almost everywhere Bitcoin Core reports transaction sizes, they're reported in vbytes (for non-segwit transactions, 1 vbyte = 1 byte, so it was a transparent and compatible update). However, the unit Bitcoin Core uses is "BTC per 1000 vbyte" rather than the currently more common "satoshi ...


4

This answer is a slight modification on the description used in Bitcoin Optech Newsletter #43. Full credit and thanks to Dave Harding! BIP158 introduces Compact block filters, which are are based on an efficient method for encoding a list of equally-sized items. In the case of the "basic" block filters described in the BIP, this is a list of all the ...


3

CVarInt encoding is only used in the storage of the UTXO set internally, and never in the P2P protocol. CCompactSize is used in a number of places, including the number of transactions per block, the number of inputs and outputs per transaction, and the length of scripts. If you're parsing block data, you will never encounter a CVarInt. If you're running ...


3

The issue is with the recipient's wallet. There is nothing that you can or need to do. why I keep seeing this transaction as 'unspent'. It is not saying the transaction is unspent. It is saying the output of that transaction is unspent, which is perfectly fine and expected. Bitcoin transactions use a system of spending and creating transaction outputs. ...


3

Bitcoin Core uses a Branch and Bound algorithm to search for an input set that exactly matches the send request. To that end, it will deterministically search the combination space of all of its available utxos and pick the set that is the most efficient if there are multiple solutions. The Branch and Bound algorithm is briefly described in the sourcecode ...


2

Try using ZeroMQ to listen to transaction event. You can subscribe to hashtx or rawtx events. Here is a nodejs example taken from this great guide by GR0KCHAIN: https://bitcoindev.network/accessing-bitcoins-zeromq-interface/ var zmq = require('zmq') , sock = zmq.socket('sub') , RpcClient = require('bitcoind-rpc'); var config = { protocol: 'http', ...


2

You really should use the newer importmulti RPC. It lets you import multiple private keys at once (and since 0.18, also supports BIP32 derivation etc), and will do the rescan (if desired) once for all keys simultaneously. If you have accurate birthday information for your keys (a lower bound on the time when the corresponding addresses might be first used ...


2

The Problem here is the channel reserve. If you fund a channel all the bitcoin are on your side. At this point you can only pay. However let us assume you make a really small payment (below 1% of the channel capacity) your channel partner can't pay you back on that channel. After establishment lightning channels are required to keep at least 1% of the ...


2

A lightning network channel has a certain transactional capacity, determined by the channel participants at the time of creation. While it is possible for both parties to add funds to a channel during the creation of said channel, the current implementation generally has just one participant commit funds to the channel. So generally, a channel will start ...


2

The getrawmempool interface provides this information in the time field, though it is potentially very slow to respond with a large number of transactions in the mempool. It does not record this time once the transaction is removed from the mempool for non-wallet transactions, so it either needs to be gathered from this interface or recorded on addition with ...


2

I assume you mean scriptPubKey in the outputs of the coinbase transaction. Assuming that, what you are describing is popularly known in cryptography as a pre-image attack. If you can find a 'collision' with fixed existing message (in your example that is the original coinbase transaction) in such a way that they both produce identical hashes then you have a ...


2

Yes, you will want to create a new wallet and specify true for disable_private_keys. It is not necessary to specify blank as disable_private_keys will already ensure that no private keys will be generated or imported and as such, the newly created wallet will be blank anyways. You can then import xpubs, public keys, and addresses into Bitcoin Core using ...


1

I believe that your configs are ok, but when you launch lnd with the command like flags, you overwrite one parameter to a broken value. Specifically, I am talking about the flag --bitcoind.zmqpubrawtx=8332, which should be --bitcoind.zmqpubrawtx=127.0.0.1:28333 instead.


1

A wallet.dat file will contain many, many bitcoin keypairs/addresses. So there is no reason to delete an older address, and in fact this is probably a bad idea. If you or anyone else ever mistakenly sends bitcoins to that address, it will be impossible to recover them once you've deleted those keys. If you do not have the private key for an address, you ...


1

In Bitcoin, any transaction that confines to the consensus protocol is valid. This is unlike other ledger based system like Ripple, where the validators vote on whether the transaction is valid and if it should be included in the ledger. In those ledger systems, the validators gets reward for helping maintain the ledger. When your Bitcoin full node receives ...


1

one-cpu one-vote is about Proof of Work. Except it really is not a vote and "votes" aren't being recorded as to which CPU they came from. What it really means is that if you participate in mining (so you are performing Bitcoin's Proof of Work), you have the ability to decide which blockchain is "the blockchain" in the even that there are multiple valid ...


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

You are using wallet-software that requires you to download the whole Bitcoin ledger before it can read your balance. The Bitcoin ledger (the blockchain) is currently about 210 gigabtyes, so you would need a very fast internet connection to download it in just six days. If you don't have 210 gigabytes of spare storage, your laptop's disk will fill up before ...


1

Below is the code that checks that the inputs consumed are greater than the output const CAmount value_out = tx.GetValueOut(); if (nValueIn < value_out) { return state.DoS(100, false, REJECT_INVALID, "bad-txns-in-belowout", false, strprintf("value in (%s) < value out (%s)", FormatMoney(nValueIn), FormatMoney(value_out))) You can find it ...


1

There is no way to check the transaction separately for each signature. Either the entire transaction is valid or it is invalid. When you receive the partially signed transaction, you would need to sign it with your own private key using the signrawtransaction command in bitcoind. It would give you two outputs (1) hex which is the serialized transaction and (...


1

If the address doesn't have to be specific then you have a few options: Use ZeroMQ for catching every single transaction that enters the mempool and check if it's relevant to your addresses. Use walletnotify as a startup flag/config option to specify a command to execute with an option to pass the txid to the command. This will only catch the relevant ...


1

Bitcoin Core's RPC mechanism is not a push interface and does not support notifications. Each RPC returns one JSON object, so to implement notification functionality using this, your application will frequently need to poll the bitcoin daemon for new information. The RPC you probably want is listtransactions. This will return a list of recent transactions ...


1

When Bob sells coffee, Alice first constructs a transaction spending one of her available inputs to an address owned by Bob. The resulting transaction gets put into a block and is given a txidto identify it. The txid is the double-SHA256 of the serialized transaction. Within the transaction, there may be multiple outputs - one of these will be the output ...


1

Let us illustrate this using the example given in Mastering Bitcoin. Joe sent 0.1 BTC to Alice in the transaction having txid = 7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18. Below are the outputs of that transaction: vout": [ { "value": 0.10000000, "n": 0, "scriptPubKey": { "asm": "OP_DUP ...


1

There are two things mining requires in general: Processing power (CPU/GPU) RAM For Bitcoin, a tiny RAM is OK, but for Ethereum, a few GBs of RAM is needed. So how some web sites do mining using client's cpu? Using Javascript (unfortunately. There are more efficient ways, such as TurboJS or GPUJS or WebAssembly). Basically, they're trying xs with ...


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