text:
Are there internal 1sat invoices in LND?
Every day I find several (like 3) amount=1 sat invoices in my lnd's listinvoices. These invoices have an empty payment_request, a zero expiry, an empty description_hash etc. Is this kind of a health check?
Example (confidential stuff repl by xxxx):
{
            "memo": "",
            "r_preimage": "xxxx=",
            "r_hash": "xxxx=",
            "value": "1",
            "value_msat": "1000",
            "settled": true,
            "creation_date": "xxxx",
            "settle_date": "xxxx",
            "payment_request": "",
            "description_hash": "",
            "expiry": "0",
            "fallback_addr": "",
            "cltv_expiry": "13",
            "route_hints": [],
            "private": false,
            "add_index": "xxxx",
            "settle_index": "xxxx",
            "amt_paid": "1000",
            "amt_paid_sat": "1",
            "amt_paid_msat": "1000",
            "state": "SETTLED",
            "htlcs": [
                {
                    "chan_id": "xxxx",
                    "htlc_index": "199",
                    "amt_msat": "1000",
                    "accept_height": xxxx,
                    "accept_time": "xxxx",
                    "resolve_time": "xxxx",
                    "expiry_height": xxxx,
                    "state": "SETTLED",
                    "custom_records": {
                        "xxx": "xxxx",
                        "xxx": "xxxx=",
                        "xxx": "xxxx"
                    },
                    "mpp_total_amt_msat": "0",
                    "amp": null
                }
            ],
            "features": {
                "9": {
                    "name": "tlv-onion",
                    "is_required": false,
                    "is_known": true
                }
            },
            "is_keysend": true,
            "payment_addr": "xxx=",
            "is_amp": false,
            "amp_invoice_state": {}
        }


text:
Destination in WoS invoice is not WoS node
When I create an invoice in Wallet of Satoshi / Android, and lncli decodepayreq --pay_req=lnbc2 the invoice, there's a destination
{
    "destination": "0324ba2392e25bff76abd0b1f7e4b53b5f82aa53fddc3419b051b6c801db9e2247",

That's not the WoS node, it's a node called kappa.
Why is that?

Could it be that WoS uses multiple nodes to manage their customers' funds, and "kappa" is just one of them?

Then I would expect the ppm to be zero, but it's 500?

Or is it kind of hidden income model?

source: Stack Exchange

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

sort: votes


text:
Calculate total assets in a lnd
How can I calculate my total assets in a lnd? Something like the sum of "wallet confirmed", "wallet pending", "channels local balance", "channels pending local balance" etc.
But still, there are some voliatile amounts "locked" in commit_fee reserveres.
Without that sum, I can never make out my income (because it's dust small).

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


text:
If you "only" have to pay taxes when you sell/spend Bitcoin, why does the "boating accident" thing exist?
I keep hearing of people who "lost all their Bitcoin in a boating accident".
But if simply holding Bitcoin doesn't cost you anything -- you only pay when you convert to fiat or spend the Bitcoin -- why do they want to make everyone think they have lost their coins?
And what if they then want to spend some? Then how do they explain that "boating accident"?

If you are known to own some bitcoin, then you might be expected to pay taxes at some point in the future, according to whatever tax laws you are subject to.
But if you outright lose your coins, then you probably won't be expected to pay those taxes anymore, as you 'won't be able to spend the coins in the future'.

This is more of a frame-challenge than a direct answer:

you only pay when you convert to fiat or spend the Bitcoin

I don't think it's nearly that clear. For the longest time, there was little to no official guidance on how Bitcoin would be classified as well as what sort of documentation and reporting would be required. Even now as regulators are starting engage with the subject, many governments have vastly diverging views on how Bitcoin should be regulated—in some countries you even get differing guidance from various institutions of the same government.


text:
Generate BTC Private key from user string input
I am looking to generate a Bitcoin Address from an user input text (like the good old days Brainwallet).
User input a "Text string" and based on this text string generate the corresponding Bitcoin Address. My google search lead me to NBitcoin and to this post: Generate address of 'private key' from user input
The user SVVC asked the same question got a reply from Prayank with a little code snippet but here I am stuck because the snippet didn't work and the Debugger gave me an Exception Unhandled "System.FormatException: 'Invalid hash of the base 58 string"
Anyone have an idea?
Here is my code in VisualBasic .Net with NBitcoin
Dim pk As String = "LoveIsTheKey"
Dim bitcoinPrivateKey = New BitcoinSecret(pk, Network.Main)
Dim legacy_address = bitcoinPrivateKey.GetAddress(ScriptPubKeyType.Legacy)
MessageBox.Show("Legacy Address : " + legacy_address.ToString)

Thanks guys

”Like the good old days Brainwallet” - you mean when users were encouraged to create inherently insecure wallets, leading to an irrecoverable loss of funds? I assume that you won’t be taking the user input as the sole source of entropy for privkey generation?

There will be no user to my program I just want to make it for myself for research purposes.

Do you have any idea?

i upload a github repository. it takes text as input to generate private key, public key and segwit/bech32 address.
https://github.com/drParadox312/Bitcoin_Key_Generator_From_Text_Input


text:
What is the latest bitcoin script connection string operation code?

What is the use of the updated op_success operation code?

For now (or even post Taproot activation in November) they have no use and shouldn't be used in any scripts. However as the excerpt above says, making multiple previously disabled opcodes OP_SUCCESS in the Taproot soft fork means new opcode functionality can be easily added in future soft forks post Taproot. Old clients that don't update for future soft forks will automatically treat scripts with these new opcodes as valid and hence they won't be forked off the network by new clients validating the use of these new opcodes.
Some new opcodes that are being considered for future soft forks are OP_CHECKTEMPLATEVERIFY, OP_CAT, OP_CHECKSIGFROMSTACK etc.
Other upgradeability features in Taproot (BIP 341) are discussed here.

Thanks @user253751. Updated.


text:
How to exchange crypto assests in italy without a bank account
I don't have a bank account, I get paid at my job in my postal account which I can't use to buy or sell crypto.
I use bitcoin ATMs around Italy.
Some time ago I did something dumb, really dumb. I bought doge and no atm buys it...they only buy litecoin, bitcoin,bitcoin cash, ether, dash and some other minor stuff...
Is there any website that doesn't require a bank account were I can simply exchange my doge into bitcoin?


text:
Bitcoin could work in principle with pen and paper and carrier pigeons. Could it?

Bitcoin could work in principle with pen and paper and carrier pigeons
bringing the result of computations-by-hand back and forth to a public
square: the ledger would work, but its intended use case as money
likely would not.

Source - Only the strong survive on page 7 of 48
Isn't one of the main properties of bitcoin its immutability? If so, how is it possible for it to work with pen and paper, since then it's not immutable? Can anyone explain this quote in different terms? What would mining even look like? Solving sudoku puzzles by hand?

Isn't one of the main properties of bitcoin its immutability?

Yes. It is probabilistically immutable. In theory there could be a re-org right back to the genesis block but the probability of this happening is effectively zero (but not exactly zero).

If so, how is it possible for it to work with pen and paper, since then it's not immutable?

In a similar way this would be probabilistically immutable. To do a x block re-org you would need to solve x proof of work challenges or sudoku puzzles. It does rely on the public square though which brings some centralization into it. With Bitcoin, transactions, blocks and proof of work solutions are broadcast globally with no single central point of failure. If someone dropped a nuclear bomb on the public square in this example that might kill this pen and paper solution.

What would mining even look like? Solving sudoku puzzles by hand?

Effectively. You wouldn't want to calculate outputs from hash function by hand so solving a sufficiently hard sudoku puzzle (with the dimensions of the puzzle adjusting depending on the number of sudoku puzzle solvers) to give you the ability to present a newly mined block could be the way to do it.
So in theory this scheme could work but it already relies on a central public square so in practice you would ditch this scheme and use more efficient centralized schemes.

As @RedGrittyBrick says you wouldn't be able to calculate digital signatures by hand so you would need to fall back to handwritten signatures.

The immutability being talked of is that of the list of transactions which we call the blockchain.
This immutability does not arise from the medium on which the list of transactions is recorded. It is recorded on media whose contents can easily be altered.
The immutability is an engineered property that I would say is based mainly on two features of Bitcoin:

The use of digital signatures.
The "proof of work" concept.

Since these are mathematical in nature, their properties depends on mathematics, not on any specific storage medium.

In practice, Bitcoin could not be run on pencil, paper and human brainpower because the mathematical operations are too intensive for human convenience and desired timescales.


text:
"Do not buy hardware wallet from a 3rd party seller" security tip, does it apply if authorized in the official website?
"Do not buy hardware wallet from a 3rd party seller" It's a well-known security guideline for newbies. I wonder though, does it apply for 3rd party sellers that are listed on the official website of the product? E.g. Ledger reseller? If not safe, and you still decide to buy from there, how can you ensure the device hasn't been tampered with?

For Ledger, you SHOULD be ok buying from an authorized reseller, although it is usually recommended to buy from Ledger itself directly.
Ledger Live will tell you if it is a genuine device or not.  Also make sure you generating a new key when you first use your device.


text:
Possible for 2 transactions from the same address within the same block?
I am not talking about double spend. I am referring to 2 diff txns
For example, Alice has 10 btc. She sends 3 btc to Bob and 4 to Tom. Is that possible in the same block if she has 2 UTXOs with each UTXO >= 4 BTC? UT
What if she only has 1 UTXO of 10 BTC? will it be possible to include both txns in the same block?

In addition to Prayank's answer, ...
Alice can pay both Bob and Tom in a single transaction with three outputs (Bob, Tom, change) and using either your two input UTXOs example or just your one input UTXO example.
The inputs just have to sum to more than the sum of the outputs. So inputs of 3+4 or 10 or 1+3+10000 all work. The amount of change returned to Alice varies.
Alice can also construct, starting with only one UTXO, two transactions that can be put into the same block. This is because a transaction can use as an input a UTXO created by an earlier transaction in the same block.


text:
Repeated corruption issue with bitcoind
I'm trying to index the entire chain for spent P2PK inputs for this program I'm writing, and whenever I get to this transaction - 7a8394fd438d9fbe6b36ce38e5b0ca65037f864d1007236775ac3532b886ebe1 - I get this error:
Error: JSON-RPC error: RPC error response: RpcError { code: -1, message: "Fatal LevelDB error: Corruption: block checksum mismatch: /mnt/Node/bitcoind-mainnet/indexes/txindex/490706.ldb", data: None }
I've already tried the -reindex option. I'm not sure what else to try to recover from this, and I'm not sure what caused it. I'm going to reset the directory and see if that resolves the issue, but I'm not sure how it could be prevented in the future.
This is on Arch Linux with the datadir kept on an ext4 SSD.

Are you sure that after the reindex, you get a failure at exactly the same transaction?

Yes, however I later noticed that there was a block checksum error with leveldb. I'm currently doing an IBD on a different disk, in the hopes that it might just be a hardware issue.

The leveldb block checksum mismatch still happens. This time during IBD. I'm going to file a bug report for this on Bitcoin Core.


text:
mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) on wrapped SegWit input
my teammates and I at Ducat Protocol are trying to debug a transaction that spends a wrapped segwit input, and this one has stumped both myself and @btctechsupport and the entire team:
02000000000102e01170a477e12a8a980bd3465ef4fd13f68c7a63ef9c8fc7e7b22f8ba3d4a1640300000000ffffffffed8c82cae1818870b434de81176491578a4aaed208cc6ec1bb511ec3a625d594000000001600141885d24191efe93d320c438d1bc6f9d341249d8fffffffff041427000000000000225120da4ec4d4c127e1795120b504bd777e42961a406a2b0d9d6e860ce3e6e26599e4d0561e0000000000225120d307434f7fcc9539aea10417fdc07c264085b9b22a194c0c8004814d338ad0071027000000000000225120c85cf7461f01acbe66729deb067b829ff5587e9c2fc300d88b6eb614983e25b400000000000000000b6a5d0800b89c5d01ce290201404291859cb2ba98a36f8db06c49c9530ac19d46affccc85981c3a779a58261ead1680323e22103db1a9569bcb86c546868a4efe479bee3136d64bdf85062319f80247304402200b5721b3f801ab777981e3aa08140d38cebb415a587ce987095f237e4bfc0c6d0220295fd225d0386afd4314fcb6448db4bc960f87cc8505a9777aeded37c18628b9012102d94b9aaf75bfc25472a369dcb7060cfabe10375ab6cb533c995941f12a48d4bb00000000

We get this from the RPC API:
mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element)
There seems to be some standardness rule that Bitcoin Core isn't pointing to exactly that tells us what the issue is. We've read BIPs BIP-49 and BIP-141 in order to double-check that we're doing everything correctly and things look about right, so it's not quite clear what we're doing wrong.
We're also asking Ben what version of Bitcoin Core he's running on MutinyNet, so please bear with us while we get that.
Thank you for your time.

