text:
How did Taproot get its name?
I've looked around best I could, but couldn't find a good answer to this. Is there any place it's documented publicly as to why the soft fork was called Taproot?

This was answered in the Bitcoin Optech "Preparing for Taproot" series (2021):

“I always assumed the origin of the name was ‘taps into the Merkle root’, but I don’t actually know what Gregory Maxwell’s thinking was.” —Pieter Wuille (source)
“I originally had to look the word up; but I took it as the key path being the ‘taproot’ because that’s the tasty one that you make carrot soup out of, and the merklized scripts would be the other lesser roots that you hope to ignore.” —Anthony Towns (source)
“The name originated in a visualization of a tree with a thick central truck like a dandelion taproot—the technique is mostly useful because of the assumption that there is one high probability path and the rest is fuzzy stragglers, and I thought it was a good one because of the punny fact that it verifies script-path spends by tapping into the hidden commitment in the root.
[…] Alas, calling the hash tree with the sorted interior nodes a ‘myrtle tree’ didn’t catch on. (Myrtle tree because the set of policies with an equal hash root are ones whos ordering differs by a permutation which can be defined by a t-function, and Myrtle is the family which includes melaleuca, the tea-tree, and it sounds like ‘merkle’. :p )” —Gregory Maxwell (source)


text:
How can I tell if a Taproot input is a key path spend or a script path spend?
In some analyses of chain activity, I sometimes see Taproot spends divided into key path and script path.

Why are they called that?
Which BIPs should I read to learn more?
When I look at a P2TR tx in mempool.space, is there a way I can tell if an input is a key path or script path spend?
What does an ordinary P2TR payment use?
What does a MuSig2 payment use?

Taproot is specified in BIP341 which also includes much relevant information such as motivation and rationale. My answer will essentially just rephrase some of its highlights.
Key path spends and script path spends are two distinct ways of spending a Taproot output. In a key path spend the sender just provides a signature that's valid for the public key in the P2TR output and the transaction being signed. In a script path spend the sender needs to provide a script, a proof that the P2TR output commits to this script (called the control block) and the initial stack to the script in order to satisfy it (which will generally include at least one signature).
You can tell if an input is a key path spend or a script path spend by how many witness items there are in its witness stack. If there is exactly one element in the witness stack1 it is a key path spend, otherwise it is a script path spend. See an example transaction that has two inputs, one of which is a key path spend and the other is a script path spend:
37777defed8717c581b4c0509329550e344bdc14ac38f71fc050096887e535c8
Key path spending should be used when possible as it's cheaper and doesn't reveal the existence of a possible script path. Only when the key path cannot be used (for example when agreement cannot be reached in a multiparty protocol) should the script path be used as a backup.
MuSig2 uses aggregated keys, which are indistinguishable from ordinary keys and can likewise be used in both key path and script path spending.

1 If there are at least two witness items and the last one starts with 0x50, it is the optional annex and it's removed before checking whether the input is a key path or script path spend.

Thank you very much! That's a great answer. That's a great example too, I can definitely tell the script path spend since it's much bigger. I don't think that's a reliable heuristic however, since a keypath spend could also stuff a bunch of data into the witness, correct?

No, a key path spend cannot have any witness items apart from the signature and the optional annex. It's not a heuristic, it's literally how the consensus rules are defined.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Pushpoold mmcFE-Litecoin server not running properly
I am starting a LiteCoin mmcFE-pushpool pool for several clubs at my university, and am having some problem. First, we are running on an EC2 instance (Ubuntu), and have mmcFE and pushpull running. I am having two major issues before we can start up this pool...
1) On the web interface, users are able to create and account and log in just fine. On the left hand side, there is an error/notice that states: Notice: Undefined variable: totalOverallShares in /var/www/includes/leftsidebar.php on line 64 I am also getting Notice: Undefined variable: totalOverallShares in /var/www/includes/leftsidebar.php on line 71
2) Second, I went ahead and ignored the previous error and decided to run a CPU miner just to test the stats. Normally I can hash out (scrypt) at about 11kh/s on other peoples pools. It has been running for about 5hrs now, and my stats on the website are still saying 0. The cron job is running every 2 minutes. Using MINERD and never getting any "shares submitted, Yeah!" on my pc....
Does anyone have any pointers? I am really stumped as to what could be holding us up. You can see this problem on the webpage at http://p2pool.us
{
# network ports
"listen" : [
        # binary protocol (default), port 8336
        { "port" : 8336 },

        # HTTP JSON-RPC protocol, port 8337
        { "port" : 8337, "protocol" : "http-json" }

],

# database settings
"database" : {
       "engine" : "mysql",

       # 'host' defaults to localhost, if not specified
        "host" : "127.0.0.1",

       # 'port' uses proper default port for the DB engine,
       # if not specified
       "port" : "3306",

       "name" : "sc",
       "username" : "myusername",
       "password" : "mypasswd",
       "sharelog" : true,
       "stmt.pwdb":"SELECT password FROM pool_worker WHERE username = ?",

       "stmt.sharelog":"INSERT INTO shares (rem_host, username,   our_result,               upstream_result, reason, solution) VALUES (?, ?, ?, $
},

# cache settings
"memcached" : {
        "servers" : [
                { "host" : "127.0.0.1", "port" : 11211 }
        ]
},
        "servers" : [
                { "host" : "127.0.0.1", "port" : 11211 }
        ]
},

"pid" : "/tmp/pushpoold.pid",

# overrides local hostname detection
"forcehost" : "localhost.localdomain",

"log.requests" : "/tmp/request.log",
"log.shares" : "/tmp/shares.log",

# the server assumes longpolling (w/ SIGUSR1 called for each blk)
"longpoll.disable" : false,

# length of time to cache username/password credentials, in seconds
"auth.cred_cache.expire" : 75,

# RPC settings
"rpc.url" : "http://127.0.0.1:9332/",
"rpc.user" : "user",
"rpc.pass" : "pass",

# rewrite returned 'target' to difficulty-1?
"rpc.target.rewrite" : true,

# allow clients to update the ntime field of their work
"roll.ntime.disable" : false
}

The above shows my PUSHPOOLD config. Below, is my litecoind conf:
server=1
rpcallowip=127.0.0.1
rpcuser=user
rpcpassword=pass

I have the same problem. I've set the rpc.target.bits in server.json but I am unable to get any accepted shares. What am I missing?

To answer your questions:

This error is common, and i usually fixed after the first cronjob / first submitted share.
This error is also common, as you have not set a difficulty in the server.json file.
See this line here?
#rewrite returned 'target' to difficulty-1?
"rpc.target.rewrite" : true,

This tells the pushpoold that, if there's no difficulty set, then set it to -1, which is infinite, meaning you will NEVER find a share.
Add parameter
"rpc.target.bits" : 17

To the RPC setting section of server.json. You can change the value however you like. The higher it is, the more frequently you'll find a share. The lower it is, the hard it is to find one. This doesn't impact the ammount of LTC found.
If you're using mmcFE, be sure to edit that value in the configuration file of mmcFE.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
BTC Transfer from One Exchange Vendor to Other Exchange Vendor
It's my first time doing transfer with BTC. I have read from some articles that if you send BTC with low transfer fee it will be stuck in the network and the status is 'unconfirmed'.
I was sending ~0.049 BTC from one merchant to another merchant (BTCMarkets to Binance). I'm not sure how it performs but somehow my transfer was joined with someone else transfer. The other transfer was confirmed but my transfer is still unconfirmed. I also have no idea how to 'control' the transfer fee since I only paid the withdrawal fee from BTCMarkets. Below is the tx for the transfer. The ~0.0049 BTC was my transfer which is still unconfirmed.
https://blockchain.info/tx/e75f48c3fa06de6198fc0fbac0f2a2eadcdd6608ca572757015d45cdba6c1f1a
Can anyone help how to un-stuck or reverse or change the status to 'confirm' for my transfer? Thanks all.

I've marked this as a duplicate of a 'my transaction isn't confirming' question, there is a lot of good info if you look at the answers there.
One additional note: when sending from one exchange to another, you do not decide the fee. The exchange controls the keys that spend the coins, so they will set the fee for you. If you control the keys of your coins yourself, then you can choose the fees when you spend your bitcoins.
Exchanges can choose to 'batch withdrawals', which means they will send multiple withdrawals to customers as a single transaction with multiple outputs. Batching a transaction allows the sender to pay less fees than if each transaction was sent individually.

Thanks Chytrik for the info. One more question, so why the other transfer was confirmed (spent) and my transfer is not confirmed yet (unspent)? The fee is 442.478 sat/B which i believe is high enough and for both transfers. Is it because the other BTC value is higher (0.45 BTC) than my BTC value (0.049 BTC)?

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Doesn't bitcoin have the same inflationary problems as fractional reserve banking?
I keep hearing that Bitcoin is immune to inflation because You can't make more bit coins than some fixed constant of bitcoins through a process of mining.  However, assuming enough people take it seriously, doesn't bitcoin have the same inflationary problems as fractional reserve banking?  As soon as you put it in a bank because people hate storing their bitcoins in a "vaults" like gold, you introduce the same old fractional reserve banking system that the US federal reserve watches over...  and because its an international currency that's not regulated, who sets the fractional reserve rate for bitcoin?  isn't that a bubble waiting to happen?  What happens if there's a run on a bitcoin bank?

Could you explain further why someone would store a Bitcoin in a bank and why would that matter? How would the Bitcoin's inflate because of that situation?

I was just talking hypothetically if bitcoin is used broadly as a replace for normal money... then people start placing them in  banks for convience, and banks start loaning money in bitcoins...I guess currently bitcoin requires you to exchange back to normal money to use it?  I couldn’t for instance get a loan denominated in bitcoins?

Not that I would ever want to do that.. I would rather have a loan that devalues over time so that I can pay it off faster ...just extrapolating the bit coin hype about taking over as money...

Maybe a person would be willing to borrow bitcoin for short term inferring less risk from value changes... then it all goes back to fractional reserve banking again and inflation of money derived for bitcoin?


text:
Is the ordering of blocks in the rev*.dat files same as the blk*.dat files?
I understand that blk*.dat files save the blocks in the order it gets them from it's peers. Is the rev*.dat files in the same order as the blk*.dat files?
For example, would the 400th magicbyte in the blk00000.dat file be representative of the same block as the 400th magicbyte in the rev00000.dat file?

Does this answer your question? File format -- rev*.dat

No.
Block data is written (appended to) blk*.dat files whenever a block is received from the network (assuming things like PoW and a few other sanity checks pass). As blocks are received in parallel from multiple peers, their order on disk ends up being chaotic.
Undo data is written when a block gets fully validated. As full validation requires validation of all parent blocks first, the order of undo records tends to be much more monotonic. However, it is not guaranteed to be be perfectly continuous either, as reorganizations can cause discrepancies. If a received block never ends up being part of the active chain, it will never have an undo record, despite the block data being present.
The only guarantee is that block data and undo data is stored in matching files (e.g. a block which is stored in blk00473.dat will have its undo data in rev00473.dat).

Follow up question: so does that mean that rev*.dat files have no size limit?

I guess there is a theoretical limit (a block can have at most 24387 inputs, and each could spend a with-miner-help-specially-crafted 10 kB UTXO, so around 240 MB). Beyond that, indeed not really.

There is perhaps a more relevant constraint: the sum of sizes of all undo data up to block X cannot exceed the size of the blockchain up to block X, as the undo data contains spent UTXOs, which must have been created before at some point.

One more question. If bitcoin-core were to reorg to block 601,000, does it ask leveldb where to find the relevant info from rev*.dat?

The blocks/index database stores metadata about every block, includes where and in which file its block and undo is stored. That database is loaded into memory at startup though, so there isn't any need to query LevelDB itself at runtime.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
What is a txn? How can it be invalid?
I read this in a IRC exchange:

verifies your txns against a random node that you don't control. if for some reason that node went rogue, you might have accepted an invalid txn

What is a txn?

It's short for "transaction". There is a list here of rules that individual transactions must follow:
https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages
Some reasons that a transaction could be invalid are:
-The person trying to spend bitcoin doesn't have that much bitcoin.
-The person trying to spend bitcoin already submitted another transaction trying to spend the same bitcoin.
-The person trying to spend bitcoin can't prove that they are the owner of the bitcoin.
In addition, the block as whole that the transaction is in must follow these rules: https://en.bitcoin.it/wiki/Protocol_rules#.22block.22_messages

"txn" is short for "transaction".  The abbreviation "tx" is also often used.
For an explanation of what makes a transaction (in)valid, see the links at How to know if a transaction is valid?


text:
How can Blockchain.info query information from the blockchain faster than I from my own node?
I've just run a Bitcoin node but I don't understand how blockchain.info or any other blockchain explorer works. I mean, sometimes I have problems like "socket.timeout". Shouldn't it be faster to query info from my own node than from a blockexplorer?

API providers, such as Blockchain.com, are not querying a node to answer your queries to them usually. For the handful of providers that actually do offer a proxy service to a bitcoin node, they usually run several of them and spread out incoming queries so that no single node is answering a huge number.
They extract the information they need and store it in a separate database, which is optimized for quickly serving the information for all transactions and addresses.
bitcoind is optimized for running the Bitcoin Protocol, which is largely just communicating with other nodes, maintaining the utxo set, and validating blocks. While it does let you retrieve historical transaction information, it is not the primary goal. It also does not offer universal address indexing, and only indexes transactions for the known wallet addresses.
It may be worthwhile for your usecase to extract historical information from bitcoind once and use that as a source for your future queries.


text:
What's max possible tx/second right now?
What's max possible tx/second right now, if we use all the latest Bitcoin tech multi-sig,  MAST + Taproot, without increasing block size? Let's say our goal is simple tx finality and 10b utxo.
How do I calculate this max utxo possible right now per block, or per second?

Does https://bitcoin.stackexchange.com/q/111234/5406 answer your question?

There is a large gap between the theoretical maximum value of tx per second vs. what is actually feasible.
Edit. Note that these calculations are arbitrary, as the comment from Murch pointed out the smallest possible tx without a real purpose could be even smaller. These transactions will not transfer any BTC over the network, but for the sake of theoretical maximum speeds they can be calculated.
The theoretical minimum-sized transaction is an OP_CHECKSIG transaction with the minimum size of 166 bytes for the whole tx. The tx looks like this (the total size of 166 bytes is the two scripts + reference to previous tx + headers):
scriptPubKey: <33 byte compressed pubKey> OP_CHECKSIG scriptSig: <72 byte signature>
Given a 1 MB block, we get 1,000,000 bytes / 166 bytes per block which is about 6024 tx per block. On an average, a block is mined every ten minutes. This means 6024/(60*10) or around 10 tx per second. A conservative estimate of a transaction having two inputs and two outputs equates to a rough tx size of 320 bytes which will halve our estimation to 5 tx per second.
Edit. Fix segwit calculations, as pointed out by Murch in the comments
For a 100 % segwit block there is a great calculation in this answer by cdeker. Basically a full segwit block could hold up to 12195 transactions per block (calculated by having the non-segwit part as a limiting factor, which is 82 bytes in the optimal case). This will result in about 20,3 tx/s.
You can calculate the theoretical maximum speed by dividing your tx count in a block by 600 seconds. How many tx will fit into a block can be calculated in many different ways but the theoretical possibilities are far from actual usage. For the current situation in real world, you can see that the avg number of tx in a block hovers around 3000 tx per block.

This answer has a few issues. If you allow non-standard transactions, the theoretical minimum-sized transaction would be to spend an OP_TRUE output with an empty input script, and create a new OP_TRUE output. Such a transaction has 60 bytes. If you only look at standard transactions, a tx with a single P2TR input and a P2WPKH output has 99 vbytes. A block can fit just shy of 10,000 of those. It’s not clear to me why you think that segwit doesn’t matter for your calculation, segwit transactions are way more blockspace efficient, see e.g. https://bitcoin.stackexchange.com/q/84004/5406

Thanks, your points are valid. I did include an input script as part of the calculation to at least somewhat make assumptions about what a smallest feasible tx would have. But I feel like the actual value is not so important, the point is that a more realistic tx will always be much larger. I will edit to make it more clear that the first part is arbitrary. I will also edit to add a segwit calculation.

If you want to maximize the (useful) transactions per block, you should try to minimize the transaction weight. The smallest payment transaction using standard output types would be a transaction with a single P2TR keypath input and a P2WPKH output. This transaction would weigh:
42 WU (Header) + 230 WU (P2TR input) + 124 WU (P2WPKH output) = 396 WU (= 99 vbytes)
You would be able to fit about 10,100 such transactions into a block, which would amount to about 16.833 transactions per second.
If you wanted to maximize the creation of UTXOs, your goal would not be to maximize the transactions per second (which in itself is a meaningless metric, if one considers that transactions can perform multiple payments and range in 60 to 100,000 vB), but rather the payments per second. To that end, we would create transactions with a single P2TR input and as many outputs as possible. In that case, we would be able to fit 10 transactions into a block that each create 3222 P2WPKH outputs.
This would allow us to create about 32,200 additional UTXOs in each block, i.e. approximately 53.667 payments per second.


text:
Does Ledger Nano S Have an xPub or a zPub for Bitcoin wallets?
{
  "xpub": "tpub-big-long-key-that-starts-with-tpub",
  "index": 1,
  "freshAddressPath": "84'/1'/1'/0/0",
  "id": "libcore:1:bitcoin_testnet:tpub-big-long-key-that-starts-with-tpub:native_segwit",
  "blockHeight": 2097540
}