This error generally means that the signature is just invalid (so the implicit OP_CHECKSIG in P2WPKH evaluation puts a 0 on the stack, which is considered failure, but not a script execution error).

Thank you, Pieter! Will keep investigating...

Looks like this is coming from Bitcoin Core v25.


text:
Electrum open source mobile wallet
I am looking for open source mobile wallet which supports electrum protocol.
Already found 2:

https://github.com/coreyphillips/moonshine
https://github.com/ACINQ/eclair-mobile

But first one looks buggy and unfinished.
Eclair-mobile is too bound to its back-end Eclair core part, which is written in Scala. Sorry but for me its overkill.
Can community recommend any other OSS Electrum mobile wallets?

Electrum runs on mobile too :P

when I say Electrum I  mean ServerSide API Electrum https://electrumx.readthedocs.io/en/latest/protocol-basics.html

Yeah, and Electrum connects using that protocol. Why are you using the word wallet, if you are not looking for wallets?

There many wallets which are same as Electrum(you mentioned) supports Electrumx/Electrum on server side. Moonshine is one of them. I wanna find out others.

There is an Electrum branded mobile wallet with source code:
It's OS with a MIT license.


text:
Bitcoin Core not updating to latest block
I have Bitcoin Core 24.0.1 64bit on Windows 10 which is seemingly stuck on updating with the latest transactions. It seems also that I have port 8333 blocked (checked on https://canyouseeme.org/), but not sure if that's even relevant. I am receiving "outbound" traffic in the peers-view window. I tried chaging the port to 8332, 80 and other random ports in the bitcoin.conf file but to no avail. I also tried deleting the peers.dat file but also without any impact. This used to work last year, I would appreciate any info on how I can get this updated so I can transfer by BTC.

How long has it been like this?

Where did you download Bitcoin Core?

@PieterWuille - like this since November, like in the screenshot. I didn't notice until recently. I have the app open on WIndows startup

@Murch I just updated to the newest version to see if that would help, I got the updated .exe file from https://bitcoincore.org/

Can you check to see if 8333 is being used by bitcoin core?   Do a netstat -ab.   Have you checked for adequate diskspace?

Thanks for the suggestion. Disk space is not an issue, the disk that Bitcoin core is writing to has over 120GB of free space left. Upon inspecting the netstat result, bitcoin-qt.exe is connecting to ports 80, 8334, 61472, 61473, 61474, 61475 initially but later it does establish connections to concrete IPs with ports 18333 and 8333

I suggest publishing debug logs for inspection. Additionaly, there may any of the options fix an issue:

-reindex (rebuild chain state and block index from the blk*.dat files on disk)
-datadir=<dir> (specify another data directory),
-loadblock=<file> (Imports blocks from external file on startup).

There is the information invoked like this: .\bitcoin-qt.exe --help

An outbound-only node is more than enough to sync a node. No need to fiddle with that.
There are two steps to rebuild your chain. First, you need to sync with other nodes to get the latest header. Then, bitcoin-core reads all your local *.blk blocks and rebuilds its database.
You seem to be stuck at first stage and unable to sync with other nodes. I'd suggest to check on any firewalls or other network configuration that might block this process, as well as reverting to defaults on bitcoin-core, regarding network configuration.
You can have port 8333 closed (or any other inbound port for that matter) and won't have any issues while syncing.


text:
Rpc work Queue Exceeded
I am trying to make rpc calls to an Rpc Interface "listunspent". So i get this Error: ESOCKETTIMEDOUT. I checked the bitcoin node debug file and saw the error message "Depth queue work exceeded". I have added this option rpcworkqueue= settings to the bitcoin.conf file.
Here is my bitcoin.conf file
prune=550 port=8333 rpcworkqueue=1000 rpcuser=user rpcpassword=userpass zmqpubrawblock=tcp://127.0.0.1:29000 zmqpubrawtx=tcp://127.0.0.1:29000 zmqpubhashtx=tcp://127.0.0.1:29000 zmqpubhashblock=tcp://127.0.0.1:29000

The following is the error response i get while trying to make rpc calls from my node app
{
"status": 500,
"error": {
    "name": "RequestError",
    "message": "Error: ESOCKETTIMEDOUT",
    "cause": {
        "code": "ESOCKETTIMEDOUT",
        "connect": false
    },
    "error": {
        "code": "ESOCKETTIMEDOUT",
        "connect": false
    },
    "options": {
        "auth": {
            "user": "user",
            "pass": "userpass"
        },
        "uri": "/",
        "baseUrl": "http://127.0.0.1:8332",
        "timeout": 30,
        "json": true,
        "body": {
            "method": "listunspent",
            "params": {},
            "jsonrpc": 1,
            "id": "rpc-bitcoin"
        },
        "method": "POST",
        "simple": true,
        "resolveWithFullResponse": false,
        "transform2xxOnly": false
    }
}

}
Any help to solve this?

Something is trying to make too many simultaneous RPC requests.
Running parallel jobs making RPC requests, I've noticed that only 2 requests can be made simultaneously for certain things, and even then it occasionally threw error: Server response: Work queue depth exceeded.


text:
GUI won't open on rapsberry pi, Vnc viewer
I am trying to run bitcoin core on a raspberry pi. Through vnc viewer.  When I try to run bitcoin-qt I get
Qt.qpa.xcb: xkeyboard extension not present on the x server
X11 connection broke error 4, did x11 server die?
I'm pretty new at all this, any advice to move forward?

I don't have a solution to offer but maybe the following will help you move forward?

any advice to move forward?

Assuming the Pi is running Raspbian with X11 installed, I would try ...

Connect a screen to the Pi using the HDMI connector, connect a USB keyboard and see if the program runs OK locally on the Pi.
Install an X11 server (the nomenclature may seem backwards here) on a Windows PC (or Mac etc) such as Xming and see if it runs xclock ok then see if it runs bitcoin-qt
Check that VNC can run other X11 apps OK (e.g. xclock etc). Publish details of the VNC/network etc configuration here (or maybe in superuser.com) to get better advice.

From: https://answers.ros.org/question/350143/ros-via-vnc-xkeyboard-extension-not-present/

I got through this issue by lots of googling. I use this set of
instructions: https://www.digitalocean.com/communit... but instead of
installing:
sudo apt install tightvncserver
I used
sudo apt-get install tigervnc-standalone-server Which solves the
immediate problem. I can run ROS, various qt utilities, and turtlesim
pretty well. However, getting rviz and gazebo running breaks. I dont
know if it's simply matter of performance of the particular node I
have on digital ocean or something more fundamental with the
configuration.


text:
how do I create and encrypt a dogecoin wallet?
I've looked at the dogecoin wiki, but don't see any resources explaining how to actually create a wallet and encrypt it.
I'm running dogecoin-qt on Linux.
Under "much receive" on the GUI, I can add addresses.  But there's no option to encrypt which I see.
The "wow" tab says wallet, 0.000 doge (which I expect).
Where is the wallet info to read?  Is it encrypted?  How do I encrypt it?
I can find the file itself well enough:
thufir@dur:~/dogecoin$
thufir@dur:~/dogecoin$ locate wallet.dat
/home/thufir/.dogecoin/wallet.dat
thufir@dur:~/dogecoin$

but I'm trying to use the GUI.

Try seeing if there is an menu item named [encrypt wallet...] in your [settings] menu.
It should open up a new screen that allows you to enter a password or passphrase to encrypt your wallet with.

no menu on my qt version

The encrypt option should be there. You miss-configured something in your build, recompile and try again.

possible duplicate of How can I keep my wallet secure? First answer tells you how to do this with truecrypt instead of the built-in way. Could be useful to you if your menu isn't working for whatever reason.

You can pass commands to the qt in command prompt /path/to/dogecoin-qt <command>
or the qt debug console (help>debug, then the console tab),
To encrypt your wallet pass the command encryptwallet <passphrase>
This will close the client, once you open it again you will have to enter your password before being able to send a transaction or sign a message.

I can't confirm this solution, but sounds good.

The encrypt option is under settings.

I don't have a settings option -- no menu.  (well, I would have to recompile the client, but that was the problem.)

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


text:
minimal transaction for gandi.net
I'm registering with a few different bitcoin sites.  I notice that, at least according to older questions, paypal isn't generally accepted.
Is there a simple way to buy a few US dollars worth of bitcoins?  The purpose is to register a domain with gandi who have a $10 min for paypal.  Some domains are quite inexpensive:  .pw is less than one dollar.
Or, would I simply end up paying more in transaction fees and time than its worth?  For security and volatility, alone, I don't want to hold on to bitcoin.

It's best to read through the steps detailed on www.bitcoin.org, they also link to a list of exchanges. A lot of exchanges will require ID verification which may be more hassle than you're willing to go through. But some exchanges do not for smaller amounts. Or you might try to find an Bitcoin-ATM near you.
Exchange and transaction fees will likely be lower than PayPal. And you may lose or gain a bit of value over any Bitcoin leftover in your wallet. Since price fluctuates, you probably want to buy a little more bitcoins than you really need, to make sure you can fully pay the domain name.

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


text:
What is the purpose of BIP32 derivation paths in PSBT?
Does the wallet software use the Bip32 derivation paths to generate the partial signature map?

The PSBT comes with the witness script. The witness script contains derived public keys with no information about their origin. The derivation paths in the PSBT tells the signer:

What extended key was used to derive each key (does it belong to the signer?).
What path from the extended key was used to derive it.

It is useful for the signer to be able to sign (by deriving the corresponding private key) or to check the change output (by re-constructing the script from trusted data).


text:
How can I produce a time series of bitcoin blockchain data?
I want to fetch statistical data about the bitcoin network. Things things like wallet count, transaction count etc. Had a node running and the blockchain is on my disk. However parsing it seems to be not that trivial. I tried python-blockchain-parser however I get leveldb issues on all of my machines. I dont know the structure well and it seems like an easy thing to miss out data (segwit, lightning). Any tips?

In order to produce this graph

I used a blockchain parser to read block files that Bitcoin core had created. The blockchain parser created CSV data that I summarised using a second program and plotted using GNUPlot
A search for "Bitcoin blockchain parser" ought to find some examples. Perhaps one of them would be of use to you.
I wrote my own (see my profile)

If you are comfortable with SQL and are interested in running queries over the entire chain, there is a BigQuery database hosted by Google. You can find more information here: https://bitcoin.stackexchange.com/a/117171/139612
If you are more interested in the analysis of specific blocks or of transactions, bitcoin-cli provides a number of RPCs that can be used for fetching data, although this can be very slow when querying over large ranges.
In general, I'd recommend against parsing block files or leveldb files as those files are designed for efficient storage and easy use in the Bitcoin Core client and make no guarantees about being usable in other applications or providing a stable format.


text:
How to access bitcoin server's RPC interface remotely?
I am running a bitcoin daemon (launched via plist file) on MacOS with these parameters:

-server (to accept command line and JSON-RPC commands)
-daemon (to run in the background as a daemon and accept commands)
-txindex=1 (I need to maintain a full transaction index for testing purposes)

Both my bitcoin.conf and settings.json files are empty, and I want to use the random cookie authentication.
The node is running fine, has a local address 192.168.83.33, generates a .cookie file,  and is actually connected to 10 peers on tcp4 port 8333.
I would like to test the JSON-RPC API via HTTP (from another computer in the same local net) with the example command described in the bitcoin wiki:
curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://192.168.83.33:8333/

But I am receiving just empty replies (curl: (52) Empty reply from server), even when I try from the same node (on localhost address 127.0.0.1:8333)
Since I want to rely on random cookie authentication, I did not set any rpcuser. Do I need to pass the cookie file in the HTTP header (via curl's --cookie parameter)?
Bonus question: How can I set up one or more peer I would like to connect (along or instead of the random select pool)?

You need to pass the cookie's contents as HTTP auth username/password (username __cookie__, password a long hex string) if you manually connect. bitcoin-cli will do this automatically for you.

@PieterWuille I tried it already (with curl -u), and the client is working. What else could I check?

So did that fix the problem? What else is there to check?

@PieterWuille no. I mean the bitcoin-cli client is working, but I would like to test JSON-RPC commands via HTTP/curl, and write some JSON-RPC tool to play around with.

Are you sending the username and password from the cookie file?


text:
PSBT encoding : what's the aim of convertBytes function?
I'm currently working on PSBT and I try to understand all the part of the original implementation.
Dealing with base64 PSBT encoding: it seems that we convert the buffer from a base 8 to a base 6 using the convertBytes function.
Is someone that could explain me the aim of this conversion ?

PSBT uses Base64 encoding. As every Base64 character has 64 = 26 possibilities, they can store 6 bits of information. The ConvertBits function you link to takes input bytes (which consist of 8 bits each), and rearranges them into groups of 6 bits, which are then mapped to the Base64 character set.
ConvertBits<A,B> is not converting from base-A to base-B; it is converting from base-2A to base-2B.


text:
Bitcoind walletnotify runs only when transaction get it's first confirmation
I've successfully configured bitcoind and walletnotify to run on every deposit transaction in testnet. The problem is walletnotify hits only when a transaction gets its first confirmation and nothing happens when the transaction has been just created and has 0 confirmations.
Here is my bitcoin.conf
blocksonly=1
daemon=1
maxconnections=20
maxuploadtarget=500
testnet=1
rpcuser=someuser
rpcpassword=somepassword
server=1
keypool=1000
walletnotify=/home/ubuntu/walletnotify.sh %s

And this is content of walletnotify.sh
#!/bin/bash
F=/home/ubuntu/wallet_transaction_log
D=`date +"%Y%m%d%H%M%S"`
echo ${D} - ${1} >> ${F}

which simply writes DateTime and txid of each transaction in wallet_transaction_log
wallet_transaction_log
20201111135218 - d0cafe97f46ae3f8fb0bda6234a5c7a54ecb7053da10d9c393e261e0f6ab8295
20201111135921 - dfdd50db6e4508a4221ab144d8b33d77620d324d2a4667b64882e0a608b2bf80

is there something I'm missing?

You are in blocks only mode as you have blocksonly=1 set in your bitcoin.conf. This means that your node will not receive or relay unconfirmed transactions. You only see blocks and the transactions that come in blocks. Thus the first time your node will see an incoming transaction is when it is first included in a block.


text:
What was the first ever BIP 16 transaction? (Read: Not BIP 13)
I'm having a very difficult time finding the first-ever P2SH transaction on the blockchain. I do not have a query tool to answer this question myself, sadly.
All internet searches result in this answer:
9c08a4d78931342b37fd5f72900fb9983087e6f46c4a097d8a1f52c74e28eaf6
(Block 170,052 | March 3, 2012)
But as bitcoin wiki points out, this is the first BIP 13 transaction (first address beginning with a "3") and the P2SH soft-fork was not yet active, since it occurred on April 1st 2012.
I think this means the first legitimate P2SH transaction would be the first "3" address occurring on or after April 1st, 2012. Using vague tools I am under the impression that such a transaction occurred around April 7 or 8, 2012. However I am unable to dig deeper without manually searching every block on those dates.
I'm surprised this information is so hard to find since it seems like such an important moment in bitcoin's history. Maybe I'm misunderstanding something. Help greatly appreciated!!!

I used Blockchair to only search for transaction outputs of type P2SH, and restricted results to blocks after the activation height of block 173 805. I also checked against any time after March 11th and got the same result.
The first transaction that sent funds to a P2SH output appears to be
2597f4819e1902750b9e1fa1515df22bbf14f3a78a2b82aa7d62a8109d83289d in block 174 717 on 2012-04-08 (UTC).
Then, I further restricted the search to only permit spent outputs of type P2SH sorted by ascending spending block height after 173 805 to find the first P2SH output that was spent in transaction e5779b9e78f9650debc2893fd9636d827b26b4ddfa6a8172fe8708c924f5c39d at block height 174 719.

Ah I was unaware of the Blockchair tool. Thank you so much!

Interestingly, 37paP4uTjmA4Pi85LG6CF9huift3Dw1kFT from the first spending tx is an atypical address. It requires no signature, and leaves a non-standard non-empty stack. In theory, those are "free" coins, provided you can get a miner to include the tx

BIP-0016 stated:

These new rules should only be applied when validating transactions in blocks with timestamps >= 1333238400 (Apr 1 2012) 1.

The first block enforcing these new rules was block 173805, because it has timestamp 1333240980.
The first P2SH spend happened in block 174719 (TXO was created in block 174718), which the other answer correctly states.
I would like to add that there exist some TXOs that match P2SH output bytecode pattern that were created before P2SH had activated.
Before P2SH activation, they could be spent as just hashlock contracts.
After P2SH activation, they could only be spent if the hash preimage also happened to be a redeem script that would pass execution.
The TXO created in block 170052 was actually spent in block 170060 as hashlock, not P2SH, because P2SH rules weren't active at the time.
The other 5 hashlock TXOs were not spent before activation, and so P2SH likely made them forever unspendable, more details here: https://bitcoin.stackexchange.com/a/115804/137501


text:
What was the first ever P2WSH transaction?
I've managed to find the first-ever segwit transaction, which is also the first-ever P2WPKH transaction:
dfcec48bb8491856c353306ab5febeb7e99e4d783eedf3de98f3ee0812b92bad
However I'm having trouble finding the first-ever P2WSH transaction. Help appreciated!!

I just learned I can search for this myself using Blockchair. I will update when I find it!

I found it, using Blockchair as a free and easy search tool.
The first transaction sent to a P2WSH address is this one:
461e8a4aa0a0e75c06602c505bd7aa06e7116ba5cd98fd6e046e8cbeb00379d6
It occurred in the same block as the first P2WPKH transaction.
At the time of writing, it still has not been spent.
The first transaction that has spent funds from P2WSH is this one:
cab75da6d7fe1531c881d4efdb4826410a2604aa9e6442ab12a08363f34fb408
It occurred a couple days later.


text:
cgminer with an nvidia 710m GPU
Im trying to get my nvidia gpu working with cgminer 3.7.2
(windows 8 x64)
how could i make it work?
here is what my list devices says
CL platform 1 name: NVIDIA CUDA
CL platform 1 version: OpenCL 1.1 CUDA 6.0.1

When i try to run cgminer -d 1, It wont run.
command line options set a device that doesn't exist

What Crypto are you trying to mine?


text:
What Namecoins are used for?
I just stared in the bitcoin world and my bitcoin pool says I have :
Bitcoins    0.00000277
Namecoins   0.00000864

What exactly that means Namecoins mean? Is there any extra effort to process those Namecoins?

Namecoins are a separate implementation of the bitcoin protocol.
It is designed around the ability to use a blockchain to store information about namespaces for domains so once configured, a DNS could route traffic to a specific server.
The extension for these domains are currently .bit but this can be expanded at a later date.
Namecoin uses merged mining. No extra effort is required (the hash is checked against both chains).
More information can be found out at http://namecoin.info
Questions about the protocol are welcome here also.


text:
Can anyone assign btc address with wallet?
can anyone assign btc address with wallet?
I mean if I create like 5 addresses in one wallet, can anyone from outside prove that these 5 addresses belong to one person/wallet?
I know you can see IP that relayed the transaction, but if you use TOR or some other SW there will be plenty of relayed transactions from that IP so it will not say anything.. or am I wrong? Thanks for answers.

Yes it's possible if you don't take care.
Let's imagine you have 1BTC on each of your five BTC addresses.
Now you want to spend 4.5BTC, your transaction will look as following
input:
Addr A (1BTC)
Addr B (1BTC)
Addr C (1BTC)
Addr D (1BTC)
Addr E (1BTC)
output:
Addr X (4.5BTC)
Addr Y (0.5BTC) // the change

By seeing such a transaction you can easily deduce that the Addresses A,B,C,D,E belongs to the same person.
Note that this is not a 100% evidence because several people can put their coins together in one transaction for example for an Assurance contract.
Note that when you use TOR it creates a static route from your computer to an exit node. If you don't click on the 'Use a new identity' button your transactions will be broadcasted through the same TOR exit node. So click on 'Use a new identity' between each transactions.


text:
How do I read peers.dat file to get a list of all peers seen or that bitcoind has connected to?
In version 0.8.6 of Bitcoin, I see that peers.dat file is a custom database format declared in db.h:317 (class CAddrDB) and defined in dh.cpp:485. Any ideas on how I could go about reading the data from peers.dat with PHP or Python? I'd like to keep track of all peers that the bitcoin daemon sees and connects to.  Or is there a better way?

The easiest way to get peer information is via the JSON RPC interface has a command getpeerinfo.  Each peer returns a JSON object containing peer IP address info, connection time, version and subversion of the client.
You would probably be interested in this: Bitcoind API
Edit: Although this is not a way to read the database I presume that the data feeding the peers.dat file is pulled from both the IRC channels and the DNS seeds.  If you reported data on those nodes, you could use this data in combination with logs from the debug file to perhaps learn how your node discovered its peers.

Thanks, but that only lists the 8 peers I'm connected to.  I know that peers.dat contains a lot more data than that because:

it's rather large file (almost 1MB)
I see messages like the following in the debug.log:
"2013-12-30 03:05:34 Added 1 addresses from xxx.xxx.xxx.xxx: 62 tried, 14738 new"

"peers.dat is a flat file with a bitcoin-specific file format, unrelated to any database system." https://bitcointalk.org/index.php?topic=119525.msg1287284#msg1287284 looks like unless there's another implementation of it you would have to attempt to rebuild the code in the language you require.

I also found this: Bitnodes.  I will investigate his code and learn from it.  Thanks!


text:
Blockchain.com wallet
Just a basic/general question, recently when I send bitcoin using blockchain.com's wallet I noticed within my transaction logs Received BTC to: BTC Trading Wallet. From: BTC Wallet directly after Sent BTC To: ....... I'm just wondering why this is occurring and what exactly is BTC Trading Wallet and why my funds are being sent to BTC Trading Wallet?
It almost appears as a duplicate transaction but to my " own address "?


text:
How to get raw tx in hex format by not fetching API from provider?
I've looking for some solution to encode raw transaction in hex format by programmatically without fetching data from any blockchain provider. Are there any way to do this?

What is the source format (you'd like to go from X to hex, what's X)?

@sr-gi The source format is raw tx convert to hex format, For an example by fetching from API (https://testnet.blockchain.info/rawtx/4c8827bac9a78836fc90124a1d61d5fd38fca1cf606c6c7d2de19ed9a5aef276?format=hex)

I may be missing something. Your source format is already hex.


text:
BRD Wallet Recovery - Only have the first 11 words
I went to recover the wallet from my backup 12 word recovery phase, but it turns out I only have the first 11 words. The last word was replaced with the " character. I must have had the notepad file open, and leaned on the keyboard which replaced the last word in the list....and unfortunately saved it.
What can I do? Does having the first 11 words help me at all?

Sure, there's only a very small number of possibilities for the very last word. There'll be other advice here, but absolutely under no circumstance should you email with anybody offering private assistance or tools to download.


text:
How do internet wallets connected to full blockchain nodes
How do internet wallets such as Coinbase connect to the a blockchain node? Doesn’t the node itself create a default wallet object on startup? How is this replaced by internet wallets which hold multiple address until account credentials.

How do internet wallets such as Coinbase connect to the a blockchain node?

Using an API provided for that purpose. For example Bitcoin core's API

Doesn’t the node itself create a default wallet object on startup?

Not all nodes are based on Bitcoin core. Apart from the development costs there is nothing that prevents exchanges writing their own software to act as a Bitcoin node.
There are ways of running a node that don't create an unwanted wallet. (e.g. set disablewallet=1 in the bitcoin.conf file.)

How is this replaced by internet wallets which hold multiple address until account credentials.

In proprietary ways that are likely different from exchange to exchange and which are likely company confidential.


text:
Any charts/bots out there for volumes going from private/unknown wallets to known exchanges?
To figure out if whales are suddenly moving their BTC or USDT etc from their private/unknown wallets to known exchanges. Or vice versa, if they're comfortable enough to move a lot back onto their wallets.
Or at least how much money is currently on exchanges vs global crypto cap, plotted onto a chart.
Bonus points if there is a way to know how old the private/unknown wallets are. So for ex if wallets from 6 years ago are suddenly moving BTC to an exchange, vs wallets made e.g. this year.

You should check out WhaleWatch on Twitter. This account posts the exact kind of thing you’re looking for- specifically for BTC and USDT. They differentiate between wallet to wallet and exchange to wallet etc. They post data live and the amount too. There are other accounts just like it on Twitter but they’re a good place to start.

Yeah, you mean @whale_alert, the free/public version is limited to super large transactions only, and twitter text (no charts). There's also glassnode.com, but both of these are behind a paywall if you want to actually see a chart. And the price is not worth it imo if you just want this stuff. Should be public information. I might just find some github repo to fork and implement this myself if I get too much time on my hands.


text:
How Can i Extract a Z value of a specific Bitcoin Transaction that Belongs to a merkel tree/root transaction?
am trying to find a z value of a transaction that is signed in a merkle tree/root block , i coudn't find a raw tx id in hex  of that specific transaction that signed with  specific address while a raw tx id hex is the hashing of all other addresses in the block , so i couldn't extract Z value from it .. !!!

What is a "z value" ?

@PieterWuille Hash of the message ( m )


text:
Are the transactions displayed on "BitListen" really accurate?
Over the years, whenever there's unusual Bitcoin activity, I look at: https://www.bitlisten.com/
But can these transactions really be accurate? I just saw numerous 100+ BTC ones, and just now a gigantic one of 946.92 BTC (!!).
According to my exchange rate calculator, that is:
BTC 946.92 = $22,731,761.52 USD

Almost twenty-three million US dollars... at once?
I realize that a lot of money is being traded right now, but even if somebody has that many Bitcoin to trade, would they really do it all in one go? Isn't that very risk? Wouldn't you split it up into at least hundreds of different transactions?
I don't understand what kind of person or entity would make a single transaction of such a huge sum. Is this really accurate or faked somehow?

Yes it's real. If you don't believe it you can simply look at a block explorer and view many other transactions of similar sizes.


text:
Submitblock input parameters similar to getblock?
I have installed Bitcoin Core on my laptop.
Now open bitcoin daemon and do following:
First i run getbestblockhash to get the last block hash on the Blockchain. We call this hash as BestBlockHash.
After that i run:
getblock BestBlockHash 0
The daemon return huge continues hex string data, which is consist of block header and block body(which is the transactions data)
Now my question!
Is this exactly the input of the submitblock function? (which the miner who mine this block, entered this)
My purpose in asking this question is to know exactly what the input of the submitblock function looks like.
Thanks in advance,

I would suspect that this is the case, but if I wanted to verify this, I would call bitcoin-cli help submitblock. I assume that one should then see a help text that points towards BIP22.

Tanks for your reply, yeawh actually i have tried all these ways, But I am still confused that what is the submitblock input parameters exactly.

The input to submitblock is a full serialized block, encoded in hexadecimal.
Block serialization consists of:

The block header (80 bytes)
A CompactSize encoding of the number of transactions
The transactions, one by one, concatenated one after the other.

Sorry for my stupid question.
But what do you mean by serialized block?
Did you mean raw block in binary format?
(What you actually mean encoded hexadecimal means that convert this binary data to hexadecimal)

Yes, all of that. I think of transactions and blocks as abstract data structures (collections of information with amounts and scripts, not bytes). The protocol defines a specific way of converting these data structures to binary data, a process known as serialization (and deserialization).


text:
Relation between transaction data and transaction id
What is the relationship between transaction data and transaction id (which is used at mempool to generate Merkle root)?
Note : when we query the getblock with verbosity 2, we get raw block in json format. at the transactions part, each transaction have 3 suspicious part :

txid (transaction id)
hash
hex (which is raw transaction in hex string format)

I am looking for a relatio between these three parameters.

Since BIP144, transaction data consists of two parts (normal data and witness data). There are also two distinct transaction serialization formats:

The legacy serialization format, which stores version number, transaction inputs, transaction outputs, and locktime.
The extended serialization format, which also has a flag/marker to indicate the extended format is in use, and has witness data for every transaction input.

The extended format must be used if witness data is present. The legacy format must be used if no witness data is present.
The txid is the double-SHA256 hash of the serialized transaction in legacy format, meaning that any witness data has to be stripped out (as the legacy format does not support witness data). If the transaction had no witness data in the first place (as pre-segwit transaction do), the txid is just the hash of the serialized transaction.
The hash (or wtxid) of a transaction is the double-SHA256 hash of the serialization including potential witness data. If the transaction contains no witness data, this is identical to the txid.

Pieter Wuille, Thanks for your knowledge. But now which on of them (txid or wtxid) is used for merkle root ?  (Which is on output of getrawmempool when transaction is on mempool)

Both. The txid is included in the normal Merkle tree (whose root is in the block header). The wtxids are also included in another Merkle tree (whose root is included in the coinbase transaction output in an OP_RETURN; see BIP141).


text:
Get data from public-pool running on Umbrel
I am running my own public-pool instance on my Umbrel node (https://apps.umbrel.com/app/public-pool) mining using a Bitaxe device. For sport. Not for profit.
As I can access my node via VPN (https://apps.umbrel.com/app/tailscale), I'd like to access the mining info (hash rate, best difficulty) remotely, via curl. I thought I could curl the public-pool backend or parse the html page to get the data, but when try to curl (or wget) the URL, I get the Umbrel password page.
Does anyone have a better idea or an alternative for public-pool?

Have you given up on accessing Public Pool via Umbrel?
I've just connected to PP on a similar setup as yours:

Full Node on Tor-enabled Umbrel via dedicated RP5
Bitaxe Supra

FROM TOR BROWSER

Open Tor browser --> Connect.
Enter Node's Tor link
Establish connection to Umbrel

FROM UMBREL.

Umbrel Login --> enter PW
Open Bitcoin Core (select "load normally")
Open Public-Pool (select "load normally")
Re-enter Umbrel login PW

If all goes well, should be taken to your node's public pool dashboard.


text:
Still able to purchase Bitcoin once we have only CBDC and no fiat?
I have not invested in Bitcoin as of yet and don't have much technical knowledge on the subject on how it works in the background. I personally believe fiat currencies will all be phased out for CBDC. In this context I don't know if technically you would be able to purchase Bitcoin with CBDC or any other financial instrument.
My understanding is at present you can only buy bitcoin with USD, other fiat currencies are converted to USD before purchase. Is this accurate? This understanding has lead to my above concern.
Appreciate all feedback and technical knowledge to help me understand if its possible to create new avenues to purchase bitcoin thus ensuring its future.

What does CBDC mean?

@PieterWuille a 'central bank digital currency', assumedly. Apparently a central-bank run 'blockchain' is the latest and greatest in nonsensical buzzwordy ideas...


text:
Does a pass phrase uniquely identify public and private keys?
If I go to bitaddress.org and create a paper wallet with BIP38 and a pass phrase, what it doing with that pass phrase specifically? Since it can make multiple paper wallets from one pass phrase, the phrase must not uniquely identify the public and private keys.  But if it does not, what use is the phrase?

Key pairs created from a passphrase is part of BIP39 and BIP32, which is completely unrelated to BIP38.
The word "Passphrase" for bip38 encryption can be misleading terminology because most people think of the 12-word mnemonic when they hear "passphrase" which is associated with bip32 HD wallets.
The encryption password you enter into bitaddress simply encrypts your one single private key so that it can not be used unless you decrypt it by typing in the password.

Since it can make multiple paper wallets from one pass phrase

The passphrase is not used in that way. Bitaddress can/will generate multiple paper wallets for you but the keys are not derived from the passphrase. If you elect to encrypt your private keys with a bip38 encryption password each key will be encrypted with that password. It is not creating any keys from the passphrase.

BIP038 is a encryption standard for Bitcoin Wallets, your passphrase is for deriving keys for that encryption. The private key generation works by other means, and is strongly not recommended to generate your keys in sites like bitaddress. Download some wallet like Green or Blue, and just write down your 12-word mnemonic.

So if I lose a paper wallet but have the pass phrase, can I recover?

No you can not recover. There is no key derivation with bip38.


text:
Best Practices in integrating cryptocurrency as payment to my website
I  want to accept crypto as payment to my website
(some common coins, btc, bch, link, doge, etc.)
and give authorization accordingly.
I was wondering what is the best practice to do so?
Should I create a wallet for each user?
or should I have one wallet and assign a public address to each user?
Also, I am using node.js,
Which packages are out there that can do these tasks?

For Bitcoin there is BTCpayserver, it's an open source well maintained invoice and accounting tool that accepts BTC and LN payments.
For other cryptos you'd probably not want to implement each individually, but go with a full suite solution provided by a for-profit company. As this is an open source place and a Bitcoin place, you probably won't find suggestions here.


text:
how to get masterkey and consequent wallet keys from root seed?
So basically i am trying to create my own crypto wallet application in python, i have generated the random entropy, calculated the checksum, generated the 12 words and then  generated the root seed using pbkdf2, but after generating the seed I'm kinda lost, i dont know how i can generate the master key and the chaincode, and then generating the public and private keys, lets put for example i have this root seed 1f8c67bc66355f62f6c63752803599cc6e4a05eac6dd63e05e858329f3656ed3c868bd428a4218b4eb92e0fe5e774874c4ab270b8d1377ddc0aea6a797682342
what should i do with it to generate the master private key and then the following child public/private keys? thanks, i'm very new to this in general so sorry if there is any issue with my question

Read BIP32 and BIP44. Also learnmeabitcoin.com under HD Wallets and Derivation Paths.
Walk through the open source software implementations step by step.
As a user, Bitcoin Explorer (bx) examples, iancoleman's site code, bitaddress
generate wallets from the command line, bash scripts using Bitcoin Bash Tools etc.
Have a thorough understanding of what these tools are doing as a user before trying to replicate it as a coder

i read it a few times but i still didnt understand at all, maybe im doing something wrong ... also i dont want to generate wallets from the command line or any bash scripts i want to create an python code from scratch that does it, i have already generated the seed what i need now is to generate the chain code and the master private key but i cant figure out exactly how i can generate those...

@user132741 If you can be more specific, people will be more able to help. Can you say exactly which line in BIP32 is holding you up the most?

@RedGrittyBrick i am having trouble to understand this topic of the BIP32 documentation: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Master_key_generation ,
my problem is i dont know what to do after hashing the entropy to get the master seed,
i dont know exactly how to be more clear but lets give an example of this seed i generated just now d213b3de1949e716b2e5fb96ae62efa0c27843debf4372e8840ebc7f87024f6cb10126e51bbfecd362ac21105edef4c799b09c973d05a5b566b5173e185e7927
what i do exactly with it to generate the master private key ?

Do you have a library that implements HMAC-SHA512?


text:
I sent bitcoin to an Electrum address I created but I can't access it. can anyone help
I went on a market set it all up everything was good to go but when I set up a refund address just in case something went wrong , in the process of sending the funds to the vendor I accidentally sent them to the address I used (refund address). The transaction has completed but I can't figure out how to get the funds. I have the private key the public key the transaction info everything but as a newbie I'm a little lost and I really could use some help PLEASE

I guess the "refund address" is part of the data you provide when registering an account with the market.
If so, I would expect that this address is not generated by the market but is one that you previously created in Electrum using its "Receive" button.
Electrum's "Addresses" tab should show a list of all the addresses it has generated this way, regardless of whether any money has been sent to those addresses.
It may take a while for money sent to one of these addresses to show up in Electrum.
If the refund address is something created independently by the market then it may be part of a custodial wallet (they have custody of the money) and you will have to ask them about this matter since the money is under their control not yours.

Somewhat related

Electrum receive tab
Why I have some many address when I only created two wallet address in Electrum?
What all the addresses are in my Electrum wallet?
Electrum wallet address not showing
Understanding the receive tab in electrum
More receive addresses with electrum

Hey Red nice to meet you. I set the refund address up but I dont know how to recover the wallet I think I deleted it but the money is still there in the address I created but I just don't know how to get it. I have the address the private and public keys the transaction info but I am lost if you can help me recover the funds or find someone who can I'll pay you for your help. Thanks and a great day

I would download a wallet and import the private key.


text:
Double Spend for small value transactions
maybe a naive q, but I read in a book that for small value items you don't really need to wait for confirmation of a BTC transaction (i.e. dont need to wait for it to be added to a block):
I understand the rationale, i.e. waiting for confirmation is long ~10mins or so, probably not worth it for small value tx's. But now, if I didn't wait for confirmation doesn't that leave me pretty exposed to potential double spends?
Eg I am buying a coffee which is 0.01 BTC, i can pay the merchant and at the same time create another transaction paying myself 0.01 BTC. They both end up in the mempool waiting to be collected and mined. 50% of the time i'd not have paid the merchant and 50% of the time i'd have paid him...
is the only way around this to actually wait for confirmation (or even a few confirmations)?

There are several ways around this

Wait for more confirmations. Obviously this has a time penalty that is difficult for many coffeeshop scenarios.
Use something like lightning network instead.


text:
Is there any reason for an alternative Bitcoin implementation to use Berkeley DB?
The primary reason Bitcoin's C++ reference implementation uses Berkeley DB 4.8 seems to be backwards compatibility. It doesn't appear that BDB4.8 (or BDB at all for that matter) has any superior advantage over current-day alternatives like Redis or RocksDB, at least based on the limited research I've done (source). To the best of my knowledge, most alternative full-node implementations steer away from wallet support (source, source).
Performance benchmarks seem to indicate that there is no performance benefit to sticking to Berkeley DB (source) yet I cannot seem to see any widespread adoption of anything else except for recent introduction of SQLite support (source) for Bitcoin Core despite the growing pains of BDB4.8. I can't imagine any other reason as to why BDB wasn't dumped altogether if it wasn't for backwards support.
Is there any reason why alternatives like RocksDB (which supports at rest encryption though it isn't well documented), ArangoDB or Aerospike (all that seem to have existed at least five years ago) were not considered? Is there any security benefit to sticking with BDB? Any redeeming properties of BDB that make it a definitive choice over what is available currently?
Should a new implementation stick to BDB or use another library for wallet support and if so, what should it be?

There are a couple of questions here that at least partly answer your question (not the historical decision part though) At least if your needs are similar to the Core wallet today you would probably choose to use sqlite for the wallet rather than BDB https://bitcoin.stackexchange.com/questions/51435/migration-from-berkeley-db-to-leveldb?rq=1 https://bitcoin.stackexchange.com/questions/99620/why-is-the-bitcoin-core-wallet-database-moving-from-berkeley-db-to-sqlite

I'm familiar with both answers, the first one explains the transition away from BDB for blockchain storage and simply reinforces my view that BDB was stuck solely for wallet compatibility. I agree with the rationale of the second answer but why'd it take so long? BDB was a known pain for a long time.
I guess in a nutshell I want to know if RocksDB/ArangoDB be used for both blockchain and wallet storage because moving away from BDB seemed long due.

Backwards compatibility is a massive priority for Core and it is generally very conservative in its technology choices. I don't think it would consider a new (database) technology until it had been proven over many years on other projects. It is providing a consensus engine and infrastructure and doesn't have the same tolerance as startups or bigger corporations for cycling through different options and experimentation if it is going to endanger backwards compatibility or require many developer hours to revamp shortly afterwards.

That's what it seemed like, I know the maintainers went so far as to create a PPA just to have libdb4.8-dev as a package on Debian-based systems and can't imagine any other reason as to why they'd continue with BDB. I was wondering if there were technical advantages of BDB that I might've looked over or if there were non-support related reasons as to why BDB was stuck to for so long. Thanks for your help! <3

No problem. If that answered your question I'll add it as an answer.

Backwards compatibility is a massive priority for Core and it is generally very conservative in its technology choices. I don't think it would consider a new (database) technology until it had been proven over many years on other projects. It is providing a consensus engine and infrastructure and doesn't have the same tolerance as startups or bigger corporations for cycling through different options and experimentation if it is going to endanger backwards compatibility or require many developer hours to revamp shortly afterwards.

I can't imagine any other reason as to why BDB wasn't dumped altogether if it wasn't for backwards support.

There simply is none. The wallet file doesn't need to be a database, it could be a flat text file and that would operate just as well. BDB will remain for compatibility for the foreseeable future, and change is risky, so it remains.

Perhaps worth pointing out that BDB is only used for wallet files, which tend to have extremely long lifetimes (just search this site for people trying to get their funds out of wallet.dat files that are a decade old). For other purposes LevelDB is used, and incompatible changes to those databases have been made several times, for performance or other reasons. It's only for the wallet file that it really doesn't matter what format is used (it's loaded entirely into memory, at least for now), and compatibility is paramount.


text:
Crypto Exchange that Offers Withdrawal to Banks in Saudi Arabia
I need any crypto exchange that offers withdrawal (cash) to banks in Saudi Arabia. There is one exchange that I know of is Fasset but it's still in its beta phase. I want to know if there's any other alternative to it.


text:
bitcoin address after transaction security questions
I found an old paper wallet on an old computer of mine which is offline (I can count the number of coins with my fingers). I would like to distribute these coins now among 6-9 wallets (I want to give some family members coins) and have a few questions. Partially they are also out of curiousity, since I am learning more about bitcoin now that I have discovered the coins again.
1.) Is it safe if I create a raw transaction on the offline computer so I can execute it on my online computer?
2.) I read that making a transaction will reveal the public address of the current address. I also read that the signature of multiple transactions can help hackers to figure out my private key. It is therefore recommended to empty the old address when I move stuff around. Nevertheless, I am curious about the following:
However, wouldn't you say that the old address is still relatively secure after doing a single transaction? Meaning, while I should empty the old address at some point, a brute force attack would most likely not be able to hack the public key within a month of the transaction.
3.) If I send the bitcoins to multiple addresses in one multi-recipient transaction, will this raw transaction have a signature for each receiver? Or will I only sign with one signature (effectively the same as if I just moved money to one address)? Meaning, does an address become more exposed after a single multi-recipient transaction vs. a single one-recipient transaction?

1.) Is it safe if I create a raw transaction on the offline computer so I can execute it on my online computer?

Yes, this method, called using cold wallets is very effective at keeping coins safe.

An address either never spends (the public key is not revealed) or it spends (the public key is revealed). Spending fewer times from an address won't make it less secure (unless you use very old or home-made signing code). And the security difference between non-spending and spending wallet is negligible. (Otherwise, there would be a price crash and chaos)

Every input has its own signature, not every output. So, by making all those payments at once, you'll save lots of $ in transaction fees.

Thank you for your response! Could you please clarify what you mean with "very old or home-made signing code"? I was going to create the raw transaction with the brainwalletgenerator.com code from https://github.com/BrainwalletGenerator/BrainwalletGenerator

I can't comment on that site, I use https://coinb.in instead but if you find it trustworthy you can use it. The problem is, signing requires a random and secret constant k which has to be different every time a different message is signed; otherwise, the private key can be extracted from public signatures. Any new services or websites today handle this correctly there are very few software suffering from this bug. However it really annoys me that this website claims to be open-source without publishing their code

No modern code uses a RNG for signing and haven’t done so for years. The only time entropy is important is key generation.


text:
Can a person only send large amounts an have a $500 transaction log between us before he could send? How can i get around this?
Recently I going to receive a donation from a man and he tried sending a large amount. The amount wouldn't send he said we had to have at least $500 in transactions before it would go thru. Does this make sense ? He said he could only send large amounts. How can I receive the donation without the transaction log?

Seem like a scam

Sounds like a scam; that's not how Bitcoin works. I wouldn't have high expectations about the outcome of this. The goal is to get you to send them money.

I would say the following:

Send me the $500 and I'll partly refund you once your transaction is confirmed.

This is because, unlike bank transactions, transactions in Bitcoin are irreversible and it's not possible for them to "transact and cancel the transactions".

This doesn't make any sense at all. This is a 100% scam. Don't trust this person. Block him forever and don't reply to his messages. Cryptocurrency transactions don't require any backlog history.


text:
I convert My Xpub To Youb address And Now can't Recover Fund
I convert my Blochchain.com Wallet Legacy xpub to Ypub Using
This website: [https://www.blockonomics.co/views/segwit_xpub_convert.html]
But Now I can't recover My Fund It still Stack In Given address. So what is the procedure To recover My fund From address. I use electrum TO recover it But when i give seed and create wallet it's look 30 address but None of the address where the amount was. But when i use standard key like use my ypub key it's show my Balance and I can't spend it. Its only on watch. I can't transfer fund. SO any solution About that?

Public keys and private keys
To spend money you need the private key for that money.
If you have a public key but don't have the matching private key, your wallet will show the money as "unspendable" or as "watch-only".
Playing around with public keys will not produce a private key.

Wallet recovery using a seed phrase
You can recover a wallet using the "seed phrase" which is also known as a "recovery phrase" or "backup phrase". Doing this properly will regain the ability to spend money.
However Electrum uses a non-standard seed-phrase system that is incompatible with the BIP39 standard use by most other wallets.
If you want to recover a wallet using a BIP39 seed-phrase you must use a wallet program that supports BIP39. You must also ensure you are using the same "derivation path" as the original wallet. Many wallet programs allow you to specify which derivation path to use. If the derivation path is wrong, none of the addresses will match and you won't regain control over money.


text:
How does a miner verify a transaction which is spending an output of another transaction in the same block?
It is mentioned in this post that:

If all validation of all transactions in a block succeeds, the consumed inputs are removed from the database, and all outputs of those transactions added as fresh unspent outputs in the database, allowing them to be spent by future blocks.

But if the UTXO set is updated only after appending a block, and a miner only checks the UTXO set for understanding the spent/unspent outputs, how will verification happen if a transaction (say tx_B) in a block spends an output of another transaction (say tx_A) in the same block? In another word, how will tx_B understand the state of the output of tx_A if the output is not stored in the UTXO set yet?

Does this answer your question? Spending UTXO from same block

@Anonymous No, I know that spending UTXO from the same block can happen, but my question is how the verification happens if miners are not seeing UTXO of their same block in the UTXO set.

The answer is the same, blocks are processed sequentially and the UTXO is effectively updated after each operation. Therefor a later transaction in the same block can spend an earlier one.

@Anonymous, Perfect! This is what I was looking for and it was missing in the other question: UTXO set is updated after verification of each transaction (not after appending a block). Thanks for your answer.

While a miner is building a block template, they are maintaining a "virtual" UTXO set to keep track of the consumed UTXOs and the newly created UTXOs. A transaction can only be included in a block once all of its inputs are available for spending, so this approach is also sufficient to achieve the required topological order of transactions.


text:
Recovering Blockchaininfo wallet in Electrum wallet
I have my wallet in blockchaininfo and I did the backup of my 12 words (SEED).
I would like to open this wallet in Electrum, I notice that Electrum allow to recover a wallet using a SEED from another wallet (BIP39 seed).
When I type my seed and I choose the BIP39 option, I can click on next step where I have to choose the type of the addresses on my wallet: legacy (p2pkh); p2psh-segwit (p2wpkh-p2sh); native segwit (p2wpkh). I am not sure what those options mean, so I just choose the default option (native segwit). After this step, I just need to set up a password.
But when I do all these steps, I cannot see any Bitcoins in my Electrum wallet, Am I doing something wrong in the steps or is not possible recovering blockchaininfo wallet on Electrum wallet?

Begin anew via file > new/restore, enter a unique filename and click ok, Follow on-screen instructions for the rest. This time choose p2sh-segwit if the addresses in your blockchain.info wallet begin with 3 or p2pkh if they begin with 1.
Native segwit generates addresses beginning with bc1. I don't think blockchain.info generates native segwit addresses at this point in time.

I did as you said and I could see some transaction in Electrum when I choose p2pkh, but my balance is still 0, I think it is because on blockchain you can create a lot of wallets, and these wallets generate a lot of addresses. I received BTC in addresses that start with all of those paths (3, 1 and bc), but in Electrum I have already tried all those paths and I cannot see my balance there, not sure about that, maybe I have to customize this path, as it is said in one option: "You can override the suggested derivation path".

it would be easier to simply make a new wallet in electrum and simply send all your coins to it via blockchain.info. however if you insist on restoring from bc.i seed proceed as previously with one difference. increment the last number in the path. so for example you make a p2pkh wallet with the path m/44'/0'/1'/ instead of m/44'/0'/0'/. this last number is for your hd account which blockchain.info calls wallets. do this for all script types (p2pkh, p2wpkh etc.). you can keep incrementing that last number until you arrive at a wallet with your whole balance.

Thank you, the only reason I want to restore my blockchain wallet in Electrum is if I lost access in my blockchain, I could recover it in Electrum. This is just for educational propose for myself, not exactly a need. Thank you very much again.

A mnemonic seed phrase can be used to derive an unbounded number of addresses, so you need to supply some additional information, so that the wallet software will know which addresses to derive.
This additional information includes the derivation pathway, and the address type.
There are some standards developed to specify these variables, see for example BIP 32, 39, 44, 84.
So to recover your wallet, you'll want to figure out first which derivation path the original wallet used (you should hopefully be able to find this in the software docs / help), as well as the address type used (should be self-evident, based on the address prefix).


text:
What are the advantages for an user that is running a Bitcoin full node?
I am running a Bitcoin full node Bitcoin core version v0.19.1 (64-bit).
I know that is one of the most secure wallets, but the process to set up a full node is very painful, and even if you keep this full node running 24/7 you won't get paid.
So I just would like to know what are the advantages for an user that is running this full node, I only can think that the network will be benefit with that somehow, but I can't see any advantage for the user.

You validate your own UTXO without any external services that may play for your disadvantage, no middleman needed
It's the most privacy-preserving and secure way of using bitcoin. Lightweight-clients have some privacy issues, not too many people are reviewing their code.
The process of setting it up and using bitcoin core is a major step in one's education when it comes to bitcoin. More knowledge = advantage.
You have some voting power on consensus rules, like in UASF.


text:
How do I get coin supply on Bitcoin core?
I've seen in other QT wallets I can get how many coins are in circulation typing a command like  getsupply, they also have this information in the output of the command getblock <hash>.
Is there a way to get this information using a RPC Command on Bitcoin Core?

It depends on what you want.
If you want to know the amount of currency that has been available for miners to bring into circulation (the "210000-1 blocks of 50 BTC, then 210000 blocks of 25 BTC, then 210000 blocks of 12.5 BTC, ..." rule), the answer is no, there is no RPC that computes this. It's easy to do yourself, though.
If you want to compute the amount in circulation, namely the sum of all UTXO values, there is; it is computed by the gettxoutsetinfo command.


text:
Is it cryptologically possible to create a smart contract which SAFELY gives me "altcoin interest" on my Bitcoins?
I am aware of the existing, similar questions, and I have read them and found them valuable. However, I do not feel as if I have truly got a conclusive answer on my basic question, which is:
Is it logically possible for me and a stranger to, today or "one of these days", set up a "smart contract" using nothing but Bitcoin Core, which has the following agreement:

The smart contract starts when I have sent 1 BTC to the smart contract's BTC address and the other person has sent 300 WhateverCoins to the smart contract's WhateverCoin address.
If none or either of us doesn't send the money within 24 hours, the contract is voided and the coins are returned to our wallets.
Assuming that both sent the coins, the contract now activates.
Until a specific date and time 30 days into the future, the contract will now run.
For as long as the contract runs, a daily 10 WhateverCoins are sent to my WhateverCoin address (which was specified before the contract was created). This is my "interest" and the reason that I entered into the smart contract; to get money.
Um... they can't... spend... my Bitcoin... but... they still somehow... want to enter into this agreement...

Alright. This is where it falls apart every time I try to ask this question, or construct it in my head. I basically don't see why they would enter into this agreement if they never get control of my 1 BTC, and I cannot possibly let them do that since it will then be lost as they will never return it. And if they are required to put 1 BTC as a safety deposit sum into the smart contract to get access to my 1 BTC, then what's the point of doing that in the first place? If they already have 1 BTC to use as security, they can just use that and skip the whole contract + interest!
I just don't see how this could ever work. It seems logically impossible. They must get control of my Bitcoin for it to be meaningful (?), but then I have to trust a stranger which is not going to happen. Only a complete idiot would do this. I'm not that idiot... anymore.
Is there some way to cryptographically ensure that I will get my 1 BTC back when the contract ends, no matter what, yet still giving the other person some kind of value/temporary ownership of the 1 BTC which is to be safely returned to me at the end of the contract? (Or a completely different Bitcoin, but the same value.)
Even if centralized services such as "BlockFi" didn't require KYC/AML stuff, I still could never trust them to have control of my coin. The stress from fearing that they will pull a "Mt. Gox" on me and exit-scam will not be made up for by the interest earned while it's there. Just because it's associated with "Winklevoss"/Gemini doesn't make me feel any safer. The most rich and famous people out there are often quite tricky and nasty. After all, the entire point of Bitcoin is to escape centralization. I don't understand how people can use and recommend centralized services which gain full control of your coins. It's impossible for a "true Bitcoin believer" to enter into such a contract.
Even if this is not possible right now, is there really anything which fundamentally prevents it from ever working? Is there really no "smart logic" which I'm overlooking that can be applied so that they get value from "owning" the coin, yet I am still guaranteed (not by a "pinkie promise"!) to get it back at the end of the time-based contract?
Of course, if somebody figures out a way to entirely break the entire Bitcoin blockchain/system, all is lost, but I mean assuming that Bitcoin keeps working as reliably as it has up until now.
I really need to make money, but I just cannot trust centralized entities or "promises" of any kind other than the cold logic found in a "smart contract".

Wow. Instant downvote. Some people on here really don't want people asking about decentralization...

Those links don't help. You are just "linking away" into endless mazes of useless links. That "Sovyryn" thing is vaporware. Doesn't even let you use Bitcoin Core. It's more than likely a scam. Absolute nonsense.

@Prayank I don't even know what this is supposed to mean: "If not satisfied with the links, ask question about your definition of "smart contract" because interest is EASY" I asked my question in the... question. Why not actually address what I typed?

Since you will only use Bitcoin Core… How do you suppose would Bitcoin Core stay abreast of the state of what's going on in the WhateverCoin network? I mean, you've pretty much ruled out escrows and oracles, right?

@Murch You say "only" as if Bitcoin Core is some kind of toy. It's the "real deal" of Bitcoin. And I expect the smart contract to handle that, obviously. But it seems like nobody is interested to explain anything and only ever "outsource" the help to webpages which don't explain anything. Everything called "decentralized" or "defi" seems like vaporware/a scam.

As the meme goes: "A: 'Step1, step2, , step4, profit!'—B: 'I think you'll need to be a bit more explicit on step3 there.'"

Essentially, your question boils down to "How do I get something for nothing?". The answer is that there is no such thing as a free lunch, and the answer is the same, even if you ask ten times.—Your question is getting downvoted for asking the tenth time. Please stop.

Lots of things called "decentralized" or "defi" are scams, and I vigorously encourage you to stay away from them. Some of them are real, or useful, and have varying degrees of decentralization.
Still, nothing is ever going to give you interest if you don't give up custody of your coins. Interest is literally you being paid to take the risk of not being paid back. Without risk, there is no reason why anyone would ever pay you.
If you feel like there is a comparison with traditional finance, where it seems you get paid interest simply for leaving money on a bank account, please take into account that:

You give up custody to the bank, and the bank could go up in smoke, taking your money with them. If you keep your money hidden under your mattress (which is the equivalent of what you're asking for here, no matter how many smart contracts you hide it under), you don't get interest.
Often interest rates are lower than inflation, so you're really not getting anything for free (but obviously still more than just leaving it under your mattress).

If you want to see money grow, you'll need to invest it in something. Whether that's lending it out, or using it to build a business and seeing its value grow, or buying an asset with the intent of selling it back for more later (which is called speculation, and generally not considered investment). And inevitably, all of those things involve you taking the risk of not getting as much back as you put in.
This is not me encouraging you to do any of this. There is lot of garbage around in the cryptocurrency space, and you're entirely justified in not trusting much (or anything), but then also don't expect to get paid interest for it.


text:
Why does all cold/offline storage setup require three steps?
I was reading about cold/offline storage and from what I have seen all clients seem to work the same. Requiring you to create the transaction on the online computer, getting it to the offline computer and signing it, then getting it back to the online computer to broadcast, but I don't get why? It seems to me you should be able to make this in two steps and it would also make it more secure as data only ever have to flow in one direction. You create and sign the transaction on the offline computer then you get it to the online computer to broadcast. So why is it not implemented like this in clients?

It isn't necessary, but it is convenient.  On the very few occasions I need to create a transaction from an address I own I do it all on the offline computer.  I create a new key/address pair for the unspent amount on that offline computer.  Yes, I type in the private key from my paper wallet, it's not hard.  I open up a brand new SD card package, put the signed transaction on the new card, move that to my online computer, inject the transaction into the network, and break the sd card. (Last step isn't strictly necessary but its fun and makes everything seem "final".)

Building the unsigned transaction requires the input data(transaction IDs, vout, values), and is also good practice to check the network fee climate prior to setting a fee in the transaction you are building.
Technically yes you could do it in two steps but it would be considered for advanced users only and still prone to typos or other errors during the input data entry.
Related repository of mine that lets you skip step 1 and do it in 2 steps if you choose. (NOT A RECOMMENDATION, EXAMPLE ONLY TEST SOFTWARE USE AT OWN RISK) https://coinables.github.io/coldsigner/

you can check the network fee on any site that provides that information on any computer that's handy - you don't have to create your unsigned transaction right there with internet access, right?

Yes of course, I suppose my reference to the fee isn't really pertinent here.

Creating a transaction requires access to the blockchain in order to know which outputs can be spent by the wallet. Access to the blockchain requires access to the internet, thus any such computer will be online.

maybe sometimes but not always, right?  I have a paper wallet, I know what it's address is holding, I'm ready to do my transaction offline - 2 steps.

@davidbak Knowing the address that your coins are assigned to isn't enough. You need to know the txid and output index that actually credited the address in order to produce a transaction that spends.

ah.  i've got a blockchain on my offline computer that I keep fairly up to date by transferring an entire hard disk.  maybe that's why it works.


text:
Order of Signatures in Multisig-Scheme
3 Entities (A/B/C) create a collaborative Multisig Wallet (e.g. 2-of-3).
A creates an unsigned TX and shares it with B/C. They (B/C) sign and broadcast.
Looking at the TX on the network, can A make any difference who signed first? So, are signatures in the signing process appended to each other OR do they follow the specific order the multisig-setup was initially constructed?

In the context of OP_CHECKMULTISIG, the signatures must appear in the same order as the public keys are listed.
The signers can create the signatures in a different order than that, but since the signature order must adhere to the original output script the order of creation cannot carry over to the final transaction.


text:
Bitcoins missing following wrong bank account number entered
In 2019 I commenced trading with an online Bitcoin trader called Assetgates, who had contacted me via my mobile phone.
Money was transferred from my bank to a Kraken account, then to Assetgate in the form of Bitcoins to trade. a broker contacted me daily and transactions were made be the said person.
By March I had accumulated $160,000 which I decided to withdraw.My broker transferred me to another person who took me through the process of transferring the said monies to my Kraken account. In the process of the transfer the Kraken bank account number had the K missing off the end.
My broker then informed me that my money was with the Miners who would give it back if i forwarded 17% (£22500) which was money I did not have.
I was then informed that the miners would divide the money between themselves, and I would receive nothing.
Can you advise me if there is any way I can trace this money to see infect where it ended up?

I believe you are undoubtedly the victim of a scam.
It is extremely unlikely you will be able to trace the money to any identifiable individual. Bitcoin is designed to make this very difficult.
I suggest you firstly report to police that you are the victim of a fraud, secondly accept that the money is irretrievably lost and move on with your life.
You will receive private messages from people telling you that they, or someone they know, can recover your money. They also are fraudsters. I strongly suggest you ignore them. You will be tempted greatly but it can only lead to further loss.

Some reasons why this is the case:

I commenced trading with an online Bitcoin trader called Assetgates, who had contacted me via my mobile phone.

Unsolicited contact by people using disposable phones (or by throwaway account on Facebook) claiming to be a broker/trader/miner or other expert is a sign of fraud.

My broker then informed me that my money was with the Miners

This is not the way Bitcoin works. Miners do not hold investor's money.

the Miners who would give it back if i forwarded 17%

This is not the way Bitcoin works. Miners cannot reverse transactions.
Anyone who had previously received your "investment" money could create a new Bitcoin transaction to return it to you for a cost of a few pennies. If they were greedy enough to want to keep 17% of your money they could simply send you the other 83% directly without needing any up-front fee from you. The up-front fee is another clear sign of dishonesty.

the miners would divide the money between themselves

This is not the way Bitcoin works.  Miners cannot take control of money that is under the control of other people.

Well written response.


text:
What are the risks of direct Bitcoin fraud, such as counterfeitting?
I am being mocked by friends for not being on the Bitcoin train yet, so I am trying to understand it all. I get how btc blockchains basically works, but when someone says "if bitcoins are copied by splitting the blockchain" or something like that (I can't even quote it correctly...), what does it mean? Are there 'fake' bitcouns floating around out there? And what to do if you end up with some fake btc?

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

It helped a lot!  think remaining gaps are partially due to my brainware being in dire need of an update....

There are a lot of scammers but counterfeit bitcoin cannot exist. Scammers can try to trick inexperienced users with watch-only wallets, or fake software etc, but they can't actually counterfeit coins.
Since the bitcoin ledger is public anyone can check to confirm if a bitcoin address has funds on it. In most cases you just need a single private key to spend the funds associated with a bitcoin address, so simply verifying that you have that private key and the address associated with that key has funds you can be sure those funds are really there.
Never accept a wallet file or a private key in exchange from someone trying to sell you bitcoin, instead simply provide them an address you already know you control and have them send funds to you over the bitcoin network.
The "splitting the blockchain" reference you mention is related to what is called forking. As bitcoin is open source anyone can create and run network similar to bitcoin with the same or possibly different rules than bitcoin. There are also instances where developers will take the bitcoin blockchain and copy it to start a new coin, but uses the existing balances of all bitcoin addresses (Unspent Outputs). This is a forked chain where users that had funds on bitcoin, now also have funds on some new chain but usually at a much lower value than the original. These forked chains, created out of nothing, usually suffer economically as opposed to the original bitcoin. Although it is a copy, it is not counterfeit it's just another blockchain network.

So  forking means everybody who had X btc on the old chain simply has the same X number of alt btc on the new chain??

@HenryStone yes, but the new chain is not ‘btc’, it is fully just an altcoin. It is sort of like if someone distributed dirt to each holder of gold coins in the world, in an amount exactly equal to how much gold each person holds. Is this dirt worth anything? Why would it be?


text:
Why is a 51% attack guaranteed to outpace the rest of the network's miners? Doesn't 51% hashing power give only a slightly higher chance?
I thought hashing power is an expression of the probability of being the one to solve the cryptographic puzzle and placing a new block on the network.
If that's true, owning 51% of the hashing power should just give a slightly higher chance of mining a new block than 49% hashing power. However when I read articles explaining Bitcoin and mining, owning 51% of the hashing power in the network is presented as a guarantee to be able to outpace the rest of the network, to the point where an alternate chain can be created and funds double spent.
Given what I assume (could be wrong) is a marginally higher probability of solving the puzzle first at 51%, how does that make sense?
Couldn't someone who got a little lucky do that with 40% of the hashing power? How does 51% of the hashing power guarantee that one will be able to carry out an attack on the network?

With any probability distribution, a larger sample size will converge onto the expected probabilistic outcomes.
So if you had 51% of mining power, there is a chance the other 49% of miners will outcompete you on a short time scale, but over longer time scales we’d expect you to win.
Really, the threshold for this is just >50%, but a ‘51% attack’ has become the colloquial term for this.
Note that a 1-2% of an advantage may not sound like much, but that’s the house favour on many casino games, and casinos generally seem to have no problem staying in business (despite sometimes paying out big to lucky players). Over long enough time scales, we reliably see a regression to the mean.

But couldn't it take a large sample size to converge onto the true probability distribution with reasonable confidence? In other words, it seems to me the slightly >50% party (let's say 50.5%) could mine 100 blocks and easily not have outpaced the rest of the network if he gets even a little bit unlucky. Is the assumption that he would just keep going for as long as it takes, eventually being able to fork his entire chain and cancel the now irrelevant chain mined by the rest of the network?

@bitsearch yes, and likewise, an attacker with <50% of the hashpower could pull off an attack, though they would fail on average. With >50% of the hashpower, they would succeed on average, with a continuously growing likelihood of averaging success of as time increases. I don't doubt that articles written for laymen may not communicate this effectively, but you can check out section 11 of the original whitepaper for some of Satoshi's calculations regarding this: https://bitcoin.org/bitcoin.pdf

Thank you. I was reading a lot of articles but I'm not sure the writers understand statistics and it seems they're all copying from the same article. I guess going directly to the technical source makes more sense.

If you do not bound the time the attacker has, if he has 51% of the hash power (and is able to hold that majority during the entire attack time), he will eventually always overtake the rest of the network.
More formally: the probability of the attacker overtaking the honest network will converge to 100% as the attack time goes to infinity. There is no guarantee that this happens quickly at all, and that probability will never reach 100%, but it will come arbitrarily close.
Someone with 51% of the hash rate can simply produce blocks faster than the rest of the network combined, so this should not be a surprise. Sure, he may be unlucky for the first block, or the second, or even the first 100 blocks, but in the long term, the rest of the network simply cannot keep up with the attacker.

That makes sense, thank you. I understand the convergence properties of probability distributions as the number of iterations of a process goes to infinity. I was confused because the layman articles I was reading (my mistake) seemed to implicitly define a 51% attack as the instantaneous downfall of the entire network.


text:
How to access my on-chain BTC private key(s) from my Lightning Node?
I deposited some BTC to fund my lightning node. Question: Where are the private keys for the public on-chain address provided by the node in case I need to withdraw the funds from the node?

What software/platform are you using for your Lightning node (and if applicable, for your on-chain wallet)?

I am using bitcoind with lnd. I used lncli create to create the lightning wallet.  I also use ZAP desktop wallet to display the bitcoin address to which I deposited funds.

With a small research on the lightning network implementation I found that the node has some method to extract it. I'm not in the right moment to implement a answer but fot lnd you can flow the comment under this PR https://github.com/lightningnetwork/lnd/pull/2373


text:
Is it possible to get my bitcoin out of Strongcoin without paying the exorbitant transfer fee?
I have Bitcoin held in Strongcoin's service, and want to transfer it out. The Strongcoin FAQ (last updated 2011) says the transfer fee is 1% (which I'm prepared to put up with) with a minimum fee of 0.004BTC (which I am not). I've verified that it does intend to charge 0.004 BTC for the transfer.
My impression is that this minimum was set a long time ago when it was a small amount of money and never updated.
I think it's not a fair transfer fee and want to avoid paying it if at all possible. Is there any way around it? I'd be happy to pay a reasonable amount closer to 0.0005 BTC.
I know the owner of Strongcoin uses this site (or at least has in the past) and I hope he can chip in here.

According to that FAQ you can export your private key. That should be enough to enable you to use a normal wallet (non-custodial) to "transfer it out" or otherwise take personal control of your own cash.

thanks @RedGrittyBrick however, though the FAQ does say that it's possible to get the private key, in reality I can't see any way to do that.