When I copy the "xPub" from a Ledger Nano S Bitcoin Testnet wallet I find exactly this (key obviously obfuscated). I'm confused because in my novice research my understanding is that the derivation path 84'/1'/1'/0/0 is for zpub keys and segwit wallets. Indeed, my wallets in my ledger are labeled "segwit". But here the extended key is labeled "xpub" and the key starts with "xpub", or in the case of the Bitcoin Testnet, it starts with a "tpub". Why?
Can somebody explain to me why this seems mixed up? Is this key an xpub or a zpub? Is a tpub and an xpub the same thing? Should I use Bip32, Bip44 or Bip84 to derive child keys (and thus addresses) that will match my ledger nano?
I have found a clever python class that will convert xpub to zpub. Is this the correct thing to do in this case?
https://gist.github.com/jleo84/97fc58c6174f146642b2c215c20f88f5
Thanks in advance! This is my very first question (don't worry, I have more) on this Stack Exchange and I really appreciate any support or advice I can get.

BIP 32 specifies a serialization format for extended public keys. This format has the prefix xpub and is generic for all public keys that can be used with BIP 32, regardless of the address type or the derivation path.
BIP 84 added an additional serialization which results in the prefix zpub to indicate that keys derived from that extended public key should only be used in native segwit addresses.
It is correct for a wallet to output xpubs for keys used in segwit addresses. It is also correct for a wallet to output zpubs for the same keys. It just depends on the implementation. The serialization is only used for some metadata to the wallet, the derived keys will all be the same. In order to get the same addresses, you need a wallet which will derive the keys and use them in the address type that you are expecting.

tpub is a prefix used for extended public keys that were created in a testnet wallet.

Thank you for this answer but now I must ask, how would I know how my Nano is deriving keys? I assume it's using Bip84, no? Should I assume it's using Bip32 since the key is an xpub? If so, why would the derivation path start with 84? Should I be converting this "xpub" to a "zpub" and use Bip84??

xpub and zpub are different encodings of the same key zpub encodes the additional information that the specific key should be used to derive a P2WPKH address (you can also derive P2PKH address from it if you want). Ledger uses bip84 to derive the keys/addresses but it doesnt bother to encode it to zpub it uses the more generic xpub.

@mike-a BIP 32 is the only derivation method. It specifies the way to derive keys and how derivation paths work. It does not specify any specific derivations paths. BIP 84 only specifies specific derivation paths to use, in addition to zpub. Your device is using both bips - it is using BIP 32 to derive keys specified with the BIP 84 derivation path.

@AndrewChow Thanks for this answer! Do you know of an API where I could fetch the total balance of a zpub address? https://bitcoin.stackexchange.com/questions/116038/how-to-retrieve-total-btc-held-in-ledger-wallet/116040#116040 Thanks.


text:
Determining change address
hoping to gain a bit more clarity on how change addresses work here.
In the attached example, can the change address be identified with 100% certainty? Is there a potential scenerio where it could be the first one, and a potential where it could be the second (without knowing more details about who sent it, what wallet they used etc). I see some people say you can't be certain, but in most cases it seems fairly obvious (ie the odds are overwhelming that it is the 2nd smaller amount for example)
Thanks!
https://www.blockchain.com/btc/tx/90cb1a71128bda33b00d9008b08ec6cfd3ea8f9868753e038a8b719c6b97f9c1

In the attached example, can the change address be identified with 100% certainty?

No.

Is there a potential scenerio where it could be the first one, and a potential where it could be the second (without knowing more details about who sent it, what wallet they used etc).

Yes.
There are a lot of heuristics that can be used to determine which output is the change output. However there are also a lot of ways that wallets can combat this. Without having the wallet that created the transaction, it is impossible to know with 100% certainty which is the change address.

(ie the odds are overwhelming that it is the 2nd smaller amount for example)

In your example, you use what is referred to as the unnecessary input heuristic. This heuristic relies on the assumption that a wallet is not going to include extra inputs to make a payment that could be covered by fewer inputs. Because the second output in your example is smaller than any one of the inputs, if it were the payment, then the transaction has an unnecessary input so it is likely that output is not the payment.
But wallet developers know that this is a heuristic used to determine change. So some wallets actually do exactly what this heuristic assumes to be false. Such wallets will sometimes make a change output that is greater than the payment amount. This breaks the heuristic.
There are a number of other techniques that can be used to determine which output is change, but each heuristic relies on an assumption that wallet developers can also break.

Thanks man appreciate it!

In the attached example, can the change address be identified with 100% certainty?

No. Unless a transaction sends change back to the input address, you can never be 100% certain what the change output is. There are heuristics that can suggest which output is more likely, but wallet developers know about these heuristics and can actively work against them.
In your specific example, one heuristic to determine the change output is looking at script types. The transaction spends two P2WPKH inputs and creates one P2WPKH output and one P2SH output. Since wallets often work with only one script type, this suggests the P2SH output belongs to the recipient. But again, some wallets break this heuristic by randomly sending change to a different script type.
There's also the unnecessary input heuristic, which is discussed in Andrew Chow's answer.

cheers mate appreciate the response


text:
Master Node(BIP32 Root Key) to xpriv and xpub
I struggle to make a python script that can make xpriv and xpub (extended public and private key) from the Master Node (BIP32 Root Key). I've derived the Master Node from the BIP39 seed with passphrase. If anyone could help, it would be much appreciated.

Which tutorial are you following? What have you tried so far? What error messages were produced?

I've now gotten xprivs and xpubs by using bitcoinlib. I want to do it without using a library like bitcoinlib. I want to in the end produce addresses and be able to sign transactions. No tutorial is used as I have not found one.

Do you intend to implement the key derivation described in the https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki description?

Yes sir. Hardened addresses.

I wish you good luck. I'm not sure what your actual specific problem or question here is but presumably you'll post code when you hit a problem that you'd like help with.


text:
Is it possible to check latency of already approved transactions?
I am running a BTC core node and I would like to perform some experiments and analysis on Bitcoin transaction latency. However, I see that the method getrwatransaction returns an object with:

"blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time
"time" : n, (numeric) Same as "blocktime"

As I would like to get information on transaction latency, in a way that I can subtract the first appearance of such transaction in the mempool with the block creation epoch, those two parameters should not be the same, otherwise I only see it as a redundant and useless information.
Is there a way to get such piece of information? I see that mempool does not store (obviously) all the record of received transactions, so I was wondering whether such information is stored in the transaction itself, or if it is possible to get it somehow.

You can use either getrawmempool (for all mempool transactions) or getmempoolentry (for individual transactions) to get the exact time a transaction was accepted into your node's mempool:

"time": xxx,                         (numeric) local time transaction
entered pool in seconds since 1 Jan 1970 GMT

You can also listen for the hashtx ZeroMQ event and store the time when that event was received. Storing timestamps is something you will need to do anyway, since when the transaction becomes confirmed, Bitcoin Core seems to immediately discard the mempool entry data.

Thank you for your answer. But those solutions imply that transactions to be analyzed are new. If I need to fetch transaction latency for some 2014 transactions, how do I do? Is that possible?

No, that's not possible, unless you can find someone who collected this data back in 2014 to give it to you, and you also have no way to make sure this data is correct.

As a useful info for who might be needing such data, I have found out that that using blockchain.info APIs, information about latency on newer transactions can be fetched. In fact, if we try to query BTC core node:
getrawtransaction "614095eeb59da281af6d49d85a153bfd8ec41acca272289e49bc6bd60b7ac7f6" true

we notice that "time": 1669848740, equals to "blocktime" one. However, if we query blockchain.info APIs, we obtain "time":1669848666, giving us a latency of 74 seconds.


text:
What is HP in "Bitcoin Core - HP"?
Just noticed when I run Bitcoin Core, the title bar says "Bitcoin Core - HP". What does HP mean?

Bitcoin Core version v27.0.0
macOS Sonoma 14.5 (23F79)

bitcoin.conf:
server=1
dbcache=4000
prune=2000
datacarriersize=0
mempoolfullrbf=1

If you have a wallet open, Bitcoin Core displays it as part of the window name.
You probably have a wallet named "HP".


text:
Verifiable way to share knowledge of bitcoin address
I am looking for a simple or standard way (government bureaucrat-proof) to share knowledge of a bitcoin address in a legal contract without revealing the address itself. Having to reveal the address later for verification is not a problem.
I was thinking to either share a SHA256 hash of the address or share the address itself without 4 or 5 characters.
The former way could be too complicated and the latter too insecure (an attacker could scan the blockchain to find the missing characters). If these were the only two options however, I would settle for the simpler one.
Is there another way to do it?

What you're looking for is called a commitment scheme: a way to commit to some value while keeping it secret, with the ability to reveal it later.
Sharing a SHA256 hash of the address is a way of committing to it, but for an address that has been used in a transaction (of which there are currently less than 50 million) the recipient can easily brute-force it by checking them all. What you really want is to concatenate the address with a sufficiently long random string that you also keep secret and reveal later. That way the commitment can still be verified but no longer brute-forced.
Disclaimer: I am not a lawyer nor a cryptographer. Consult with professionals from both fields before you try to use cryptography in actual legal contracts.


text:
Why doesn't Bitcoin Core use auxiliary randomness when performing Schnorr signatures?
BIP340 recommends using auxiliary randomness in generation of the Schnorr signature nonce, as follows:

Using unpredictable randomness additionally increases protection against other side-channel attacks, and is recommended whenever available.

However, Core always seems to provide a zeroed vector for auxiliary randomness. There's a relevant commit.
Given that Core uses randomness in generation of private keys, shouldn't it be using randomness in performance of Schnorr signatures as well?

As with any open source project, if no one cares enough to implement it, it doesn't get implemented. Providing no auxiliary randomness is still safe as the deterministic nonce generation algorithm includes the private key. This is enough entropy for it to be safe, so there isn't any need to provide any auxiliary randomness, although it would probably be nice to do so.
Additionally, we like deterministic signatures, so if auxiliary randomness were to be provided, it would need to be generated in a deterministic way so that all attempts to make a signature over the same message with the same private key always results in the same signature. Implementing that was presumably more effort than it was worth.

If it's deterministic, it's not random. The advice in BIP340 is to actually use random auxiliary data - that implies that re-signing the same message with the same key won't be the same.


text:
10 Days Unconfirmed. Transaction Fr. Blockchain Wallet
I sent a transaction on Dec 12. It is now the 22 and its still unconfirmed. I paid $17 in miner's fees... and still. 10 days later its still stuck. I've tried ViaBtc, and Antpool accelerator to no avail. Still stuck. PushTx.Btc is $500 as are two other services I tried. Not sure what to do.
tx
24f2df7d517dbf03447a279a1d3f6e5db82fc1760cf78178b0a7bf80a35389d0
Please help
PS> I have written to Blockhain, and they said they do not accelerate nor confirm transactions
PSPS> CPFP: Does this mean that I send more money to the SAME wallet address and pay more on the second transaction?

First, which of the receiver address is yours? And is it an exchange wallet address?

CPFP will cost you a lot, I did an estimate for you (((824Sat/Byte) / 100000000) * (1702Bytes + 192Bytes)) - 0.000853BTC = your new transaction is going to cost you in total 0.01475356BTC. That equals to 7684Sat/Bytes. This should cover for both parents and child.

I sent bitcoin To:
1B1qvcXkYQfEmJhabYB4nM12LRwCZ14GG2 I am sending it from a wallet to an exchange.

Unfortunately the chance is slim that you can do a CPFP if you sent to an exchange. Most, if not all exchanges don't allow it.

Thank you for your answer. Are you saying that I would need to send another transaction to the SAME address listed above 1B1qv (etc) and send that transaction with a fee of 0.015 bitcoin??? Omg.

No, you would need to send a transaction with 1B1qvcXkYQfEmJhabYB4nM12LRwCZ14GG2 (parent) as the sender to another address (child).

What should I do?  I've contacted the exchange. No reply in more than 7 days.

The only viable option you have left is to wait it out, or ask some members on bitcointalk.org for their free transaction accelerator services or maybe even go for the paid services( but be aware of the scammy ones).

What is the longest you've heard of someone's transaction being stuck? I'm afraid it may be stuck for months or years and anything can happen to the blockchain, wallets, and bitcoins in the interim. Look at today. $7K Drop :(

Honestly is difficult to say, if the incoming waves of transactions decrease in the upcoming days your transactions stand a chance to be confirmed. If not, maybe dropped in  1 - infinite weeks time.

I recommend you post on bitcointalk.org where the members have announced their services, I have good experience with their services. Some of them have access to a variety of pools.

Thank you so much. On there now. Its hard to differentiate scam from real. 100's of pages. People arguing back & forth. Sighhhh....

Go for the ones with the most views and replies, and look through the last 2 pages if transactions have been accelerated recently. Well, is free anyway, so wouldn't hurt.


text:
How are altcoins on crypto-exchanges based off BTC, ETH, and others
My question deals with all the cryptoexchanges out there that only accept and use cryptocurrencies.  How is it that for example, LTC's price is based off of BTC on some excahnges (on the y-axis of a price graph)?  The reason I am asking is because lets say I own 10 LTC that stays the same price in USD and the price of BTC drops dramatically.  I then convert my LTC to BTC in the exchange and BTC then raises back up to it's original price, does that mean I just made money?  As in could I keep exchanging between the two whenever one goes up and the other goes down? I thought of this a week or two ago when bitcoin's price drastically dropped and has been fluctuating.

The "price" is usually based on the most recent trade in the specified exchange pair (e.g. LTC BTC). The most recent trade is simply two other participants on the exchange, the seller and the buyer. The seller (also called a "maker") offered to sell a particular coin at a particular price in a particular currency (e.g. to sell some amount of LTC for a specific price in BTC). The buyer (also called a "taker") offered to buy a particular coin at a particular price in a particular currency. The trade happens by the exchange when a buyer and seller's orders are matched.
Can you make money in these price differences between multiple currencies? It is possible, this is called an arbitrage. However, don't forget that the transfers usually take a bit of time and the arbitrage opportunity may have passed by the time you've made some trades, because rest assured others are looking for these arbitrage opportunities as well. Additionally, there are usually fees for each trade that eat into any earnings you might be making.
Also, this isn't that different from Forex Arbitrage trading in fiat currency markets so it is a well studied discipline and we can certainly learn from the practices established there.


text:
Abandon Transaction or Increase fee
I'm using Bitcoin core v0.15.1 and I am trying to send my BTC to coinbase. I have waited over 72 hours since initiating a transaction and when I right click the "abandon transaction" and "Increase fee" options are still not available.
I selected minimum fee under custom and didn't use the recommended. I don't want to further mess things up and some of the answers on here seem kind of technical is there a way I can just right click an abandon transaction if its still unconfirmed for almost 4 days now?
I also only have a mac computer and when I try running bitcoind from the "bin" folder I can't type anything at all in the terminal the commands do any of the commands like -zapwallettxs. I also have never used the terminal before.
All I want to do is gain access to my bitcoin and cancel Transaction ID: 3f749994629bd22808733e98cde83fa9c85d7124b7e616df5c78420f9b573341

Go to Why is my transaction not getting confirmed and what can I do about it? And search for "Abandon Transaction" , you will find the solution.


text:
Bitcoin Wallet is downloaded I think. What next?
Please excuse me if I use the wrong vocab - as I am unfamiliar with this and so will probably explain myself like a foot.
Here goes. I am on a Mac and I think I have downloaded the block chain and I now have a window called Bitcoin - Wallet showing Balance: 0.00 BTC and Unconfirmed: 0.00 BTC and Number of transactions: 0.
Now what?
1) I thought I should be getting an address or something that I need to copy and keep safe - and
2) I should create a Password.
I don't want to close the Bitcoin-Wallet window in case I make it disappear for ever ..
3) Should I be getting a little picture of a wallet on my desktop?
Thank you

possible duplicate of How do I create a new address in the Bitcoin-QT client?

Doesn't seem like a precise duplicate to me.  That one is asking about creating a new address, while this user has confused their private keys with an address.

A few answers to your questions...
You will likely want to encrypt your wallet by going to Settings/Encrypt Wallet
You will want to make sure that your password is secure by using numbers and both lower and uppercase letters at the very least.  You MUST MUST MUST remember this password or your funds will be GONE GONE GONE!
I'm not sure I understand what you mean about closing your wallet and making it disappear forever.  It's generally okay to quit your wallet at anytime even if it is not completely thru syncing.  When you re-open your Bitcoin-QT client it will just pick up where it left off in downloading the blockchain.  Your Bitcoin-QT wallet app should be located in your apps folder...
Applications/Bitcoin-QT
You can create new addresses in your address book.  Once you click your address book you will see a New Address button on the bottom left which you can use to create new addresses.  You can also create new addresses by going to Receive Coins.
I hope this helps!  :)

This does help but I need somebody to show me. How would I access my wallet from another computer if I wanted a one off 'help' session?

Addresses are not private information. If you ever want to receive bitcoins you will have to give one of your addresses to the sender.
The information that you keep private is what is known as the "private key". Each addresses has its own private key. The private key is what allows you to spend the coins sent to the corresponding address.
Usually you don't see the private key in your bitcoin-qt window. The private key is stored in a file called wallet.dat in your bitcoin-qt folder. If you decide to encrypt your wallet by setting a password it is the wallet.dat that is encrypted. So the best way to keep it safe is to a) set a password and b) routinely backup the wallet.dat file.

Thank you but I find it very difficult to understand. Is there any way you know of how I could get a one off 'help' session like a private lesson? Also, how would I access my wallet from another computer?

The Bitcoin-QT software presents you with a user-friendly interface with which to view your Bitcoin transactions. I don't use it, but I imagine that the public address will be displayed somewhere on the screen (it will be of the form 1xxxxxxxxxxxxxx).
Your private key is stored in a wallet.dat file by the software, and it handles all signing and transactions for you, if you ever wanted to send coins. You can obtain both the public and private keys by exporting:

How do I export my private keys from my Bitcoin-Qt client?

And if you close the program and reopen it, your coin balance will not be lost. All of your keys are stored permanently in a wallet.dat file.

Thank you gsp92.I have now found the address in 'Received coins' tab in the Bitcoin-Wallet window.


text:
How to safely shutdown bitcoind ?
Surprised this one hasn't been asked yet.
But how / what is the recommended best practice for shutting down bitcoind ?
Right now I'm manually killing the process with either sudo kill {pid} or if this is failing (like just now) using sudo pkill -9 -f bitcoind

EDIT: This answer is deprecated, it applied to an old version of the bitcoind client. Apparently RPC functionality is now removed. Please look at the other answers instead.
I guess using bitcoind stop. I recommend this approach as killing the process could end you up with a corrupted database, from what I have experienced. Use bitcoind --help for all options and bitcoind help for all JSON-RPC commands.

Good thinking. Missed that.

This doesn't work anymore: Error: Command line contains unexpected token 'stop', see bitcoind -h for a list of options.. The correct way to stop bitcoind is bitcoin-cli-stop command (see the other answer with higher vote count).

The correct way, as shown by Aliakbar Ahmadi and confirmed by Jonathan Cross is bitcoin-cli stop. Note the last space as opposed to a hyphen.

I'm not sure if bitcoind stop still works as RPC with newer releases, since somewhere in help sections it says RPC funcionality removed from bitcoind.
Try bitcoin-cli stop.

Confirmed bitcoin-cli stop works in version 11.

Still works in 2017! Use this.

does not work...  I did ./xxxcoin-cli stop   but nothing happen after that and ./xxxcoind also does not stopped.

Yes, it still works.

Does not work with my setup. I think first of all to be able to use bitcoin-cli you have to start bitcoind with option server=1. I did this and still bitcoin-cli getinfo is returning an error. So I suspect bitcoin-cli does not work properly. I have a process in top that is called bitcoin-init. I am not sure if this is the right process that should be active after I started bitcoind or if this some sort of initialisation process and since it uses 100% of my Raspberry CPU it might as well hang and this might be the root of the problem. I appreciate any input.

Try sudo bitcoin-cli stop if that throws an error about RPC credentials

if you started it using 'bitcoind -daemon'
and you are using version 10 or above, then use 'bitcoin-cli stop'

Does not work for me. What could be the reason? Does the daemon need to be started as a server? Is bitcoin-init an initialisation process to bitcoind? Because that is my process in top.

In my case, It works that ./bitcoin-cli -regtest stop

Make sure you specify the same options that you normally use when running bitcoin, for example, if you use a different datadir:
cd C:\Program Files\Bitcoin\daemon
bitcoin-cli -datadir=C:\Bitcoin stop

This worked for me:
bitcoin-cli -rpcuser=[username] -rpcpassword=[password] -rpcconnect=[ip] stop

If using testnet, try ./bitcoin-cli -testnet stop

./bitcoin-cli stop is enough

I don't know why this correct and the only working answer when on testnet was down-voted. ./bitcoin-cli stop is definitely not enough when running 0.18rc on testnet.

It's only enough if you specifically added testnet=1 to your bitcoin.conf. Otherwise  the default is for mainnet!


text:
BTC sent from blockchain.info to BCH wallet on coinbase by mistake
I m quite a newbie in crypto. On Dec 21st by mistake i sent 2BTC from my blockchain.info wallet to my Coinbase BCH wallet. Quite an honest mistake as they just had implemented BCH page and i didn’t realise i m taking BCH address. I have contacted them many times and they refuse to assist me with recovering them. Is there anyway that i can retrieve those coins? Much appreciate your help with this.
I have read answers about similar cases but my question is specific to Coinbase. Has there ever been a case where coinbase assisted with recovery? Do they have any policy that takes into account the amount of transaction or they refuse to help in any case?

I have done exactly the same thing on Dec 23rd.  I only received a generic response that transactions are irreversible.  But I read of others that have had success from transactions >$5K  which both of ours qualify.  If it wasn't Coinbase the simple solution is to use the private key to put the coin back in a BTC wallet.  But since this is an exchange we are at the mercy of Coinbase to retrieve those private keys and deposit them into our equivalent Coinbase BTC wallets.  If you happen to get a response or a next step to resolution please post the solution.

Thanks I have read similar things. I m just wondering if Coinbase ever helped anyone in this situation. Given the materiality if transaction. Please let me know as well if you get any success.


text:
Check which bitcoind version I am running
I have a version of bitcoind on my server and I can't remember which version it is.
How can I find out what version my bitcoind is ?
eg: ./bitcoind -version ..or such

What os is the server running?  For example with linux if you installed with apt you can try something like dpkg -p bitcoind

It's running ubuntu 12.04 but the bitcoind was installed from the sourceforge site not the ubuntu apt package manager..

If it was installed more than 4 days ago (sep 4 2013$ then it's definitely not the latest ;) but it looks like thepiachu's answer should clear things up.   Run it as a server then send it getinfo.

EDIT: As of 0.16.0, use getnetworkinfo to get the version of bitcoind:

getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings

Send a getinfo command to the server. It shows the version of bitcoind:
{
  "version": 80400,
  "protocolversion": 70001,
  "walletversion": 60000,
  "balance": 102.2899977,
  "blocks": 104358,
  "timeoffset": 1,
  "connections": 15,
  "proxy": "",
  "difficulty": 1.0,
  "testnet": true,
  "keypoololdest": 1372886245,
  "keypoolsize": 101,
  "paytxfee": 0.0,
  "errors": ""
}

How does version: 80400 relate to the Bitcoin Core version? I'm trying to check if my bitcoind is running version 0.9.1 of the core.

It should be 90100. I guess the format is 00.09.01.00 with leading zeros being truncated.

Yep - chatting with the developer of bitcoin-testnet-box it's running quite an old version of bitcoind.  I'll look at updating it this weekend.

This answer is no longer valid as getinfo is deprecated as of 0.16.0. Use getnetworkinfo instead.

Please consider using getnetworkinfo info instead of getinfo since bitcoin 0.16.0
bitcoin-cli getnetworkinfo
{
  "version": 160000,
  "subversion": "/Satoshi:0.16.0/",
  "protocolversion": 70015,
  "localservices": "000000000000040d",
  "localrelay": true,
  "timeoffset": 0,
  "networkactive": true,
  "connections": 5,
  "networks": [
    {
      "name": "ipv4",
      "limited": false,
      "reachable": true,
      "proxy": "",
      "proxy_randomize_credentials": false
    },
    {
      "name": "ipv6",
      "limited": false,
      "reachable": true,
      "proxy": "",
      "proxy_randomize_credentials": false
    },
    {
      "name": "onion",
      "limited": true,
      "reachable": false,
      "proxy": "",
      "proxy_randomize_credentials": false
    }
  ],
  "relayfee": 0.00001000,
  "incrementalfee": 0.00001000,
  "localaddresses": [
  ],
  "warnings": "Warning: unknown new rules activated (versionbit 28)"
}

Like GetInfo, the GetNetworkInfo RPC call provides:

version: The numeric Bitcoin Core (bitcoind) server software version (e.g. 100000)
protocolversion: The numeric Bitcoin protocol version of the software (e.g. 70002)

In addition, GetNetworkInfo provides the "subversion" user agent string (e.g "/Satoshi:0.10.0/").
Note that the GetInfo call has been deprecated and may be removed in a future version of the software (source).

curl code for achieve that (using JSON-RPC)
curl --user YOUR_USER --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

Then it will prompt
Enter host password for user 'YOUR_USER':

Finally just hit your password and get the bitcoin server response
{"result":{"version":666,"protocolversion":666,"walletversion":666,"balance":0.00000000,"blocks":366666,"timeoffset":-9,"connections":8,"proxy":"","difficulty":72722780642.54718018,"testnet":false,"keypoololdest":1448366656,"keypoolsize":666,"paytxfee":0.00000000,"relayfee":0.00001000,"errors":"Warning: Message"},"error":null,"id":"curltest"}

You will see something like after running the command-line above where version is what you want to see
NOTE:
I'm http://127.0.0.1:8332 that means you have to
ssh your_bitcoin_server

And also you must have your ~/.bitcoin/bitcoin.conf or /etc/bitcoin/bitcoin.conf (as a service) configuration file set to default port (8332)
Feel free to change this as required

If you do not like reading json output, get the jq command do it for you
bitcoin-cli getnetworkinfo | jq .version


text:
Are transactions possible when setting up/ sync wallet Qt2
Hi any help really appreciated..
About 12 months ago I purchased some bit coins from 2 different merchants and began to sync my wallet on Qt 2. Frustrated with tedious progress I put the project on hold, and now have continued to sync, which is still only 88% complete.
My question and dilemma is this. I can't recall in the set up process if I was required to send coins to my own wallet, there are 3 transactions showing 2 received and one sent.. I don't remember if I actually sent coins to someone back then when I was going to purchase a product, I seem to recall the coins I was going to send him somehow weren't yet  in my out of sync wallet…
Is it possible to be sending coins before the wallet is synced ?
So if a new, out of sync wallet is showing coins as having been sent to
an address, could that be to my own wallet due to the set up process ?
that address is listed in the "sent to' tab is there a way to check if its me or where it went ?
Cheers,
Tim


text:
Convert P2SH to P2PKH
I'm using btcrecover to recover a Ledger BIP39 backup seed that I wrote down but seems to be wrong. The tool only accepts P2PKH addresses and my account was created very recently in this kind of format 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy. I'm new to blockchain but I believe that this is a Segwit/P2SH account?
Is there a way I can convert this into a P2PKH address so that I can use the tool?

Which software did you create the wallet or address with?

It was on a Ledger Nano S

What is it that makes you believe that the seed you wrote down is incorrect? (i.e. missing bitcoin?)

The device erased all private and public keys after 3 unsuccessful attempts to enter a pin and now says the seed is invalid when trying to recover the data

If you haven't sent any bitcoin to the addresses generated from your old seed, consider starting a fresh and generating a new seed.

Unfortunately I have BTC on the account

Converting address formats is not feasible without knowing the public or private key(s) used to generate them.
Without reviewing the source code of btcrecover, I can't advise whether you should use it or not. But if you do trust it and decide to use it, consider first generating a new seed and address to immediately send your bitcoin to.
Consider any seed you may recover with btcrecover compromised and no longer secure.


text:
Where to reliably buy Bitcoins via PaySafeCard?
Where to buy Bitcoins in a serious way via PaySafeCard? I do not like to name my account data or credit card data...
I want to use a method to buy safely and anonymously.

I do not think so since I asked for PaySafeCard as well...

@Kutsubato The PayPal part is a duplicate, the PaySafeCard not. I suggest you alter your question and only mention PaySafeCard, to make it a valid new question.

There are also ATM machines, some of them allow to buy anonymously. And there is the possibility to buy privately. Are these working options for you too?

I did so, sorry. ATM does not work for me.

Isn't paysafecard the same thing as a prepaid debit card?

As far as I know, no. It is more like a phone card but for everything.

As far as I know, no. It is more like a phone card but for everything.


text:
Code sample to sign a transaction
I have the 32-bytes double hash of a transaction, a 32-bytes private key, and I would like to sign the hash using the private key.
How do I do that using BouncyCastle (or anything, really), in C# or Java? Can somebody point me to a code sample?

The 32-byte double-SHA256 of a transaction (TxID) is not what gets signed.
Future-proofing note: The description herein of transactions, TxID calculation, signatures and signatures scripts, etc. don't apply to segregated witness.
Let's look at an example with a transaction I created earlier. I called:
createrawtransaction '[{"txid":"0c71ea829dfb117442c1c0d0c492725794d890bbcbcd8234b1108d1b1d4ca2e9","vout":1}]' '{"1PkCAVKjPz1YK7iJwT8xTLxBXR1av8dL98":0.004}'

which created an (unsigned) transaction:
0100000001e9a24c1d1b8d10b13482cdcbbb90d894577292c4d0c0c1427411fb9d82ea710c0100000000ffffffff01801a0600000000001976a914f97df8f593e0056d337c274fd81a163f47a17d3788ac00000000

And then I asked bitcoin-rpc to sign the transaction, and received:
0100000001e9a24c1d1b8d10b13482cdcbbb90d894577292c4d0c0c1427411fb9d82ea710c010000006b483045022100d9a5433c1381b39b7e02b0b0f042990e7c16cfea252b05ccfef2e85c2dab2a6f022057c7def782fe3b0d7e5e0eae277d2a5890844da7d72309817a2dac22a6307c6001210390d78cb0c1d34d4417db7e0a9a9f125a689dc29dc2197a01a5f827a20f870f62ffffffff01801a0600000000001976a914f97df8f593e0056d337c274fd81a163f47a17d3788ac00000000

Here is that signed transaction data again, with the signature and related script data bolded:
0100000001e9a24c1d1b8d10b13482cdcbbb90d894577292c4d0c0c1427411fb9d82ea710c010000006b483045022100d9a5433c1381b39b7e02b0b0f042990e7c16cfea252b05ccfef2e85c2dab2a6f022057c7def782fe3b0d7e5e0eae277d2a5890844da7d72309817a2dac22a6307c6001210390d78cb0c1d34d4417db7e0a9a9f125a689dc29dc2197a01a5f827a20f870f62ffffffff01801a0600000000001976a914f97df8f593e0056d337c274fd81a163f47a17d3788ac00000000
If you look at the unsigned transaction, all of the material before and after that bolded section is identical (aside from one padding byte which turned from 0x00 to 0x62), because only one signature (and associated script) was required to successfully spend the input.
Here's a visual diff between the decoded versions of the unsigned transaction (left) and the signed transaction (right):

You'll see that the unsigned transaction has a different txid (because the TxID is the hash of the full, signed transaction). Additionally, you'll see that the unsigned transaction does not have the scriptSig, whereas the signed transaction does. The scriptSig is the bolded inserted section from earlier.
To get back to your question, signing a transaction requires access to the actual transaction (rather than just the hash), because you need to sign the transaction data itself AND insert the signature into the transaction.
On a side-note, since the signature script is part of the data which is hashed to produce the TxID, the signature can actually be modified to still be a valid signature for the data. The signature signs a hash of other portions of the transaction so those can't be altered, but nothing protects the signature script itself from modifications. Any modification to the signature script which doesn't change the functionality of the signature script changes the TxID without invalidating the transaction.
Say you propagate a transaction to the network which sends Bob 2 BTC. Any peer (including block miners) could manipulate the script signature to appear differently while still validly signing the transaction. While this doesn't allow them to redirect those 2 BTC from Bob to anyone else, this modification does change the TxID of the transaction. If someone were waiting for the original TxID to be propagated across the network, it would appear that the transaction never executed if the modified transaction is included into a block instead.


text:
Stateless bitcoin daemon for server, capable of signing transactions
I am trying to do the following:

Have a daemon running on a server
That daemon exposes an API (Json, etc...)
I can call that API from localhost with:
1: Address From
2: Address To
3: Key for Address From
The daemon creates a valid transaction using the unspent outputs, signs the transaction using the key, and broadcasts it to the network, then forgets about the key.

I don't want the daemon to store the private key (stateless) and sign transactions on-demand. The daemon should be as light as possible (if possible, use less than 256 MB of RAM).
I looked at Bitcoind but it doesn't seem to provide that kind of API, since I either need to setup the wallet with the private key beforehand (not stateless) or build the raw transaction from scratch, and I don't want to have to figure out the outputs to use, format of the raw transaction, etc...
What's the easiest way to achieve this?

I wouldn't want to use any service over a network that requires transferring the private key via API.

Yes, that why I want to run a daemon on my server... Maybe I wasn't clear, but this isn't for public use.


text:
HOW TO SPEND P2SH with Redeem Script Hex?, Already make the transaction but still have some error
I HAVE ERROR "scriptsig-not-pushonly"
on this
0200000001706d9793f75fb0b47fc0ff8f26a6f5ebeb5f06a5fe50e784983705184b060fba01000000683044022065794dfae7320f7ec02ecc387a00ae761ac34c4373fadb896ff59ce284159f5702206625d2cf48aa3dbbd4020694eada7a09b53f22ac5b96c96a3cf438a59b07b82501032c7c95ea81ebe9b5ccc08b41a3eef4d2fea41c6b868794a91254b8a9c1eadedbffffffff02050d00000000000017a914f0a433b3411b7c1812937977bebd25602f55b68f87050d00000000000017a914ad0d8c12bfae54c92cd998d879030e8b8357a7558700000000
The above script has been decoded
Version: 2
Transaction Size: 219 bytes
Lock time: 0
can someone help me to fix this please..
sometimes i have problem with maxburntamount, or stack failed bla bla.
I just have some experiment, to call P2SH transaction with redeem script, my experiment address
https://www.blockchain.com/explorer/addresses/btc/3HU341AbjnD5SzawKtbY66gVczh7QAfFXL

"scriptsig-not-pushonly" refers to the consensus rule that the scriptSig of a P2SH input must only include push operations (see BIP16). Your scriptSig not only includes opcodes other than push operations, but actually fails to decode completely.
Here is the result of using Bitcoin Core's decodescript with your scriptSig:
44022065794dfae7320f7ec02ecc387a00ae761ac34c4373fadb896ff59ce284159f5702206625d2cf48aa3dbbd40206 OP_SUB OP_UNKNOWN OP_UNKNOWN OP_ROLL b53f22ac5b96c96a3c OP_UNKNOWN [error]
After you fix that, you might also want to check the input and output amounts, as your transaction creates more value in outputs (6666 sat) than it spends (1777 sat).

Can you help me to make the raw Hex transcation ? or theres provider to help me create the raw HEX transaction ? because before i use https://bc-2.jp/tools/txeditor2.html to help me making the raw hex transaction.

I got inspired from this https://bitcoin.stackexchange.com/questions/68227/single-signature-p2sh-redeem-script
but i can't learn properly, because i'm just new this thing, not a geniue coding.


text:
How does the unilateral exit process in Ark work?
It's been told here that the cost of a unilateral exit depends on the number of leaves of the shared vtxo tree, which determines the number of transactions one has to broadcast to complete the process.
Why does the unilateral exit require multiple transactions to be broadcasted?

In Ark, all virtual tx outputs (vtxos) are actually outputs on the leaf txs of a binary tree of transactions. The reason for this is two-fold: so that a single person exiting doesn't have to broadcast all the vtxo outputs for all vtxos in the Ark tx and so that in the case of mass exit, the process smoothens out and there is more time for everyone to exit slowly.
You could think of the vtxo tree of a tree of transactions that each have one input and two outputs and like that they form a tree structure. Think of these transactions as transactions that are already pre-specified upfront. They can either be pre-signed or pre-specified using introspection opcodes. This means that all these transactions are valid Bitcoin transactions and could all in theory be confirmed. However, they don't carry any fee and no one has an incentive to broadcast them to the network.
Such a tree might look like this:

In this tree, there are 4 leaves, A, B, C and D; they are actual valid transaction outputs and we will call them "vtxos". Virtual because they are not confirmed yet, but can be confirmed if they would be mined.
Now, for the vtxo A to be confirmed, let's say because its owner wants to spend the money on-chain, all the transactions going from the on-chain output (the top-most "cov") towards the leaf A have to be confirmed on the chain.

Because this is a binary tree, the number of nodes in a branch is log2(n) where n is the number of leaves, plus one for the leaf itself. So that means log2(4) + 1 is 3 transactions to be confirmed.

How can these txs be broadcasted if they have no fees? maybe CPFP?

Yeah that is something still in the design phase. CPFP is definitely the most obvious option. Even though the nature of the timelocks makes it non-trivial. Probably a (ephemeral) fee anchor output would be required if we use pre-signed txs or OP_CTV.

Does one person paying out their vtxo necessitate that other users participating in that batch also go on-chain?

Let's say A and B want to unilaterally exit the ark at the same time, they would try to broadcast the same chain of txs, wouldn't they? How would this be handled?

Let's say A and B want to unilaterally exit the ark at the same time, they would try to broadcast the same chain of txs, wouldn't they? How would this be handled?
--
@altafan I would say that if B waits for A to broadcast, then B will only need to broadcast one transaction

@Murch, no, as per design that is never required. All exits can be done independently, the only effect would be that others might already have part of their branch broadcast/confirmed if they try to, so they will have to pay less fees.

@altafan they are exactly the same txs. So that would be handled normally. Like when two channel partners try to broadcast the exact same tx at the same time. In Ark, only part of the txs would overlap, but there would not be a conflict.
In constructions with a more flexible covenant, like TXHASH, the tx chain might actually be malleable and if one of the nodes goes in first, the other user might have to re-broadcast the leftover part of his branch with updated prevouts.


text:
Decoding a base64 wallet from 2014
I have a Bitcoin wallet file (not called wallet.dat). That has a string that looks like this:

FuXjd1EjroiAURK ... 5zYDsaaP/1FizzJo0IrkwEe6bmN7av0ww==

I omitted the middle part (...), it is 728 characters long, and was created in July 2014. I don't remember what I used to create it.
I've tried this: Convert Base64 Private Key to WIF (both answers), but didn't get an address with any transactions. The way I stored the file makes me believe that it was used.
Since it was from 2014, I don't think it is an HD wallet and most BIPs haven't been developed yet.
How can I decode this?

Based on the information you've provided, it seems like you might be dealing with a backup from a Blockchain.info wallet (now Blockchain.com) from that time period. The length of your Base64 string is typical for blockchain wallets of that era because they can hold multiple keys and metadata.
In addition to Base64 encoding, it uses PBKDF2 and AES to encrypt the keys and metadata within. Should you have the password, the official Blockchain Decryption tool can be used.


text:
How can the next block fee be less than the mempool purging fee rate?
Over the weekend, the Bitcoin mempool size exceeded the default 300mb limit and was purging transactions. Most transactions in the mempool consisted of these large batches/consolidations at ~1.5sat/vb.
What was strange was that the min mempool fee rate for my default node was higher than some of these transactions that were in the next block template.
It didn't look like these transactions were CPFP'd either. Attached are some screenshots of mempool.space illustrating this.
Default mempool purging txs at 1.51sat/vb

Next block template having transactions with 1.49sat/vb
(note there is no "effective fee rate" which is added to txs that are CPFP'd):

2 possible explanations for this:
(1) The mempool min feerate is set at 1 sat/vB (-incrementalRelayFee) above the highest score of transaction(s) evicted (this is anti-DoS / saves work; you shouldn't be able to re-submit what you just purged). See next point for "score," but in the case of independent transactions, it's just their feerate. If the lowest-score transactions in your mempool are 1.1 sat/vB, 1.2 sat/vB, 1.5 sat/vB, etc, evicting just the lowest score transaction would bump the minimum feerate to 2.1 sat/vB and you’d have plenty of transactions sitting below that. Based on what you're describing and the pink-ness of that mempool.space screenshot, a large volume of consolidation transactions sitting between 1 and 2sat/vB makes this explanation quite likely.
(2) Selection is by ancestor set scoring and eviction is by descendant set scoring. It’s possible for a transaction to have a low ancestor score but a high descendant score and vice versa. A very good example is illustrated in this issue (which also describes a proposal to change this fact).

If you run your node with default values, it should never have a transaction that pays less than minRelayTxFeerate (1 sat/vB). So if a transaction with minRelayTxFeerate gets evicted, wouldn’t your explanation mean that the purge feerate would directly jump to at least (2 sat/vB)? How would it then ever be able to get to 1.51? :thinking-face:

How would it then ever be able to get to 1.51? :thinking-face:

The dynamic mempool min feerate decays downwards as blocks are mined and the mempool starts emptying again. This decay is gradual, so it can be 1.51 on the way down.

"If the lowest-score transactions in your mempool are 1.1sat/vb, 1.2sat/vb, 1.5sat/vB, etc, evicting just the lowest score tx would bump the minimum feerate to 2.1sat/vb and you’d have plenty of transactions sitting below that."

So the 1.2sat/vb, 1.5.sat/vb transactions in your example would remain in the mempool, despite the new minimum fee rate being 2.1sat/vb?

Yes. There's no need to keep evicting after you're back within -maxmempool.

Miners are not obligated to include transactions that are in the mempool - there would be no way to enforce this. As long as the transactions are valid, a miner can include whatever transactions they want. These can be at any feerate, do non-standard things, exceed mempool policy limits, etc.
The miner of this block could have just received the transactions out of band and included them in their block.

I understand, but these transactions also appeared on my node's getblocktemplate command. How is this possible, if my node is purging fee rates lower than what they have?
Is it more complex than a simple if (fee_rate < min_fee_rate) then purge?
Note, the images above are not of mined blocks, but the template of the next block .

Oh, I see. Yes, eviction is more complicated than just that. It looks at descendant set feerate.

Makes sense. What's strange is that it those transactions didn't have any descendants (not CPFP'd). It's effective fee rate was 1.49sats/vb. However, these were large consolidation transactions, so I wonder if absolute fee / tx size plays a role?


text:
How difficult is it to invent a new cryptocurrency? (In regards to time, money, technical knowledge, etc.)
Although I initially believed there were only a couple cryptocurrencies available on the market, after some research, I've discovered that there are well over a thousand different cryptocurrencies!...even if a large percentage of these have extremely small market capitalizations. So my question is: What does it take to "create" a new cryptocurrency? More specifically, what degree of time, money, technical knowledge (and any other pertinent resources) is required?
*I apologize but I should have also mentioned: Since I have limited technical experience, I would appreciate a non-technical "theoretical" answer.

"some research" = coinmarketcap.com

quick approach:-
Not that difficult , Just fork a github repo of a smart contract supporting ERC20 token starndard and deploy the contract on main net.
developer approach:-
If you want to make your own crypto currency the easiest way is to learn ethereum smart contract development , most crypto currencies present in market today are build over the top of etherum smart contract. If you have programming experience in javascript or similar languages it will be very easy to start with solidity language used to develop smart contracts.
Also learn about ERC20 token standard which is followed by crypto currencies build over top of ethereum
The ERC20 token standard describes the functions and events that an Ethereum token contract has to implement.

Does using ethereum smart contract development allow for adaptations to the core technology? Such as different block sizes as just a very basic example?

@Shersha Fn Nice!

-1, cause the original request is asking, what it takes in time, money, and technical knowledge to create a crypto currency. Your answer is limited to one specific case (Ethereum), missing out other parameters, and even directs into very specific case of ERC tokens and smart contracts. Your answer looks like a promotion (which is mostly opinion based, what is generally disliked here). Maybe you can extend your answer, to contain information about degrees of time, money and technical knowledge, to create a crypto currency, that is not Ethereum, has no ERC20 token and not solidity?

You can find two types of crypto currencies - Ethereum token based and altcoin (new blockchain). Tokens are relatively easier to develop than an altcoin. The work involved in creating an ecosystem around the coin is also stacked against an altcoin. This would include developing your block explorer, mining pools, testing the code and just regular maintenance. Again all this is subject to the degree of sophistication you desire the final product to have.
Altcoin dev - You can start with forking any of the crypto repositories and customizing it for your specifications. I would say the dev time would range from a week to 3 months depending on the customization. The technical knowledge and cost could follow the same ascending order of the timeline.
Token - You can create an erc20 token and publish it to the ethereum blockchain. You would have to do the crowdsale contracts and payment gateways as well. Dev time can range from a few days to a month at most Technical knowledge required and cost is at a significantly lower bar compared to altcoin dev.


text:
Standard multi-signature transaction BitcoinCore
I created a transaction with a script for a Multi-Signature in the form of

M <A pubkey> [B pubkey] [C pubkey...] N OP_CHECKMULTISIG

It is documented (https://bitcoin.org/en/developer-guide#multisig) that this type of script would belong to the standard transaction types.
When i put that transaction into Bitcoin-CLI via decoderawtransaction, it says:

"vout": [
    {
      "value": 0.00250000,
      "n": 0,
      "scriptPubKey": {
        "asm": "2 <PublicAdress 1> <PublicAdress 2> <PublicAdress 3> 3 OP_CHECKMULTISIG",
        "hex": "XXX",
        "type": "nonstandard"
      }
    },

I then sent the transaction via sendrawtransaction and it is sent, accepted and mined successfully to the Blockchain but it seems to be invisible for my wallet.
Also when i send such a transaction to my BitcoinCore wallet, Bitcoin Core doesn´t notify me about it.
Is there simply no support in Bitcoin Core for that type of MultiSig transactions or am i doing anything wrong?

Bitcoin Core will be default only treat M-of-N multisignature outputs as "yours" (contributing to your balance) if you own private keys to all N public keys. This is to prevent showing something as a balance which could be spent from under you.
If you instead of using a raw multisig output use P2SH the same rule applies, but in that case you're able to use importaddress to mark the outputs as yours regardless of whether you have access to the keys.
Once the outputs are treated as yours, you can use signrawtransaction to fully or partially sign for them.

Ok, shouldn´t it work then with this form?
1 <PublicAdress 1> <PublicAdress 2> 2 OP_CHECKMULTISIG

It should work if both pubkeys are yours (= you have the private keys for them).

That brought me to a follow up question: sharing-ownership-of-coins-via-multi-signature-transactions

You first say you created a script as
M <A pubkey> [B pubkey] [C pubkey...] N OP_CHECKMULTISIG
But then you continue with decode... output
"asm": "2 <PublicAdress 1> <PublicAdress 2> <PublicAdress 3> 3 OP_CHECKMULTISIG"
Are you really using the public keys of the participants or their hex encoded addresses \ pubkey hashes?  It should come up as a multisig type if you're using the actual pubkeys.  Those are 33 or 65 bytes, and start with 02 or 03, or 04 respectively.


text:
How can I make my old wallet.dat work in a newer client?
Im having trouble with my wallet.dat file in the old bitcoin qt client the blockchain won't update because the computer is old and outdated so I'm unable to send the bitcoins that I have in the wallet to another address, so I downloaded bitcoin core onto my other computer and copied the wallet.dat file and replaced it and then in command prompt I rescanned and still nothing, could really use some help if anyone has any idea

when you say "still nothing", what do you mean?  no balance?  no transactions?  be clear, please!

Still no balance

On the old client it said 0.6 btc until I removed the wallet.dat file

So pretty much I need to import my new wallet.dat file into the new bitcoin core wallet

Try to dumpprivkey and import those private keys to electrum.

Sorry I have no idea what dumpprivkeys means could you please explain the process to me, and thank you for helping

It should be possible to do a progressive upgrade and have Bitcoin Core upgrade the wallet file. It is not always possible to go directly from an old version to the newest version. If you were on v0.7.0 then install v0.8.0 (official downloads only!) and let it upgrade your wallet file automatically when you run it. Then install v0.9.0 and do it again, etc until you are on the current version.  I do not know what versions it is possible to skip but if you do them all it will not be wrong. Make sure you keep a good backup copy of your original wallet file.

You may need to export the private key of your old wallet in the old QT client, and import it into the wallet in your new QT client. The steps to do this are:
Exporting the private key of your old wallet, containg the funds. To do this, in your old QT client, click Help > Debug window and go to Console
There, you can use the command dumpprivkey command to export your private key. KEEP THIS SAFE, anyone with access to this key can do whatever they want with your wallet.
Now we import the private key into the new wallet and up-to-date QT client. To do this, repeat the previous steps: click Help > Debug window, and go to Console again. Then use the importprivkey "KEYHERE" command, where KEYHERE stands for the private key you exported.
The client will then scan the blockchain and, if it finds transactions pertaining to your old address/wallet, it will replay them, and you should dispose of your old funds.


text:
What dead simple algoritm can be used for generating checksums by pen and pencil?
I'm holding a course on Bitcoin and blockchain technology. On my agenda I have an exercise where I'm going to let the attendees create their own blockchain on the wall using post-its.
I'm in search for something that would resample Bitcoins proof of work that the attendees could calculate by paper and pencil. I've seen the 0.67 hashes per day however I'm in search for something much simpler.
What algoritms for generating hashcodes, or better for this purpose a checksum, exist that does not require ascii or base conversions? Could you invent something for this purpose?

https://en.wikipedia.org/wiki/Fletcher%27s_checksum

I feel like you are confusing checksums with hash digests.  They are different things.  https://stackoverflow.com/questions/460576/hash-code-and-checksum-whats-the-difference

@Jestin Well if there is a algo for a hashcode that could be computed for this purpose I would be much interested.

@Gustav, a checksum would be simpler for pen and paper...but again, a checksum is not a hash.  It might not suit your purposes.

@Jestin You got a good point anyway, I've clarified my question.

When it comes to doing an easy calculation by hand, you are going to run into a problem.  An important part of a cryptographic hash function is unpredictability.  It is this unpredictability that allows us to use a cryptographic hash function as a proof of work.
For comparison, let's use a simple checksumming method on the alphabet.  Normally, a checksum is used to detect copy errors during a transmission or copy of data.  A simple method would be to count the number of vowels in the message, and append this number to end.  For example:
This message is checksummed

becomes
This message is checksummed|7

A simple checksum like this can be used to check if a vowel as accidentally turned into a consonant, or a consonant accidentally turned into a vowel (not very useful, I know).  If either of those two types of errors were to happen during transmission, the checksum wouldn't match on the receiving end, and we'd know there has been an error.
This mrssage is checksummed|7  <--- the checksum is wrong, so there's an error

This simple checksum is also a hash function, as it maps a larger block of data to a smaller chunk of data.  Obviously, this is a terrible hash function with an extremely high collision rate, but it's a simple enough example to calculate with pen and paper.
Now let's see what happens when we try to use this hash function as a proof of work.  We need to also add a nonce value that can be changed to modify the output of the hash function, without modifying the important part of the message.  I'll use the form message|nonce|hash.  Let's say that someone performing the proof-of-work needs to find a nonce such that the hash digest is greater than or equal to 10.  For example, the following would satisfy the proof-of-work:
This message is checksummed|aaa|10

When the message is hashed (checksummed) together with the nonce, we meet the proof-of-work.
The problem, however, is that our hash function is non-cryptographic, and therefore reversible.  Starting with our target value of 10, and our message of This message is checksummed, we can perform the checksum on the message and then do simple arithmetic to generate an acceptable nonce.  There is no unpredictability in the system.
If you use some sort of pen and paper hash function, you are almost certainly going to run into this problem.  Likely, those attending your class will see right through it, and not understand the purpose of the proof-of-work.  In the case of this example, it would be pointless.
If you choose to use a method like this, it is probably worth explaining to your class the significance of cryptographic hashing functions.  Otherwise the entire concept of proof-of-work doesn't make sense.

Very good points. Your thinking in vowels is on the right pen & paper-level needed. Aside from the missing avalanche effect I'm thinking of elaborating the algo by just doing count_vowels(message)  + count_consonants(message) + length(message). By the way if the attendees hack or forge a block that would be a interesting scenario to speak about and doing a comparison with how bitcoin works.


text:
Is there a chance to return all of the lost money invested when the chart goes back up?
Let say, for example, I invested $3 to buy 21 TRX (Tron Tokens), usually a token under Ethereum platform but still working the same as other altcoins when the value goes high, where the price is around approximately $0.14 per TRX. A week later, the token price is raised to $0.21. the following days later it dropped back to $0.14 and later $0.13 which is below the total amount of money I've invested.
Here's the worst case scenario: the price of TRX dropped to $0.001 after several days and definitely all of my investments are gone (30 TRX is equivalent of $0 instead of higher than $3 in return). Take note that this token/altcoin is legit and while taking better changes to improve while the investors are still counting on it. Now, the price of 1 TRX is now suddenly jumped to $1 after another few days.
The question is this: is my $3 invested after couple of weeks will be dropped to $0 and still $0 even after when the price of token drops to $0.001 and raised it back to $1 or not?

Your math doesn't make sense - if the price of TRX is $0.001 then the value of 30 TRX is $0.03, not $0.  But regardless, unless this token works in some very unusual way, you still have 30 TRX, no matter what their value is at any given moment. If the value later goes up then you can sell them for whatever you can get, and maybe turn a profit.  (Big "if", of course.)

@NateEldredge I see. What I'm thinking is that...let say you invest 30 TRX since the price of 1 TRX is $0.14. Next, the price of 1 TRX drops to flat $0, then the total no. of amount is 30 TRX = $0. When it raised the price per 1 TRX is $1, is 30 TRX is still equal to $0 or not? What is the way to prevent form losing your money you've invested when preparing to fly to the moon?

haven't seen any currency falling to flat 0, but if this happens, your math is correct, then your 30 TRX will be 0. However, if at a later time the price goes to 1 dollar per TRX, then you can offer your 30 TRX, and get the 30 Dollars for it. Leave the conversion rate of dollars aside, think only in the TRX as such.

As @NateEldredge pointed out, you still have 30 TRX, no matter what their value is at any given moment. If a cryptcurrency drops to flat $0, then it has gone bankrupt, and is unlikely it will be revived.

@pebwindkraft " Leave the conversion rate of dollars aside, think only in the TRX as such " Then nothing to worry while hodling. The value is still equivalent.

I believe this question should be closed because it is about basic arithmetic and finance, not specific to cryptocurrencies.

The value of TRX relative to the dollar fluctuates, as do all cryptocurrencies.  Whatever the price of TRX relative to the dollar when you sell TRX is the dollar amount you receive no matter what happens to the price between when you acquired TRX and when you sell it.

Is that mean that if 1 TRX drops to $0, then it is $0; and when the 1 TRX raised back from $0 to $1, then the value of 1 TRX is now $1? Just relative, no permanent losses.

Correct. If you don’t sell your TRX when it’s value is $0, then you haven’t lost any money. This is an unrealized capital loss. If you wait for it to climb back up to $1 and then sell it, you have $1. If you paid $0.14 for 1 TRX initially, you made a profit of $0.86 known as a realized capital gain.

Say you buy 1 TRX for $0.20 on monday and on tuesday the value of 1 TRX drops to $0.01. If you sell that 1 TRX on tuesday, you will receive $0.01 in return. So you lost $0.19.
Let's say you choose NOT to sell on tuesday and hold on to that 1 TRX you bought on monday for $0.20. Suddenly the price goes up to $1 for 1 TRX on wednesday. You make your move and sell that 1 TRX and receive $1 in return. Your profit is $0.80.
The price in the middle (tuesday) doesn't matter. It's just the buy price (monday) and the sell price (wednesday).

So there's no loss, even if set to flat $0 before raising it back to higer? Only equivalent whenever it changes before selling?

How old are you, David? You shouldn't be in this crypto space.

I'm 27. I started crypto gaming since 4 months ago.


text:
scammed by a scammer
First of all, this is to bring awareness of how an attacher may gain access to a persons' Blockchain Wallet:
 i hope this never happens to anyone else but it probably will. i am quite new to bitcoin, like probably a month. I feel stupid, no one need remind me.
what happened is this:
 i was on fb asking questions about a transaction i did to a third party that was pending for like 2 days, and the other person still hadnt seen it yet in their account so i was worried.  so i was asking about this happening etc.  and a person on fb commented it wasnt unusual to take a while for transactions to process.  so start private messaging, asking all sorts of questions. says he works for blockchain. And then he says this" blockchain wallet is starting to do mining with the extra funds in a wallet but it is only available in certain countries, not in the us yet, due to regulations. so we talk on, he says he can set up a new blockchain wallet to also do mining with the extra funds even if i live in the states.  then if i want i can fund it. so i create the wallet with no btc in it, and send him the identifier and pw. he was supposed to do some settings to it to access the mining aspect,, and i log back in, change the password,,  and fund it, i see the balance in the new wallet and after few seconds balance goes to zero.  he says that is because it is now in the mining side of blockchain. then he says, add more btc to see what the proceeds are from the mining.  i am starting to realize right then i had been scammed.  he kept saying no, just add more btc to see the balance, etc.  it went on like that for a while. i was out a few hundred dollars. what I think what he did was sink his smart phone to the account and it stayed sinked to the account, even though i changed the pw.  or perhaps there was some crypto-key he accessed and was then able to take the money out. i still dont really know. but i think BLOCKCHAIN Wallet should plug that hole !  so it doesnt happen to more people...  so i have changed a bunch of my passwords, etc, hoping that's the end of it. i had my cellphone listed in the verify section etc. so i went in and put in another number hoping that stops anything there. after this, i really had to re-think bitcoin and how easy it was to get scammed. i would say i was very tired, been working some long hours, and was worried about the other transaction going thru. i know there is no way to get it back, just have to take the lesson, but i want to make sure there are no other doors for this guy to walk thru since he got that information. also, he would have had the private key off the log in and just got it that way somehow.. Something Blockchain could do that would have prevented this: Not to allow more than one incidence of the wallet being open at once, or Notifying the user when more than once incidence is Open.
 Has anyone else been scammed , please share what happened  ?

Yep, you got scammed all right.  Sorry to hear about that.  As I suppose you have realized, everything the guy told you was total nonsense.

perhaps there was some crypto-key he accessed and was then able to take the money out.

I think that's exactly right.  Blockchain.info lets you (i.e. the person with the password) retrieve and back up the private keys and wallet seed for the addresses in that account.  Having the private key for an address always allows you to spend money received by an account; if you have the private key you don't need any other passwords or anything else.  Keeping a backup of the private keys guarantees that you will have access to all funds received in that account, now or in the future, even if you forget your password, change it to something you don't know, or if the blockchain.info site quits working.
Of course, when someone else has the password and uses it to get the private keys, they get this same power, and can spend the coins even if the password is later changed.

i think BLOCKCHAIN Wallet should plug that hole ! so it doesnt happen to more people

I don't think they should, since as I mentioned above, if used properly, it's not a hole, but a safety feature.  One of the things that many people like about Bitcoin is that it's decentralized - your control over your funds is not dependent on any one company or government.  Having backups of your own private keys is a big part of that.

so i have changed a bunch of my passwords, etc, hoping that's the end of it. i had my cellphone listed in the verify section etc. so i went in and put in another number hoping that stops anything there

Caution.  The scammer still has the private keys, so he still has the ability to take out any further funds you might put in that account.  As you saw, changing the password won't help with that, nor will the two-factor authentication.
The best thing to do would just be to never use that blockchain.info account again.  If you still want to use the site, make a brand new account.  (There might be a way to reset the private key - I am not sure - but I would be reluctant to try that unless you are sure you know what you're doing.)

Ok, but shouldnt the private key be somewhere else then on the front of the log in page for all to see ?   perhaps keep it safely tucked away.   anyone walking by, a spouse, child, etc, can bring up blockchain and get the key, it is right there on the log in screen.  or is that supposed to changed to a username once it is copied and safely tucked away..

or is the wallet ID that is used to log in with, different from the private key that someone can use to take btc out of an account

Yeah, the wallet ID and login are not the same as the private keys.  I just made a test account to see how blockchain.info does it.  The master private key is encoded as the "backup recovery phrase".  You can find it in the Security Center menu; the phrase itself isn't shown until you have clicked through several confirmations, and only 4 of the 12 words are shown at a time.  It's certainly not "on the front of the login page".

ok, so you would guess he copied down those 12 words and that is how he regained access.  i just wasnt thinking yesterday.   i was aware of them. but still,  that would give many people access.

@lightfoot: Yes, exactly.  It's true that access to those words is a powerful privilege, and so it's quite important that you don't share your password and that you log out when leaving your computer.  But that's good advice in any situation.

That's why it is important to "backup phrase" ASAP after creating an account, because once backed up and the recovery phrase shows as Verified. No one can view seeds again.


text:
How can I enable testnet4 in Bitcoin Core 28.0?
https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-28.0.md#testnet4bip94-support released.
Is it possible to enable testnet4 via bitcoin.conf? How?
Right now in my config - chain=test and its works with testnet3

You can set Bitcoin Core to run in testnet4 mode by putting chain=testnet4 or testnet4=1 in the configuration, or by using equivalent command-line options (-chain=testnet4 or -testnet4).
This is contrasted with the options available for testnet3: chain=test, or chain=testnet, or testnet=1 (and equivalent command-line options -chain=test, -chain=testnet, or -testnet).

Thanks you for the answer

I also had to change section header [test] to [testnet4] in bitcoin.conf to properly enable my rpcbind config


text:
In Bitcoin Core, are blocks sent in parallel or in series?
Are blocks sent in parallel or in series?
I would also like to know about the implementation part of Bitcoin Core.

Blocks are downloaded in series from a given peer, but a node can download blocks from multiple peers at the same time, effectively downloading blocks in parallel. This parallel downloading is not about downloading different parts of the same block from different peers, but rather downloading different blocks from different peers.
This design allows a node to download the blockchain more quickly, as it is not limited by the upload speed of a single peer. It also adds a layer of redundancy.
Despite the parallel downloading of blocks, they must be processed serially. This is essential for the node to maintain accurate information about the existing unspent transaction outputs (UTXOs) and to verify the validity of transactions.
The actual implementation of this process in Bitcoin Core is quite complex and involves various aspects like handling timeouts, validating blocks, and so on. You can review the actual code in the Bitcoin Core GitHub repository to get a deeper understanding.
You may also check the P2P Network part of Bitcoin Developer site - see the explanation for Block, GetBlocks, GetData, GetHeaders messages, that are involved when blocks are sent between nodes.

How does a node send blocks to adjacent nodes? Does it upload blocks to multiple adjacent nodes simultaneously? Or is it a sequential transmission implementation where the node sends the block to one individual, and after that, to the next node?

@masuda Blocks are sent to peers when they ask for it. If multiple peers ask for it simultaneously, a node can send to multiple at the same time.

Do you know in which file of Bitcoin Core this is implemented?

@masuda net_processing.cpp and net.cpp primarily.


text:
How can I cheaply consolidate P2PKH outputs?
I have thousands of UTXOs that were created for experimental purposes back in 2016, programmatically, using P2PKH transactions, each generating hundreds of 10K-ish sat outputs.
Since these are now worth a few thousands $, I'd like to consolidate these outputs (and retrieve them to some wallet for convenience).
However, given the current fee market (on avg, above 50sat/vB, for a while now), each transaction I attempted to build turns out to be super heavy and hence requires paying fees that amount for more than 60% of the total value transacted (or it'd be stuck in the mempool forever).
As far as I understand, because the inputs all have P2PKH scripts, there is no way to use SegWit, Taproot, and so on.
Any suggestion on how to handle this situation?
Thanks!

Related: https://bitcoin.stackexchange.com/q/80213/121614

There really is no better answer than "wait for fees to come down". That might not be the most satisfying answer, but fees were below 2 sat/vB only a month ago, and the vast majority of transactions currently sitting in the mempool pay no more than a much more pleasant 12 sat/vB (see mempool.space's fee distribution chart).
Every output created has a predetermined (minimal) spending weight, which for P2PKH is 147 vB (assuming the signature is grinded to 71 bytes). For P2WPKH it's only 67.75 vB, but as you correctly understand, that doesn't make your pre-SegWit outputs any cheaper to spend. Since a transaction's fee is the product of its weight and fee rate, and there's nothing you can do about the weight, your only option is to set a low fee rate.

Slightly unrelated theoretical question: Since all these outputs were created using a HD key (non-hardened), wouldn't there be a way to leverage this cryptographically speaking, that is, signing the tx globally with the Master key (parent node) and somehow embed the root derivation path root together with corresponding master pubkey, in the transaction? I understand this is not currently possible with P2PKH, but is there anything like this?

@nakwa Bitcoin transaction inputs require a signature per UTXO spent today. There does exist research into cross-input signature aggregation, which could one day permit spending multiple UTXOs with a single signature (even if they were created with distinct root keys, FWIW). You'd still need a separate input per UTXO though (just not a signature per input), so the cost savings for this top out at ~20% or so.