text:
Under what conditions would lightning channels be force closed automatically?
I suspect this depends heavily on the implementation, but maybe someone can shed light on the circumstances that would lead an implementation to force close a channel automatically.
A user asked this on stacker.news but I know all the wizards are on here.

Nobody in the right mind will force close a channel manually, without a reason. We all do that cooperative close, if a peer is still online and we really need to close that channel.
But automated force closing are really frustrating.
Let's make a list here of all situations, considerations, reasons, causes etc that a channel will be automatically force close and also if you know what steps to do to avoid them.
We have many LND nodes with this situation, few CLN and even fewer Eclair nodes.
Possible causes:

some incompatibility between LN implementations ?
different CLTV delta settings between peers?
too many HTLC on the fly for long time?
a minimum time a node can be offline?
too many commit changes for a channel in a certain time?
bad reconnectivity?

Answering from the perspective of the node that triggers the force-close:

Outgoing HTLC times out (i.e., peer doesn't settle/fail in time, which can happen if the peer is offline/unreachable)

There are plenty of special cases, including bugs, though. One fun example: on a payment A-B-C-... where I'm A, node C drops dead. The HTLC between B and C times out, B force-closes. The force-close transaction doesn't confirm in time (because B doesn't bump the fees), so the HTLC between A and B also runs into a time out and A force-closes the channel.

Bugs like https://github.com/ElementsProject/lightning/issues/4649
Incoming HTLC times out (I don't know the specifics, but I've seen force-closes where my peer's force-close transaction contained an HTLC that my force-close transaction doesn't have)
Peer asks for force-close (recovery mode, "hey, I lost my channel state, please be so kind and broadcast your most recent force-close tx, kthxbye")
Trivial: You trigger the force-close manually

Is there a way to upgrade your system, which generally takes time and rarely goes without a hitch, without resulting in a bunch of force closures? Disable all channels? Anything?

Usually, a couple of hours of downtime are OK. You can wait until your node doesn't have a pending HTLC to reduce the disk. In the past 5 years only did that for major updates, not simple reboots.


text:
I'm trying to send Bitcoin but it's telling me I need a pin to send it why?
I want to send Bitcoin to my wife because she's out of town and needs some money that's the only way I can give it to her but it's asking me for a pin what is my PIN I have no idea what it is or why it's even on please help?
      Thank you for your time

Who/what is "it" exactly? You need to be more specific, but it sounds like you are using a wallet service/provider of some sort in such case you need to contact them.

Do you not know the pin code you set up?  Maybe ask your wife if she's the one that set it up.

I recommend using Venmo or wiring her money via western union. Its probably faster than the 20+ hours youve already waited for an answer to this question.  How do you guys not have mainstream payment options available to you?  Where are you even at that having crypto is even essential to your daily lives?

I recommend you triple check that you are not being scammed.

Most likely the wallet software or hardware you are using has a password attached to it in the form of a PIN - which is a string of numbers that you use to decrypt the private key, so that you can create and sign transactions.

source: Stack Exchange

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

sort: votes


text:
Do you know a company called BLOCKCHAIN with email address "bitcoinrefunds.finance"?
In February 2022, I was contacted by a company BLOCKCHAIN (email address terminating by bitcoinrefunds.finance). They informed me that they can help me to recover previous investement in cryptos.
They told me that the money is blocked in a trust account by JAXXLIBERTY and that to release it I must obtain authorization by sending an important amount of money.
JAXXLIBERTY support (teamsupport@jaxxliberty.io) confirmed me that they will release my money as soon as they receive the money for authorization.
Is that a normal procedure?
Can I believe in BLOCKCHAIN?

No the company Blockchain should be contacting you using a blockchain.com email address. This looks like a scam to me.

It's almost certainly a scam, like many, many others surrounding recovering cryptocurrency funds. We get a lot of spam about such things here on SE, particularly on this SE site. In fact, your question has enough keywords which are similar to such spam such that it may be seen as such upon first glance (and, unfortunately, is, effectively, beneficial for them, given how search engines work).

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


text:
Transaction can not be found
Sender shows bitcoin being sent be it can not be found when I look for it in blockchain explorer nor can the send produce a transaction number

When using bitcoin, you don't have to trust anyone to tell you if you received a transaction, you can verify it for yourself.
To do so, you can run a bitcoin 'full node' (such as the bitcoin core software), and then query the node to find the transaction in question.
Failing that, you can check to see if your wallet software has received a new transaction.†
Failing that, you can check an online block explorer service to see if the transaction exists.†
If any one of these methods doesn't reveal the transaction in question (and your software is otherwise all properly synced with the network), then there is no reason to believe the person who said they sent you funds actually did. They may have encountered a software issue, or they may be attempting to defraud you.
†both of these methods involve trusting someone else to do the validation steps for you, but it is perhaps better to trust a third party, that has little economic incentive to defraud you


text:
Characteristics of fraudulent Bitcoin transactions
I have a few questions about Bitcoin fraud investigation.

What are the characteristics of fraudulent bitcoin transactions? For example, I've read some articles saying that a transaction that has only 1-2 inputs but comparatively too large number of output addresses (e.g. 60) can be considered suspicious because there's a chance that the transaction has been used for money laundering. I'd like to know which features I should look at in order to find fraudulent patterns in Bitcoin transaction data: transactions with the very small number of input counts but extremely large number of output counts, transactions with the extremely high number of input counts but small number of output counts, etc.

Which pattern would be more suspicious: a transaction that has 1 input count but 100 output counts OR a transaction that has 100 input counts but 1 output count?

Is there a way to extract geographic information of Bitcoin transactions? For example, there are some websites that show a world map that is color-scaled based on the number of transactions that have occurred in each country. I wonder how they get the geographic information of each transaction.

1 ...  I've read some articles saying that a transaction that has only 1-2 inputs but comparatively too large number of output addresses (e.g. 60) can be considered suspicious

That doesn't seem right to me at all. There are many genuine and innocuous reasons for constructing such a transaction: an exchange batching withdrawals, paying dividends to shareholders, A football-pools consortium distributing winnings, a business paying employees, etc.

Which pattern would be more suspicious:

Neither

Is there a way to extract geographic information of Bitcoin transactions?

There is no geographic information in the transaction data.
With large scale forensic blockchain analysis, you might make some inferences but that would be unreliable guesswork.
An ISP could perhaps measure the number of TCP packets associated with port numbers typically used by Bitcoin's peer to peer protocols. E.g. TCP port 8333. Unless you are running Internet backbone infrastucture and interconnects, you won't have access to this. The results will be distorted by various factors such as use of TOR. This doesn't tell you the location of the person who constructed the transaction, only regions that are active in passing on Bitcoin data.
The notion is also a bit simplistic. If I have a business with offices in five countries and an employee in France connects to a computer in the USA to issue a payment from a Bitcoin node in Australia to the UK subsidiary of a business headquartered in Italy whose custodial wallet is run by an exchange based in the Seychelles, what country did that transaction, mined in China, take place in?


text:
Sending Money to a Bitcoin Address
I would like to know how to send money from one’s debit card to a person’s Bitcoin address. Is it possible to do this without having to create one’s own Bitcoin wallet?

It sounds like you want to buy bitcoin.

Does this answer your question? Can I send Bitcoins without a wallet

Thank you. I will read that discussion. It may contain the answer. I want to explain to a person how to send money to my Bitcoin address. The person does not have a Bitcoin wallet. Therefore, I need to know how he can send the money from his bank account.

Thank you for the information. If I understand correctly, to send money from a debit card to a Bitcoin address, it is necessary to visit a service like Coinbase, create an account in this service, and enter one’s debit card information and the Bitcoin address to which the money will be sent. Is this correct, or is something else needed?
Are fees for transfers usually small?


text:
Create electrum server with bitcoin core
I installed bitcoin core pruned node today on my laptop. I want to connect my blue wallet to my bitcoin node I created with bitcoin core. I read somewhere that for it to happen I need to have electrum server. So can someone explain how to create electrum server with my bitcoin core to connect to my blue wallet

You need to install an Electrum server from outside of the Bitcoin Core software, there are various options: Electrum Personal Server, electrs, ElectrumX.
Alternatively you may be interested in Bitcoin Wallet Tracker (BWT) which offers more options including a one click setup and Electrum wallet plugin option.
BlueWallet also provides some Electrum servers to connect to if you want to use those.

How can I connect my blue wallet to my bitcoin core prune node?

I struggled a lot to connect Electrum <-> EPS <-> Bitcoin Core, especially 'cause of the .cookie path, the certificat problem, the configuration of config.ini and the 127.0.0.1 cookie file of Electrum.
There aren't lots of helps on Windows. That's why i've decided yesterday to do a full-explained tutorial on youtube, which explains everything: how to do, how to resolve all configuration problems, etc...
Link: https://www.youtube.com/watch?v=wxiH8hG9G-4&ab_channel=ProfEduStream
It's in french, but you can add subtitles on your own langage.
Hope it gonna help the community.
Bye

Welcome to Bitcoin.SE! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Since your link also is to your own content, it's generally advised to disclose that. However please avoid excessively promoting your own content here, this is not an advertisement platform.


text:
How to reset bitcoin testnet / signet / regtest in newest bitcoin core
The testnet data directory is not ~/.bitcoin but rather ~/.bitcoin/testnet3. ~/.bitcoin holds the data for the main Bitcoin blockchain.
the files are still there but deleting them wont work anymore.
so how do i delete all block history and transaction history now from testnet /regtest/signet ?
if i delete the files you mentioned nothing is happening . still get 3 years and 8 months loading ....
all help is welcome thanks in advance

yes i know if i do that and than try again nothing happens the memory just stays the same its not that simple . even if i command make after deleting and try again its still the same memory, i also deleted all chainparamseeds,.h and in chainparams adjust the minchainwork etc .

If you delete just the chain's data, it will obviously download it again from the network. Are you by any chance asking about how to create a new empty chain instead?

im asking exactly what i was asking it has nothing to do with an new chain ,just how to delete the testnet chain data.

is there anybody who can help? please


text:
How do I find my missing bitcoin on Bitcore?
I recently tried to send bitcoin to my Bitcore wallet and it shows completed on Coinbase side, yet its not in my wallet. Anyone know what to do?

I recently tried to send bitcoin to my Bitcore wallet

bitcore.cc is a different currency (BTX) to Bitcoin (BTC). If you send BTC to a BTX wallet you may lose your money.

bitcore.io is "A powerful, modular node for bitcoin and blockchain-based apps." - I believe it is primarily aimed at developers - It isn't simply a Bitcoin wallet. It does include a wallet. If you are using that, you'll need to ensure the rest of the Bitcore suite is properly configured and up and running and, if necessary, synchronised.

If you are using some other wallet - remember that transactions can take a while if you set a low fee:

Why is my transaction not getting confirmed and what can I do about it?

You have definitely lost money. I made a similar mistake(( I read https://cryptoine.com/biswap/ that there is no fix or refund


text:
Multisig Transaction Failure with High Threshold: 'Signature Must Be Zero for Failed CHECK(MULTI)SIG Operation'
I successfully created a transaction using a 3-of-4 P2SH script, but the transaction failed when attempting with a 5-of-8 P2SH script
mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)

Multisig script
In this script, the accounts have different thresholds: Account 1 (1 threshold), Account 2 (2 thresholds), and Account 3 (2 thresholds).
OP_5, 02b509e03e5773ad6864d037eb1c8f9e9c39698bc5b59272d7f2156da2070d810f, 0369cc1b70ded5caf25b42b59ae13bdbee386e5dcaa0612a2a258dec0236404068, 0369cc1b70ded5caf25b42b59ae13bdbee386e5dcaa0612a2a258dec0236404068, 02b8e455ffa2c6a81f454977cec08238273247b28f2d54640101969ee97ab9904c, 02b8e455ffa2c6a81f454977cec08238273247b28f2d54640101969ee97ab9904c, 03515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e8, 03515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e8, 03515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e8, OP_8, OP_CHECKMULTISIG

script sig
[, 3044022007e8bdddd72b19d98c9b071d07d1bce3fd229e61ebff5ecc08dde6349a0498ff022020ac00940280c550e8b8e5608cd676a6e490dd32dedf2e698fe5cbce28e73e2c41, 304402202c10429b2f289375afab14791a1083c8d02a49b61ec43cfa2ab846c1c568f0910220058c706723d940688ba15c4e3bea7915c168a9b271d5e9fd17024f1c2ed90dd841, 304402202c10429b2f289375afab14791a1083c8d02a49b61ec43cfa2ab846c1c568f0910220058c706723d940688ba15c4e3bea7915c168a9b271d5e9fd17024f1c2ed90dd841, 304402207f2c49daaca179bb80801bd29a06194af9753c8295fd2c5d32d344970db0c9a202202954795b717929142198a4b71b28d07434f56331f460930fc02e3d5a1345dc5341, 304402207f2c49daaca179bb80801bd29a06194af9753c8295fd2c5d32d344970db0c9a202202954795b717929142198a4b71b28d07434f56331f460930fc02e3d5a1345dc5341, 552102b509e03e5773ad6864d037eb1c8f9e9c39698bc5b59272d7f2156da2070d810f210369cc1b70ded5caf25b42b59ae13bdbee386e5dcaa0612a2a258dec0236404068210369cc1b70ded5caf25b42b59ae13bdbee386e5dcaa0612a2a258dec02364040682102b8e455ffa2c6a81f454977cec08238273247b28f2d54640101969ee97ab9904c2102b8e455ffa2c6a81f454977cec08238273247b28f2d54640101969ee97ab9904c2103515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e82103515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e82103515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e858ae]

sig hash
SIGHASH_ALL | SIGHASH_FORKED

transaction
0200000001af7c864e4ce68328d8ecb97a07a99e39242dd2d3ef35764f415bef38430af04401000000fd7f0200473044022007e8bdddd72b19d98c9b071d07d1bce3fd229e61ebff5ecc08dde6349a0498ff022020ac00940280c550e8b8e5608cd676a6e490dd32dedf2e698fe5cbce28e73e2c4147304402202c10429b2f289375afab14791a1083c8d02a49b61ec43cfa2ab846c1c568f0910220058c706723d940688ba15c4e3bea7915c168a9b271d5e9fd17024f1c2ed90dd84147304402202c10429b2f289375afab14791a1083c8d02a49b61ec43cfa2ab846c1c568f0910220058c706723d940688ba15c4e3bea7915c168a9b271d5e9fd17024f1c2ed90dd84147304402207f2c49daaca179bb80801bd29a06194af9753c8295fd2c5d32d344970db0c9a202202954795b717929142198a4b71b28d07434f56331f460930fc02e3d5a1345dc534147304402207f2c49daaca179bb80801bd29a06194af9753c8295fd2c5d32d344970db0c9a202202954795b717929142198a4b71b28d07434f56331f460930fc02e3d5a1345dc53414d1301552102b509e03e5773ad6864d037eb1c8f9e9c39698bc5b59272d7f2156da2070d810f210369cc1b70ded5caf25b42b59ae13bdbee386e5dcaa0612a2a258dec0236404068210369cc1b70ded5caf25b42b59ae13bdbee386e5dcaa0612a2a258dec02364040682102b8e455ffa2c6a81f454977cec08238273247b28f2d54640101969ee97ab9904c2102b8e455ffa2c6a81f454977cec08238273247b28f2d54640101969ee97ab9904c2103515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e82103515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e82103515a9b03688488850dd184e9229cb43634c1a39e2ccc5b8f2cf2c0a8cebb92e858aeffffffff02a0860100000000001976a914e54b088d7f501604b1d85ed9d30f46b5db721ac288acaab80d000000000017a914f0115e1442ada4d9e13be0de2d9597e3d3784e608700000000

I don’t think "SIGHASH_FORKED" exists in Bitcoin. Is it possible that this question is about another cryptocurrency?


text:
Question about Multibit Core wallet - not sync
I hope you are alright.
I asked you for help.
I had the Multibit Core software wallet installed on my system and after a few years I now wanted to run and transfer my bitcoin balance.
From the time the software is opened, the software starts to sync, but my sync time is very long and it is almost 7 days now, my system is on and it has not been synced yet and it remains at 87% and practically does not move.
What can I do to sync faster and fix this problem?
If you have experience with this, please help.
Thank you.
I will attach an image of the software environment.

I'm afraid that this looks like another instance of the "BitlyCore malware" that was previously making the rounds, see e.g. Help about BitlyCore.
The client's name appears to be a mash-up of Bitcoin Core, the reference implementation of Bitcoin, and MultiBit, a wallet software popular between 2011~2014 that was sunset in 2017.
I hope you didn't receive any funds to addresses generated with "Multibit Core". You should treat this piece of software with caution and probably get rid of it as thoroughly as you can.


text:
Account Extended Public Key from mnemonic
tell me please, how we can receive Account Extended Public Key from mnemonic phrase via PHP or Python? Or possible in internet we have ready console scripts?
I'm going to https://iancoleman.io/bip39/ converter, and put mnemonic phrase
fetch detect laugh camp coil salute any guide scheme monster alone slot
in field BIP 39 Mnemonic. After I selected BIP84 in Derivation Path.
After this in field Account Extended Public Key we received correct Account Extended Public Key:
zpub6sApCAVpVCnUJQbmPfjepgCtNW1781fiD2ChuPdEs2oWEDpgKh5QJdcSJJL29Q5XwiJ2WvWo71eteRubzDmGH1SYMhg2cL7Um8uYbnVGk6A
Thanks.
I will thank you for help.

Using this python library
>>> from cryptotools import Xprv
>>> xprv = Xprv.from_mnemonic('fetch detect laugh camp coil salute any guide scheme monster alone slot', addresstype='P2WPKH')

>>> zpub = (xprv/84./0./0.).to_xpub()
>>> zpub.encode()
'zpub6sApCAVpVCnUJQbmPfjepgCtNW1781fiD2ChuPdEs2oWEDpgKh5QJdcSJJL29Q5XwiJ2WvWo71eteRubzDmGH1SYMhg2cL7Um8uYbnVGk6A'


text:
How can i recover my specific wallet using the 12 word mnemonic?
I just can't understand how can i use the 12 words instead of writing all the numbers related to the address/private/public keys. When i go to iancoleman.io the output is several addresses, private and public keys...but from all of this how can i get my own?
And all the private keys that come with the output, were they not supposed to be private? Can't someone just use them to transfer cryptos? This is really confusing for me.

The twelve word mnemonic phrase is a recovery phrase, also sometimes called a seed phrase or backup phrase. Knowledge of this phrase gives anyone control over all money in a typical wallet. The purpose of this phrase is to allow you to re-create your wallet if, for example, you lose, damage or destroy the device on which it is installed.
You must keep your recovery phrase secret.
From the recovery phrase a new wallet installation can generate a  seed number and a master private key. From that one number, a Hierarchical Deterministic (HD) wallet can generate further private and public key pairsas needed. All of these individual private keys also need to be kept secret.

Examples

https://bitcoinelectrum.com/restoring-your-standard-wallet-from-seed/

You don't need to write down all the keys, you just need to write down the mnemonic: all keys are calculated from the mnemonic. The same mnemonic in different wallets will calculate the same keys.
You will end not with one, but with several private keys (and corresponding public keys). For privacy reasons you should not use the same public key twice in transactions (people will find out those two transactions belong to the same person). That's why wallets generate new key pairs (public + private) for each transaction.
But don't worry, your wallet will do this for you. You just need to write down the mnemonic and keep it safe.
For a more technical dive on how this work, check this out.

With a BIP-compliant HD Wallet, you need not concern yourself with the addresses and privkeys yourself, everything is deterministically generated from your Seed Recovery process.
So, first off, is your account-wallet's 12-word mnemonic BIP39 compliant? Some wallet-clients like Electrum can use proprietary schemes.
Next, did you make use of a BIP39 passphrase? That is just as much part of Seed Recovery as the mnemonic.
Next, did you stick to standards-based Derivation Paths in setting up your node tree?
There are wallets using exotic derivation paths with BIP39, completely arbitrary private/public key trees.
So, it may be necessary to know which wallet-client software generated the account-wallet's seed, maybe even which version. And which client you want to restore your account-wallet to.
Also what coins / networks, script type (SegWit?)
Gap limits may come into play as well.
None of this means your assets are not kept safe on the blockchain, so long as you keep hour Seed Recovery secret, obviously never enter into any device capable of connecting to the internet.
More like, all these other factors may prevent your new wallet-client from automatically "discovering" your assets and showing a correct total balance, without your needing to give it more information.
Some wallet-clients only support a single Account / path per Seed wallet, others are multi-account.
https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#Account_discovery
https://walletsrecovery.org


text:
Where do I find a private key in litewallet.io?
I have created this public key LUv2h4kHH21bJSmab2UAvBarLmSckWFASS in a mobile app called litewallet.io which can be found here https://litewallet.io/ but I do not see an option in litewallet to display private key.
Instead the litewallet secured my account with 12 words phrase.
I need private key because I want to import that to my Litecoin Core wallet.
How do I find the private key of that public key in LiteWallet?

You have to use https://iancoleman.io/bip39/ (offline), import your 12 seed then select litecoin on coin tab.

lol, im not giving anybody my 12 seeds as they can steal


text:
Error validating transaction ... Script was NOT verified successfully
I'm getting this error below when trying to broadcast a transaction with the code below. I'm new to blockchain development and I've been trying to solve this but can't seem to figure it out. I believe I'm inputting incorrect values, but I'm unsure which, could someone let me know? Let me know what other details you need.
Transaction Hex:
02000000000101ed651c31084977c5125c975b0831b01504ac5888b2b8596005a5b2cb88627b670000000017160014dd8ad4d50e55c26ce36be3eb3ec2bbf44615d9a4ffffffff01282300000000000017a91416d7b959cf850264a10e55c2f2b7d85cfacd5059870247304402205c21b8f3e1187ff1963aa3f7ab27054c12d634a18f25038e21a20dd1869440cb022051abe3dd1b6ded962f2a60aa0d419734aa1daa494b5edfded0b935ff3227f656012102e472751c45225337885f86e50e41912424f3831d7d5b1a5a2958cd618507b03b00000000
Error validating transaction: Error running script for input 0 referencing 677b6288cbb2a5056059b8b28858ac0415b031085b975c12c5774908311c65ed at 0: Script was NOT verified successfully..
const bitcoin = require('bitcoinjs-lib')
const network = bitcoin.networks.testnet

const keyPairAlice1 = bitcoin.ECPair.fromWIF('cMz5Wmw7ee7x57Tbm1W77Apf9AkE9uJy19fqaGVfBdnRoFDL9Bus', network)
const p2wpkhAlice1 = bitcoin.payments.p2wpkh({pubkey: keyPairAlice1.publicKey, network})
const p2shAlice1 = bitcoin.payments.p2sh({redeem: p2wpkhAlice1, network})
const redeemScript = p2shAlice1.redeem.output.toString('hex')

const psbt = new bitcoin.Psbt({network})
  .addInput({
    hash: '677b6288cbb2a5056059b8b28858ac0415b031085b975c12c5774908311c65ed',
    index: 0,
    witnessUtxo: {
      script:
        // Buffer.from('0014dd8ad4d50e55c26ce36be3eb3ec2bbf44615d9a4', 'hex'),
        Buffer.from('a914' +
        bitcoin.crypto.hash160(Buffer.from('0014' + 'dd8ad4d50e55c26ce36be3eb3ec2bbf44615d9a4', 'hex')).toString('hex') +
        '87', 'hex'),
      value: 10000,
    },
    redeemScript: Buffer.from(redeemScript, 'hex')
  })
  .addOutput({
    address: "2MuL1HGkV9hAmGwefCAr4fa2Kk63CHYFo6u",
    value: 9000,
  })

psbt.signInput(0, keyPairAlice1)
psbt.validateSignaturesOfInput(0)
psbt.finalizeAllInputs()

console.log('Transaction hexadecimal:')
console.log(psbt.extractTransaction().toHex())


text:
Are crypto servers updated with code in transactions?
If the code used to run your crypto coin node needs updating, how is it done?  Is the code sent as a patch as a transaction?  Does the node code know how to receive and apply this patch?  Or does someone just say "Hey, update your code."

Bitcoin node operators will either

Make it a habit to keep a look out for new versions of the software they are using and update their software (after reversible testing if they are sensible)  or

Hear from someone about new features that interest them or bugs that concern them and decide to update their software.

In the case of Bitcoin Core, you can download and install the new version in a fairly straightforward way so long as you havent made extensive configurations changes.

The Bitcoin network protocol doesn't have explicit support for software distribution.
Any network protocol used for automated distribution and automated installation of financially critical software would probably have to handle digital signatures of code, out of band key distribution, key revocation and a large number of other things that are difficult to get right and catastrophic if you don't.

If the code used to run your crypto coin node needs updating, how is it done?

There is no such thing as "needs updating", or at least no entity that can decide this. While protocol updates happen, it is up to individual users to decide whether to adopt the code changes for it. For invasive changes ("hardforks"), non-adoption does result in old and new nodes to effectively operate on different networks with different currencies, but Bitcoin hasn't had any such changes since 2013 (and even that one was by accident, see BIP50; the last deliberate hard fork was very early in its history in 2010). For normal protocol changes, most users can upgrade at their leisure - or not at all, due to backward compatibility.

Is the code sent as a patch as a transaction?

Who would get to decide to send such a patch? Wouldn't that person or entity not effectively decide what transactions are valid? That would run entirely counter to the problem the system is designed to solve.

Does the node code know how to receive and apply this patch? Or does someone just say "Hey, update your code."

This happens through normal software upgrading practices. Developer teams for node software will release a new version, and users can decide to install the update or not. The vast majority of all changes to node software is entirely unrelated to protocol changes, but as explained above, even the ones that do include protocol changes are generally not mandatory.


text:
How does the mining network know/agree when a block has been defined and thus needs to be mined? (The hash determined.)
Based on my understanding, the blocks are made up a group of transactions.  But somehow, the network needs to both agree on which transactions are part of the block and also (I would think) the order of these transactions.  How is this done?  I assume there are lots of transactions going on and I don't know how all parts of the network know exactly what constitutes the next block.

The network does not need to agree on what the next block looks like, until it has been mined. Miners act independently to create new blocks, each miner can (and probably will) include slightly different transactions, in a slightly different order, in the block templates that they are mining on. In fact, a miner could fill a block up entirely with otherwise unbroadcast transactions, that no other node on the network would have knowledge of before that miner published a valid block containing said transactions to the network.
The blockchain record is the method by which the network comes to independently agree on the specific ordering of transactions. Until the time at which a new, valid block is added to the chain tip, nodes on the network will not know what the next block will look like.

Does the block have to have a certain number of transactions?

@Jiminion each block will contain a coinbase transaction, but after that there is no specified number of transactions required. It could have none, or it could be full (up to the weight limit)


text:
What are the steps from crypto exchange, to cold wallet, to bank account?
My apologies if these questions have been asked and answered before.
I am relatively new to crypto. I started mining Bitcoin back in June (2021) using Nicehash Quickminer (www.nicehash.com)
I have also managed to transfer some of my Bitcoin over to Crypto.com in order to trade for other coins not available on the Nicehash exchange.
Basically, all of my coins (I own maybe 15 to 20 types of crypto now) are currently living on the exchanges mentioned above.
I heard that keeping your coins on an exchange is unsafe and that they should be moved to a cold wallet when not used for trading. Which cold wallet? What are the differences between all the cold wallets? Is a hardware wallet safer than one online? Do all places hosting online wallets hold every kind of crypto?
And finally, when it comes time to trade in my crypto for actual currency (CAD in my case), what needs to be done? Do I connect my bank account to whatever site is hosting my wallet? Do I have to put the coins on the exchange and trade them for CAD there, before moving the CAD to my bank account? How long do transactions take? Will I be paid at the rate displayed when I clicked SELL or at whatever rate is there when the transaction is completed?
So many questions, but I'm basically asking for a roadmap of how the coin goes from mined to bank. This is not specific to Bitcoin.

Welcome to bitcoin.stackeschange.com. This Q&A website only addresses questions about Bitcoin, not altcoins and works best when you ask one question at a time. I suggest you edit the question to focus on the one Bitcoin question that is most important to you right now.

I think you have two main questions -

What is safe way to keep coins?
What is the process to convert coins to Fiat money when needed?

Answer-1: Hardware wallets are safest like Trezor, Ledger etc, you can research more about how do they differ and buy based on that. Software wallets are bit less secure but wallets like Electrum provides ways to make them super secure if you use their multisig features. You can search and learn more about Electrum, though it works only for BTC. There are other software or hot wallets but I would recommend hardware wallets for sure. Whatever wallet you use, do follow their backup mechanism so that you can restore your coins if something happens to the wallet. Cold and hot wallets have their own software to help you do all of these. To send money to wallet, generate a address in wallets software then go to the exchange where your coin is and withdraw to your wallet’s address. it is that simple.
Answer-2: To convert to Fiat money, you will need to go to your exchange account, copy receive address from there and then send the coins from your wallet to the exchange address. Cold wallets have their own software to help you send the coins to any address you want. Once you receive coins on exchange you can convert that to Fiat money and transfer to your bank. Transfer time from your wallet to exchange really depends upon how much transaction fee you pay and how clogged the blockchain network is. In Bitcoin case it can be 10 minutes to few hours based on fee you paid. From exchange to Bank really depends upon bank transfer timelines and your exchange can let you the estimated time.


text:
One time donation using bitcoin from creditcard or bank-account
How would I go about making a one-time donation in bitcoin if I don't want a get a bitcoin-wallet?
Think about getting money from an ATM abroad, the money is in my account in currency A, but I get it in currency B from the machine. Is there anyplace I can change euros for bitcoin and pay them to someone else in one step?
The question was asked before but the answer is not valid anymore, the company named in that answer (https://www.litebit.eu/) does trading.

I don't recommend it, but you probably can. Upon withdrawal from an exchange, you will be asked to provide a deposit address to send the funds to. If you give the address of who/whatever you want to donate to, the funds will go there.
As for what exchange to use, such advice is off-topic on this site.

Why is this not recommended?


text:
Payout address format has changed?
When I run bitcoin-qt, it sets up a default wallet. When I ask it for the recipient address for this wallet, I was expecting something like 1FGasdfasdfasdf123asdfasdf. However what it actually provides is BC1QNZasdfasdfasdf... In fact there seems to be no way to induce bitcoin-qt to divulge an address in the form of 1FGasdfasdfasdf123asdf... Can someone clear up what the BC prefix is all about? I'm using the main Bitcoin blockchain (350 GB in size), not Bitcoin Cash..

This is a BIP173 native segwit address.
If you unselect the "Generate native segwit (Bech32) address" checkbox in bitcoin-qt, you'll get a P2SH 3xxx address instead. Most senders these days support sending the BIP173 addresses though, which are cheaper for you to use.
The GUI no longer supports creation of legacy 1xxx addresses by default. You can override this by starting bitcoin-qt with the -addresstype=legacy command-line option. There is no reason for preferring these, except for test purposes.

If I want to run a solo mining experiment, don't I need the 1xxx format to give to bfgminer or cgminer as the generate-to address?

I have no idea, but if you really need a 1xxx address, you can use RPC or the debug console: getnewaddress "" legacy.


text:
Can I merge blockchain downloads?
I downloaded the most recent 15GB of the Bitcoin blockchain. But I also have a back up from a year ago when I downloaded some more. Can I merely copy the old blockchain files into ~/.bitcoin and have bitcoin-qt recognize them automatically? I ask because I don't want to damage my current set of files.

You can't merge them, but you can just copy the old blocks/ and chainstate/ subdirectories of an old install that you trust. It'll just continue where you left off then.


text:
I have to move homes, so my Bitcoin/Lightning node will be offline for around 1 day
I have to move homes, so my Bitcoin/Lightning node will be offline for around 1 day.
What happens in this case to my Lightning channel? Will I be penalised for being offline by the system? How should I deal with this?

You have to make sure that the channels you opened have sufficient time locks that your partners can't make an attempt to cheat you. (Even if your timelocks are less than a day your partners might not try to cheat on you as they will not know that it is less than a day)
next you just turn off your node which sends out gossip messages to the network. you relocate and you turn your node on again. The protocol does not care about your uptime and penalise you. However there might be some nodes that try to monitor uptime and penilise you. But the individual behavior of participants is beyond the scope of our knowledge

Thanks Rene! You're a star.


text:
Is there a way to get all addresses from an xpub key?
Hi I am trying to implement a feature where a user can enter their xpub key and get a list of their transactions and their balance. To do this I think I need to get all the wallet addresses from the xpub key and then loop over them using an api like chain.so
Does anyone know of a good api or library that can be used to derive all addresses from an xpub key?
Also for context I use node js on the server.
Thank you!

Does anyone know of a good api or library that can be used to derive all addresses from an xpub key?

I suspect you can do this using the bx tool.
The linked page describes how to create hd public keys and convert those to addresses.
bx seed > seed
bx hd-new < seed > master
bx hd-private --hard < master > account
bx hd-public --index 0 < account | bx hd-to-ec | bx ec-to-address
bx hd-public --index 1 < account | bx hd-to-ec | bx ec-to-address
bx hd-public --index 2 < account | bx hd-to-ec | bx ec-to-address

The above seems to work for me.
Since bx is supplied as part of libbitcoin, I imagine that library can be used to produce addresses.

The libbitcoin toolkit is a set of cross platform C++ libraries for building bitcoin applications. The toolkit consists of several libraries, most of which depend on the foundational libbitcoin library. Each library's repository can be cloned and built using common Automake instructions.


text:
Is it possible to know whether a bitcoin transaction is a mining transaction?
Hi I am currently building financial software to help users keep track of their bitcoin transactions. I have tried a couple of different apis and am currently using chain.so to get a user's bitcoin transactions.
My question is it possible to somehow identify a user's transactions as mining transactions? Thank you!
Here is an example of a user's mining transaction for context: https://chain.so/tx/BTC/4e17089eb2e95695f082b5b7570fee8c7544b382ed32ab9dedfd0a6512c4ac35

Hi! Just to clarify, by "mining transaction" you mean a mining pool payout transaction in which a mining pool distributes mined coins to its users?

Hi @VojtěchStrnad, thats exactly right. yes

Mining pool payout transactions are not special in any way. They are not a separate type of transaction that is uniquely identifiable from other transactions on the network. There is no way to be sure that a transaction is a mining pool payout transaction other than by asking the pool(s).
There are some heuristics that you can use, but they are just heuristics and may miss some transactions or falsely identify transactions. For example, a transaction that pays several recipients and was not seen on the network before being seen in a block could be a mining transaction, particularly if that transaction also does not pay a fee. The addresses used by several mining pools are known, and so transactions involving those addresses may be payout transactions as well.
However these are not guarantees. In the first case, it is not possible to be sure a transaction was not broadcast before being mined. You can only know whether your own node(s) has seen it. Additionally, not all non-boradcasted transactions are created by miners. They may be accepting transactions out of band, as well as fees out of band, so not all 0 fee transactions are also miners'. And looking for the well known addresses may also catch transactions to/from cold storage, and just generally other business transactions that are not related to payouts.

Of all the recent payout transactions I looked at, it seems only F2Pool actually creates zero-fee transactions and mines them themselves, everyone else's pay a fee and are mined by anyone.

Remarkably, the latest zero-fee transaction with a single input and between 90 and 2802 outputs was mined in April 2020 (current F2Pool payout transactions generally have around 3000 outputs). And if we only consider non-coinbase transactions, the latest one was mined in December 2017.

There is no method to know for sure if a transaction is a mining pool payout transaction, but a few heurstics can be applied to give you confidence that that's what you're looking at.
Outputs
Just like exchanges processing withdrawals, mining pools batch payouts into a single transaction to save on fees, and so the transaction will have many outputs. It's up to you to set a minimum threshold to consider a transaction for further evaluation (your example transaction has 58 outputs, one of which is clearly a change output).
Next, if you look at your example transaction, you can see that many of the output amounts are just sligtly over 0.001, 0.005 or 0.01. Clearly many of the mining pool users have set up automatic payouts after some threshold amount (indeed, if you look at the addresses receiving the coins, you will see that they have been re-used and have received similar amounts many times in the past). This pattern can be seen in payout transactions of other pools as well, but not in batch transactions coming from exchanges (to my knowledge no exchange implements such a system of automatic withdrawal after a set threshold), so it helps differentiate the two.
Transaction chain
If you follow the single input of your example transaction to its previous transaction, you will again see what looks like a mining pool payout transaction, again with a single input. You can follow these inputs for a total of 8 steps until you arrive at the transaction 7ea0061d3d5c1d04f8ffa65a33ee0ea056dfaad071bad13c29db6ee3f468e0d3 which consolidates 5 UTXOs mined by Luxor Tech (as evident from their coinbase inputs). This gives us good confidence that those transactions in the chain really were mining pool payout transactions, but also what pool they belong to.
Other mining pools might have slightly different looking transaction chains leading to coinbase transactions, so getting this heuristic right will probably require some experimentation.
Static addresses
Finally, some mining pools seem to re-use an address for many payouts. For example, the address 3FxUA8godrRmxgUaPv71b3XCUxcoCLtUx2 which can be traced to the BTC.com pool has been used in thousands of transactions, and looking at a few of them they are clearly payout transactions. You can compile these addresses into a list to check future transactions.


text:
Cloned litecoin - mweb issue, "bad-txns-vin-empty", getblocktemplate isn't working
I've cloned litecoin 0.21, trying to create a new coin. It was running well until block 1439. Then, miners stopped working because getblocktemplate was returning this:
CreateNewBlock: TestBlockValidity failed: bad-txns-vin-empty, Transaction check failed (tx hash 7f77894ebcb3xxxx)

In code, it's like this:
if (!tx.IsMWEBOnly()) {
   if (tx.vin.empty())
      return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-vin-empty");

I was unable to find the related transaction with getrawtransaction on a node with -txindex. Then I modified code to skip the tx.vin.empty check. getblocktemplate worked, I was able to mine but other nodes rejected it naturally. After that I was able to get the raw transaction:
{
  "txid": "7f77894ebcb37xxxx",
  "hash": "7f77894ebcb37xxxx",
  "version": 2,
  "size": 56,
  "vsize": 53,
  "weight": 212,
  "locktime": 0,
  "vin": [
  ],
  "vout": [
    {
      "ismweb": false,
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "8 32a71ad39691052a88bxxxxxx",
        "hex": "582032a71ad39691052a88bxxxxx",
        "type": "witness_mweb_hogaddr"
      }
    }
  ]
}

Decoding script gave following results:
$ decodescript 582032a71ad39691052axxxxx

{
  "asm": "8 32a71ad3969105xxxxx",
  "type": "witness_mweb_hogaddr",
  "p2sh": "CeRHKxxxxx"
}

$ decodescript 32a71ad39691052a88bfeb9fxxxxx

{
  "asm": "[error]",
  "type": "nonstandard",
  "p2sh": "CaiSWTDxxxxx",
  "segwit": {
    "asm": "0 c0ce9f7xxxxxxxxx",
    "hex": "0020c0cexxxxxxxx",
    "reqSigs": 1,
    "type": "witness_v0_scripthash",
    "addresses": [
      "mycoin1qcr8f7ut3gsy022rruydxxxxxxxxx"
    ],
    "p2sh-segwit": "CcDNqxxxxxxxx"
  }
}

Transaction vout says "ismweb": false but vin is empty and pubkey is witness_mweb_hogaddr, meaning it should be true instead?
Could this be a bug? How should I approach this issue? My best guess is editing chainparams.cpp and editing mweb activation caused this issue:
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].bit = 4;
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nStartHeight = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_MWEB].nTimeoutHeight = 0;

Oh also, I'm getting this when sending a tx:
$ createrawtransaction "[{\"txid\":\"83e01378c82fe86a0cebb8ad063764xxxxxxx\",\"vout\":0}]" "[{\"mycoin1qjqmp2rssgkp5gdexxxxx\":100.5}]"

0200000001d67e79dd60e5dexxxxxxx

$ signrawtransactionwithwallet 0200000001d67e79dd60e5ded6xxxxxxx

Missing amount for CTxOut(nValue=100000000.00000000, scriptPubKey=0014cb0c40a27192xxxx) (code -3)

$ decodescript 0014cb0c40a27xxxx
￼
{
  "asm": "0 [error]",
  "type": "nonstandard",
  "p2sh": "CNaVj7QRiXN5TYxxxxx",
  "segwit": {
    "asm": "0 23e055958bec23xxxxxxxx",
    "hex": "002023e055958bxxxxxxxxx",
    "reqSigs": 1,
    "type": "witness_v0_scripthash",
    "addresses": [
      "mycoin1qy0s9t9vtas3hycvufadz6a9e4lxxxxx"
    ],
    "p2sh-segwit": "CSaK1duFt2Fxxxxx"
  }
}

Note that I've tried with 99,999,999 coins (input minus 1 coin) and still getting the same issue so it's not about the huge fee.
And IDK if it's relevant, but some more configurations here from chainparams.cpp:
consensus.nSubsidyHalvingInterval = 840000;
consensus.BIP16Height = 0;
consensus.BIP34Height = 0;
consensus.BIP34Hash = uint256S("0xfa09d204a83a7xxxxxxxx");
consensus.BIP65Height = 0;
consensus.BIP66Height = 0;
consensus.CSVHeight = 0;
consensus.SegwitHeight = 0;
consensus.MinBIP9WarningHeight = 0; // segwit activation height + miner confirmation window
consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 3 * 60 * 60; // 3hrs
consensus.nPowTargetSpacing = 1.5 * 60;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 6048; // 75% of 8064
consensus.nMinerConfirmationWindow = 480; // nPowTargetTimespan / nPowTargetSpacing * 4
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;

Really appreciate the help!

apparently it's getting stuck at nMinerConfirmationWindow * 3th block. I tried setting DEPLOYMENT_MWEB start height NEVER_ACTIVE but it was still being active. So I just put 99999999 instead and it works now, as a workaround..

Hi Cagri, I'm voting to close your topic as questions about cryptocurrencies other than Bitcoin and topics concerning the development of altcoins are not on-topic on Bitcoin Stack Exchange.


text:
Which wallet is both convenient and safe for new unexperienced non-advanced user?
I consider myself as a new unexperienced non-advanced user. Even if I have got some amount of BTC in 2015.
I never used my BTC, and currently I have a very, very old wallet, the one which downloads terabites of data before BTC become available (don't remember its name). But the wallet itself is simple which I like. The todays wallets scare me by their complicity :-)
Which wallet would you advice to such an unexperienced person like me?
It should be safe, convenient, simple.
Thank you!

Possible duplicate of https://bitcoin.stackexchange.com/q/4178/5406

See https://bitcoin.org/en/choose-your-wallet


text:
Why is the nonce bruteforced from 0 to n while mining?
bitcoin noob here.
I was wondering why is the nonce increased from 0 to n while searching for a blockhash?
Why not start at some other integer > 0 for example?
My background is in ethereum-dev, so I know why the nonce needs to change, but I don't get why from 0 to n?
Thanks in advance.

It doesn't matter which nonces you test or in what order that other than you need to avoid testing the exact same block header twice (since that would obviously be a waste of time).
It's useful to test all the nonce values since if you don't test them all you will need to update extranonce more often, though not critical.
Even though miners increment their nonces in similar ways this doesn't result in the duplication of work between miners: there are a myriad number of differences between the candidate blocks miners attempt, foremost being where their reward is paid. (And pooled miners that happen to pay to the same place get different extranonce ranges assigned by the pool).  As a result there is never any work duplication across miners unless something is embarrassingly broken.
Starting at 0 and incrementing until the maximum value is simply a convenient way to change the nonce that cannot duplicate and minimizes extranonce updates. Many devices assign distinct ranges to different chips, and so don't simply increment in a simple 0 to 2^32-1 manner.
A mining device could save a negligible amount of power by changing using a linear feedback shift register instead of an adder, but no one seems to have bothered with that optimization.

Thank You for that answer, this was really helpful. But if I'm right everyone races to find a hash < target, and the first one to find such a hash gets the reward. When everyone starts at 0 and with the same extranonce, the one with most calculation-power always is first, right?
If I have less calculation-power than other ppl, wouldnt I want to try to "cheat" by not starting at 0 because other ppl would get the reward always? Did I miss something with this assumption?

I added a paragraph ("Even though...") to address that question.

Why not start at some other integer > 0 for example?

Why would you? Going from 0 to n where n is the maximum possible value means that the miner will search through all possible values for the nonce. Starting anywhere else and going to n means that some nonce values will be skipped, which means that it is possible to miss the nonce value that will get you a block.
If you wrap around back to 0 when you reach n, then that is no different from going from 0 to n. It's just harder to implement. Going from 0 to n is the simplest to implement and guarantees that you will search through all possible nonces.

"means that it is possible to miss the nonce value that will get you a block." That's not how this works. Every nonce has an equal chance of constructing a valid block; the fact that you skip some doesn't affect your chances, as long as you try the same number of candidates per time unit. The right point is that if you reduce the range of nonces, you need to change the extranonce more frequently to reach the same number of candidates per second, which is more work.


text:
Why is Target < Blockhash?
I am currently trying to validate a blocks hash against its target in python3:
This is a block in the Blockcypher testnet, and I am using this formula from the Bitcoin Wiki.
block_hash = '000055f67563d1c2cb141d06d52d2fca63ef457c553519aeb635a2643a9af0b1'
bits = '520159231'

target = hex(int(bits) * (2**(8 * (0x1b - 3))))
hash_ = hex(int(block_hash, 16))
print(target, hash_)
>>> 0x1f00ffff000000000000000000000000000000000000000000000000 0x55f67563d1c2cb141d06d52d2fca63ef457c553519aeb635a2643a9af0b1

if not target >= hash_:
    print('False)
else:
    print('True')
>>> False

Point is, that target is less than blockhash. But this should not be the case.
Can anyone help me?
Thank You for Your time.

That's because that target is represented in compact format: https://bitcoin.org/en/developer-reference#target-nbits

If you convert the difficulty bits to hex you will get:
0x1F00FFFF
Coefficient = 0x00FFFF
Exponent = 1F = 31
Target = Coefficient * 2**( 8 * ( exponent-3 ) )
Target = 0xFFFF with 31 - 3 = 28 trailing NULL (0x00) bytes
Target:
0x0000FFFF00000000000000000000000000000000000000000000000000000000
Your Hash:
0x000055f67563d1c2cb141d06d52d2fca63ef457c553519aeb635a2643a9af0b1
So your POW fulfils the target.
Just to be sure, you might want to check endianness during your conversions between int/literal/hex types.


text:
Deposit flow, user balances
I am a working on website where people should be able to deposit BTC to thier account balances and then do something with these balances. I figured out that I need deterministic wallet and generate different address for each user (based on user id) and perhaps for different deposit (based on total user deposit count - I've read that is best practicle to use 1 address for 1 transaction). I would like to be able to notify users when we see unconfirmed transaction and when it gets confirmed (add deposited amount to users balance).
Deposit flow:
1.1 on rawtx check if one of output addresses is in DB as some users deposit address
1.2 if it's some users address create new deposit in DB with 0 confirmations and mark is as pending
1.3 notify user that we can see his deposit but it's not confirmed yet and he will get BTC onto his balance once this transaction reaches 6 confirmations
1.4 on rawblock get all deposits with less than 6 confirmations and query blockchain.info to get confirmations count (see problem c).
1.5 update confirmationCount and if it's >= 6 assign coins to balance + notify user about balance change - from now on his deposit will be marked as confirmed
Now problems:
a) If server goes offline for any reason (app error/network issues/maintenance) potencially user can still deposit coins to previously copied address and we won't catch that transaction - so it will never go past 1.1. In ZMQ I can detect network issue by checking sequenceNumber (and query RPC for missing information?). I can't query all addresses on application startup to check if there were any deposits while application was down so meaby I should persist last block id (known to my app - updated after 1.4) in DB and on startup just check all newer blocks for already confirmed transactions (and perform 1.1, 1.5) and check mempool for all unconfirmed transactions and perform steps from 1.1 - 1.5.
b) My other idea of solving a) problem was to keep track of synced addresses/users in apps memory/redis. After user connects(registers/logins) check if such user was already synced in this application lifetime (this application start - node index.js, kill, node inde.js would be 2 lifetimes - I hope you know what I mean) if user is synced do nothing and if not scan all user addresses for all transactions and check if they are already added to DB. And mark user as synced. From now on 1.4, 1.5 should take care of the rest (?).
c) I would rather not use external service such as blockchain.info and just get information via RPC but whole confirmation checking flow seems complicated becuase of edge cases like double spends/block reorganization. Also I had hard time using bitcoin-core RPC (it meaby was because I first synced bitcoind and then added indexes and it's still syncing them).
d) Meaby there is some other more safe/easier/scalable way of doing such this?

These are indeed hard problems, but luckily already served by BTCPay Server, with extra features like lightning payments: https://github.com/btcpayserver/btcpayserver.
You can just run it via the included docker recipe (https://github.com/btcpayserver/btcpayserver-docker) and communicate with it via its API.
Or if you really want to reimplement the nitty gritty stuff yourself, look at its code or architecture documentation.


text:
soloxbit.com genuine or fake crypto exchange?
I am new in crypto. I know something about cryto currency and its working. Today some one suggested me soloxbit global  exchange is it a genuine crypto exchange or  not?
not enough material is available. is any one using it?

Claims "Founded in 2018" but soloxbit.com created only last month. Domain registrar in Russia. No office location. No company registration details. No ownership details, Website copies mexc.com.

I have an account there and I deposited money and traded. Now I am trying to withdraw my money, and they want me to add 0.1btc so I can withdraw my money. I have 1200usdt there. I think they are scammers, and not really an exchange.


text:
I lost my passphrase to my 150 BTC wallet
Yeah, title says it all, I lost my passphrase from my Bitcoin Core wallet I made in 2009, losing around 3.200.000€ ( 150 BTC ).
I would love to know if there's any possible way I could recover the passphrase, there is no way I remember it or that I'm able to recover it myself.

Bitcoin Core didn't exist as a name in 2009. At that time the software was just called Bitcoin (until 2014). Support for encryption/passphrases wasn't added until 2011.

There is no way to recover a lost passphrase if ...

All the written copies you made and kept in safe places have been destroyed or lost.
Any copies stamped into fireproof metal and kept in safe places have been destroyed or lost.
Your inheritence arrangements have all been lost. See Husband Father Uncle Brother You Died
You cannot remember the phrase, or almost all of it.

The passphrase (AKA password) in Bitcoin core is used to encrypt the private keys in the wallet data file. If it were possible to recover the passphrase without any knowledge of it, the wallet developers would have failed, Bitcoin core would have its reputation destroyed and no-one would use it.
It is of fundamental importance to Bitcoin core that it not be possible to do what you ask.
There are programs† which can assist in trying millions of variations of a partially remembered passphrase - but for these to have any reasonable chance of success, the amount of the passphrase that was forgotten or lost must be absolutely minimal. You must know almost all of the passphrase.

You will of course be contacted by people claiming to be able to help but they will all be scammers. Once they have gained your confidence they will promise you your 3.200.000€ in return for a small fee with whatever imaginative fee-name they think you will find plausible.

Related

Are there Bitcoin password crackers I can use to recover forgotten passwords?
†Example: BTCrecover tutorial
Forgotten password for wallet. Must a password be entered before spending?
Forgotten wallet password (bitcoin-qt)
I've forgotten the password to my wallet but can still access it, can I get my Bitcoins out?

There are services that will find your password for you as long as its not ridiculously long. I would take great care in ensuring that you chose a good service that wont just try to steal your coins once they've opened your wallet. They use specialised software to try thousands of passwords a second, and any hints you can give them will be very helpful. Also check your old emails for hints of a password.

The answer that RedGrittyBrick gave is largely right, though wrong at the edges.
For example, there were no password / passphrase complexity requirements for early Bitcoin core wallets.  So, it would be perfectly valid to assign the password "42" to your wallet. (I think this is still true in current versions of Bitcoin core).
It's practical to brute force a short password to a wallet.dat file pretty quickly. (By brute force, I mean try every possible combination of characters).
Testing every combination up to 4 characters on a mid-sized server with a couple of 3080 GPUs takes less than 10 minutes; 5 characters takes less than a day; 6 characters takes about 2 months, and the amount of time it takes skyrockets from there.
There are also other techniques that involve testing popular leaked passwords against wallets.
But, most legitimate crypto asset recovery companies will require that you have some idea of what your password could be. Otherwise, the risk increases that this isn't actually your wallet -- that it was stolen, forged, or otherwise purchased online.
You can find legitimate recovery companies. I won't mention them by name, but just make sure that they've been in business for a few years, that their founders are public about who they are, and that they've been profiled by reputable publications.


text:
bitcoin hash password
hope you doing well.
There is my question : after finding my old wallet.dat
it appear that I can't find any related project, others than hash cat
for finding my password.
So is there another way to find the password from the bitcoin hashes password?
Thanks in advance.

Does this answer your question? Forgot password

nope sorry I alread tried btcrecover. I thought there is another way like a hash password to plain text for btc.

What do you mean by "the bitcoin hashes password"? - do you have a hash of the forgotten password? That would be a strange thing to have.


text:
Age OLd bitcoin core wallet ".dat or .bak or nothing or Dumpwallet .txt or dumping pywallet "recorder type wallet ??
I have one wallet.dat "or lot of wallet", but he's valids !
why, when I loadwallet or import my dumpwallet file,
My bitcoins...
With old age, on old wallet bitcoin-qt (bitcoin core) version , but normally here,
I see nothing, not see Transactions not see bitcoin ? (0)
It is the question !

Are you sure that your wallet.dat contains Bitcoin? It may contain other types (alternative) of coins. You can check if there are other types of coins in it by using pywallet. python pywallet.py --dumpwallet --wallet=/foo/bar/wallet.dat

And another possible problem with "old wallet Bitcoin QT" is that it may not show all address transaction history, especially mined transactions. So, you should try to run your wallet.dat on a matches version to find out if there are any missing transactions/addresses or not.

python pywallet.py --dumpwallet --wallet=/foo/bar/wallet.dat – command is simple dumpwallet ? And I ve test the version anterior but I ve not possibility to open wallets !

Is your Bitcoin Core fully synced with the blockchain? If not, it may show a 0 BTC balance, so wait for it to catch up with the network.

no, why my bitcoins not here, ? blockchain here, wallet.dat here, bitcoins not here ... ! reading debug.log tell my If one bug ? possible ? think ?

what what should be the type file, of wallet bitcoin backup ? .dat, .txt or nothing point ?

should I, for the rescanblockchain, script 0 8XX XXX the height of block exact ?! Question of mempool ? possible.

wallet.dat is the bitcoin QT  backup file
Yes, Now the height of block is around 802,8xx at the time you post.        I don't know if I understand what you want to say correctly, However This seems like a long Q&A. So if you have another question please look at my profile page, there is a contact channel.


text:
hdseed, hdseed, and bitcoin-qt
in bitcoincore,
what is the use of hdseed please?
can we restore a wallet with it?
and above all an address with bitcoin on it
thank you ! for IT

HDSeed is the most important key of your Bitcoin wallet for Bitcoin Core.
With this key, you can access your whole pool of public and private keys. Which means that you have full control of the assets of that wallet.
With sethdseed true [key] in the console of Bitcoin Core, you can import a certain key pool in the current wallet. So when you download Bitcoin Core on a new PC, you can get your wallet back using this HDSeed. This seed is useful because you can write it on some paper or steel to have it safe besides having only backups on hard drives, USBs or other media.
You can find the HDSeed by using the command dumpwallet [walletname] and in that dump file you need to search for HDSeed. The big number before it, is the HDSeed. Make sure you have the right one.

in bitcoincore, what is the use of hdseed please?

See BIP32

can we restore a wallet with it?

See sethdseed. But I wouldn't use this on any existing wallet with any kind of transaction history. See creatwallet argument 3. I have never done this. Before using this I would make backups and test restoring them.
I would greatly prefer to restore a wallet by using the backup and restore feature in the GUI.

and above all an address with bitcoin on it

I'd guess so, if that address was derived from that seed using BIP-32 and is  within the gap-limit. However I have never tried this.


text:
why does the number of transactions per block reduces with increase in transaction fees?
While looking in mempool i saw with increase in sat/vbyte the number of transactions decrease.
are they somehow related?

Hi sat crazy, could you clarify what data you are looking at for your observation? The title makes me think that you are looking at past blocks and see that higher feerates correlate with fewer transactions, but the body of your post makes me think that you are looking at a mempool visualizer.

The way I interpret your question, you were looking at a mempool visualizer like the following:
And you are asking why there are strictly fewer transactions for every fee rate band with higher feerates.
Most of these mempool visualizations don't give the count of transactions in each band, but the count of all transactions in the feerate band and above. If you carefully inspect the legend, you see that e.g. the highlighted row says "8+: 6,811 tx" and not "8-10: 6,811 tx". The row's number includes all transactions that pay at least 8 sat/vB.

The number of transactions in a (full) block depends on the average transaction size, which in turn depends on the number of inputs and outputs of a transaction (and also on the specific output types used). There are several main types of large transactions:

Batched payment – one transaction paying multiple participants at once. Used extensively by exchanges to save on fees. (example)
Consolidation – a user consolidating their many unspent outputs into one to save on future fees. (example)
CoinJoin – many users mixing coins within a transaction in a way that breaks chain analysis heurestics. (example)

I don't think any of these occur more frequently during times of higher fees, and it's reasonable to assume consolidations will be happening when fees are low. So if there is any relationship between fee rate and number of transactions in a block, my guess is that it's actually the opposite of what you've observed.

why is it then that some blocks get filled with less number of transactions (i mean <1MB)  even when there are many transactions in the mempool.

@satcrazy I've never seen a block with unused space when there were enough transactions in the mempool to fill it (excluding empty blocks which is a different matter entirely).


text:
Witness Version bech32 and P2TR
I don't fully understand the meaning of the witness version byte. I am not sure if I confuse the address format prefix bc1 with the witness version.
My understanding: The extra byte reserved for the witness version indicates what opcodes are used for evaluating the spending script (scriptPubKey).

P2WPKH, P2WSH have witness version 0 indicated by the yellow part shown below. If witness version is 0, a SegWit node looks at the size of the byte-key-hash to determine if it is a P2WPKH (20B) or P2WSH(32B).

P2WPKH wrapped in P2SH and P2WSH wrapped in P2SH does not have a witness version byte in the scriptPubKey. Why is that?

According to BIP350, bech32 has witness version 0 and bech32m has witness version. Does the 1 in bc1... indicate the witness version? If so, why are there are no bc0 addresses? Where is my thought process wrong? Do I mix address prefixes with witness versions?

P2TR introduces new opcodes and therefore, it should introduce a new witness version, is that correct? But P2TP addresses start with bc1...

I am not sure if I confuse the address format prefix bc1 with the witness version.

You are confusing them. "bc1" is the prefix. The witness version is part of the bech32/bech32m payload; specifically, the next character after the "1" encodes the witness version.

P2WPKH, P2WSH have witness version 0 indicated by the yellow part shown below. If witness version is 0, a SegWit node looks at the size of the byte-key-hash to determine if it is a P2WPKH (20B) or P2WSH(32B).

This is correct.

P2WPKH wrapped in P2SH and P2WSH wrapped in P2SH does not have a witness version byte in the scriptPubKey. Why is that?

In P2SH-wrapped P2WPKH/P2WSH the scriptPubKey encodes only a hash of the witness program (the OP_(version) + data push). The actual witness program (including the witness version) is only revealed at spending time.

According to BIP350, bech32 has witness version 0 and bech32m has witness version.

Almost. You cannot tell bech32 from bech32m strings by just looking at them. However, in the context of native segwit addresses, bech32 has to be used for witness 0, and bech32m has to be used for witness 1 and higher.
So in general the strategy is to try decoding every address as both bech32 and bech32m, see if either is valid, then check if the payload encodes a valid segwit address, find its version, and finally check that the version matches the address encoding (bech32 for 0, bech32m for other versions).
This is mostly unrelated to your question though. The encoding is structured as follows (for both bech32 and bech32m; the only difference between the two is the checksum):

First there is the human readable part.

For mainnet native segwit addresses (v0 or later), the human readable part is "bc".

Then there is the separator. The separator is always exactly "1".
Then there is the payload, consisting of a variable number of base32 characters.

For native segwit addresses (v0 or later), the payload consists of one character that encodes the witness version (v0 = "p", v1 = "q", v2 = "z", ...), followed by 4 to 64 characters that encode the 2 to 40 byte push in the witness program (the data pushed after the OP_(version)).

Lastly there are 6 base32 characters that form a checksum over the whole thing.

P2TR introduces new opcodes and therefore, it should introduce a new witness version, is that correct?

Indeed, P2TR uses witness programs that consist of OP_1 + a 32-byte push, and are thus witness version 1. In BIP350 addresses, that translates to a "p" after the separator (as opposed to version 0 P2WPKH/P2WSH, which have a "q" after the sepatator).


text:
how to create second node regtest bcoin
I have created a regtest node bcoin, I would like to know how to create the second regtest node to send transactions between nodes and you could also tell me how to generate addresses for the second node through cli

See https://github.com/pinheadmz/bcoin-guide/blob/master/week-2-nodes.md for a guide on how to connect two bcoin nodes in regtest. All you really need to do is configure one node to use non-default ports and data directory so the two processes don't collide. You might find the other guides in that repository useful as well, they were written for https://www.summerofbitcoin.org/ mentees fairly recently.


text:
Confirm transaction in regtest mode
I'm testing some wallet features on regtest. Here's the sequence so far:
cash-cli -regtest generate 101
cash-cli -regtest getbalance
500.00000000

cash-cli -regtest getnewaddress newAddress1
yeAPxkjsNk5RZnAyfHM6cjCtKM7oRUvhzX

cash-cli -regtest  sendtoaddress getrawtransaction 148b8ced78037cb8fe3b32b8814dbf6736c144448671a86da548bbdb5670750a 1
//...
{
      "value": 2.00000000,
      "valueSat": 200000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 c3bc1c481a15343ceb27d45d950c8770b7a0be1c OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914c3bc1c481a15343ceb27d45d950c8770b7a0be1c88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "yeAPxkjsNk5RZnAyfHM6cjCtKM7oRUvhzX"
        ]
      }
    },
//...

dash-cli -regtest gettxout 148b8ced78037cb8fe3b32b8814dbf6736c144448671a86da548bbdb5670750a 0 false
//returns nothing as the transaction is not confirmed. Returns result if we change flag to true

How do I set transaction as confirmed in regtest mode so that dash-cli -regtest <txid> <outid> false would return the transaction output as a valid one?

A transaction is confirmed by including it in a block. This means that you have to mine a block which includes the transaction. You can do this using the generate command.

could you give me an example?

cash-cli -regtest generate 6 will create 6 blocks with the block reward going to your wallet.

I create and send raw transaction then use generatetoaddress to mine blocks to get confirmations but the sent transactions stays unconfirmed. Any idea why?

@Fontaine did you ever find out what your problem was? I have the same, currently.

Any news on this? I'm facing the same situation.

I'm running bitcoind along with Bitcore-node and I was having the same problem. I sent 250 transactions to myself, but the balance I got from BWC/BWS was:
{
  "totalAmount": 166250000000,
  "lockedAmount": 0,
  "totalConfirmedAmount": 0,
  "lockedConfirmedAmount": 0,
  "availableAmount": 166250000000,
  "availableConfirmedAmount": 0,
  "byAddress": [
    {
      "address": "mvaTRJ63NJrZ3qaZW1AbfVzMsei5HCiupb",
      "path": "m/0/0",
      "amount": 166250000000
    }
  ]
}

Apparently, bitcoind will hold a cache in memory and it takes some time (or more actions) to release it, passing its contents to the database.
When you close the process (say, with CTRL+C or CMD+C), you'll see a message like this:
2020-10-22T12:23:57Z FlushStateToDisk: write coins cache to disk (250 coins, 34kB) started
2020-10-22T12:23:57Z FlushStateToDisk: write coins cache to disk (250 coins, 34kB) completed (0.05s)

Then, Bitcore-node will sync and save everything in MongoDb. So, if you close the
bitcoind process and then restart, your transactions should become confirmed.
Here's exactly what I did:

Start bitcoind in regtest mode:
bitcoind -printtoconsole -regtest -fallbackfee=0.00001

Start Bitcore-node. I assume you have it configured to point to your regtest node.
npm run node

Generate 250 transactions to myself:
bitcoin-cli -regtest generatetoaddress 250 "mvaTRJ63NJrZ3qaZW1AbfVzMsei5HCiupb"

Wait for Bitcore to sync with bitcoind.

Close bitcoind with CTRL+C (or CMD+C).

Close Bitcore-node with CTRL+C (or CMD+C).

Restart bitcoind and Bitcore-node.

Boom. Using BWC and BWS to fetch the wallet's balance I now receive this:

{
 "totalAmount":166250000000,
 "lockedAmount":0,
 "totalConfirmedAmount":166250000000,
 "lockedConfirmedAmount":0,
 "availableAmount":166250000000,
 "availableConfirmedAmount":166250000000,
 "byAddress":[
  {
   "address":"mvaTRJ63NJrZ3qaZW1AbfVzMsei5HCiupb",
   "path":"m/0/0",
   "amount":166250000000
  }
 ]
}


text:
Cryptocurrency: check if transaction is viable masternode output
I'm developing a tool for masternode automization similar to https://gincoin.io .
I'm trying to figure out how to decode if transaction is viable for a masternode.
From what I know the transaction must meet the following criteria to be a viable masternode candidate:

The send amount must be exactly as required for a masternode per coin specification (for example exactly 1000.0 coins)
None of those coins should be spent
The transaction must be verified by enough peers
Send and return address must match (must be a transaction to yourself)

From what I have gather getrawtransaction call with txindex enabled client is the only tool that provide accurate info on transaction, as gettransaction is for wallet's internal use only.
So for example
I made the following transaction to myself at yPNYZoqKHMM49z1JzvCFAzrSTJpKmVmMio receive address:

When I execute
$ dash-cli -testnet getrawtransaction dd4011a1892a49d9109c299cad6a902ea60aff5a76f49c7d43f1a28861d0a8d3 1

Returns the following info on the transaction details:
{
  "hex": "01000000027d0511a068dc2b978f840d761c64760307c3eea44eecddbac3d458ed4848b8af000000006a47304402206d040ff0825fa11af1fa497f9e9ca52218b7576e61679ce73475a899d1d005420220572d6104cab20d1abc77eec0e8d50b78f20ad0aaa5d7720878664a38af90a0c00121030613391de767cf19d8dd1fd3275ce661f5ff1e341e0130d7ade004b4a37c0607feffffff7d0511a068dc2b978f840d761c64760307c3eea44eecddbac3d458ed4848b8af010000006a4730440220296f0c7f8a8a538613e10644454c2146cc978509963a5bfe2211c8126c19c03502207c3310582e08585a2e9329cd14687589da58c3ff730ad75a0bba06a846de0caf01210393b4249c1d422cda439e9629ecb80c23aa0586082c5473ae509c94b395d0d061feffffff028b9e7851000000001976a9146be245a75e9e2b49f3392d260a06249de2396d3388ac00e87648170000001976a914217e65d7d68fc632e1ae63b7536c900021fa927288acd93b0300",
  "txid": "dd4011a1892a49d9109c299cad6a902ea60aff5a76f49c7d43f1a28861d0a8d3",
  "size": 372,
  "version": 1,
  "locktime": 211929,
  "vin": [
    {
      "txid": "afb84848ed58d4c3baddec4ea4eec3070376641c760d848f972bdc68a011057d",
      "vout": 0,
      "scriptSig": {
        "asm": "304402206d040ff0825fa11af1fa497f9e9ca52218b7576e61679ce73475a899d1d005420220572d6104cab20d1abc77eec0e8d50b78f20ad0aaa5d7720878664a38af90a0c0[ALL] 030613391de767cf19d8dd1fd3275ce661f5ff1e341e0130d7ade004b4a37c0607",
        "hex": "47304402206d040ff0825fa11af1fa497f9e9ca52218b7576e61679ce73475a899d1d005420220572d6104cab20d1abc77eec0e8d50b78f20ad0aaa5d7720878664a38af90a0c00121030613391de767cf19d8dd1fd3275ce661f5ff1e341e0130d7ade004b4a37c0607"
      },
      "sequence": 4294967294
    },
    {
      "txid": "afb84848ed58d4c3baddec4ea4eec3070376641c760d848f972bdc68a011057d",
      "vout": 1,
      "scriptSig": {
        "asm": "30440220296f0c7f8a8a538613e10644454c2146cc978509963a5bfe2211c8126c19c03502207c3310582e08585a2e9329cd14687589da58c3ff730ad75a0bba06a846de0caf[ALL] 0393b4249c1d422cda439e9629ecb80c23aa0586082c5473ae509c94b395d0d061",
        "hex": "4730440220296f0c7f8a8a538613e10644454c2146cc978509963a5bfe2211c8126c19c03502207c3310582e08585a2e9329cd14687589da58c3ff730ad75a0bba06a846de0caf01210393b4249c1d422cda439e9629ecb80c23aa0586082c5473ae509c94b395d0d061"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 13.66859403,
      "valueSat": 1366859403,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 6be245a75e9e2b49f3392d260a06249de2396d33 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9146be245a75e9e2b49f3392d260a06249de2396d3388ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "yW9tDPWry4F4Yoh2ejVpdvMtjawBpNq2jV"
        ]
      }
    },
    {
      "value": 1000.00000000,
      "valueSat": 100000000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 217e65d7d68fc632e1ae63b7536c900021fa9272 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914217e65d7d68fc632e1ae63b7536c900021fa927288ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "yPNYZoqKHMM49z1JzvCFAzrSTJpKmVmMio"
        ]
      }
    }
  ]
}

This vout portion in particular confirms that exactly 1000.0 coins is sent to the address as requested yPNYZoqKHMM49z1JzvCFAzrSTJpKmVmMio:
    {
      "value": 1000.00000000,
      "valueSat": 100000000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 217e65d7d68fc632e1ae63b7536c900021fa9272 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914217e65d7d68fc632e1ae63b7536c900021fa927288ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "yPNYZoqKHMM49z1JzvCFAzrSTJpKmVmMio"
        ]
      }
    }

But how do I check if that's a transaction  yourself, and that none of those 1000 coins were spent?
NOTE This is not a specific cryptocurrency related, and should work on any generic rpc wallet client that's masternode enabled.

Each project may have different specific requirements for what is deemed a valid transaction, but generally an unspent transaction must be checked against all previous transactions in the blockchain to make sure it has not been referenced as an input (vin) to another tx. Bitcoin stores a database of unspent transaction outputs (UTXO), to do this check more efficiently.
This check is done in Bitcoin before the transaction enters the mempool of a node (prior to being mined), and if it fails, the transaction will be rejected.
Update: You can get a specific utxo by txid using $ bitcoin-cli gettxout, you just can't query by address, per @PieterWuille's comment below.

How do I check the unspent transactions?

This gets asked a lot, and I don't really have a good answer because I'm only aware of Bitcoin core's internal implementation. It stores newly mined transactions in the UTXO database and deletes the ones that are spent. There is no RPC call to query them except for listunspent which only shows the utxo related to addresses in your wallet.

You can use the gettxout RPC. If it returns something for a given txid and vout, the output is unspent.

@PieterWuille Thanks a lot, you could post that as an answer. Do you have any idea how to check if transaction is made to yourself?

Ask the wallet. See if it appears in listtransactions, or whether getreceivedbyaddress includes its address.

@PieterWuille as I explained I'm not operating as the wallet owner, I need to obtain this information from outside the wallet


text:
What does postfic in the wallet transaction id mean
It's known the txid is always a 32 byte hex sequence for example ceca9c54d1a2f9122326a871a3b0b20b725540137e80cb50da663a404f7849a8, but when inpecting the transaction in a wallet it shows it with a dash and three number postfix :

What does -000 mean in the txid, and why is it there?

It means this receive is due to output number 0 of the listed transaction.
Transactions can have multiple outputs (and usually do), and it is possible that more than one of them pays you. If that is the case, they will be listed as separate "transactions" in the UI, but their output will be distinct.

so, does it means that 00 is the index of vout in the raw transaction?

Correct, that's it.


text:
Separating user accounts in a wallet for a large scale web app
I'm planning to implement a web platform that maintains user wallet accounts and generally acts as a web wallet. They can deposit, withdraw and transfer coins.The number of accounts should be in magnitude of thousands. I'm considering the implementation options for simulating many different web wallets inside several factual wallets. I wonder how existing services do it?
I'm aware of the following options for the implementaiton:

Using accounts inside wallet. Pros: wallet supports commands for checking ballance, sending from account etc. Cons:  still spends coins from general wallet, so hard to keep track of; Is deprecated; Complicated to do backups
Using separate private keys for each user. Not sure how to do it.
Keeping track of ballances and transactions inside proprietary system. Pros: no problems related to option nr. 1; Cons: Probably a hell to maintain, not even sure how to implement it;

Id love if someone could give me some advice and or share experience. What is the best option? Is there anything else I'm not considering?


text:
importmulti native segwit address to fetch utxos of p2wpkh native segwit address
I must fetch utxos for a native segwit address from the local Bitcoin node.
First I wanted to import the segwit address. However, it fails.
How can I import a native segwit address? I'm using latest bitcoind version 240001
# bitcoin-cli -testnet importmulti '[{"scriptPubKey": {"address": "bc1qerwt7v72j0w70ezw09keaqzcsss......."}, "timestamp": "now"}]'
error code: -4
error message:
Only legacy wallets are supported by this command

Thank you!

For modern "descriptor" wallets, you need to convert whatever you want to import to the output descriptor language, and import that using the importdescriptors RPC.
For an individual address, the descriptor is just addr(ADDR), where ADDR is the address you want to import. The importdescriptors RPC requires descriptors to have a checksum, of the form #CHECK, where CHECK is the checksum. You can compute the necessary checksum using the getdescriptorinfo RPC.

bitcoin-cli -testnet  importDescriptors '[{"desc": "addr(tb1qxhx5gq5gwaju2lh0pxnp7....)", "timestamp": "now"}]' still fails. Error message is Method not found. Bitcoin Core RPC client version v24.0.1

Do not capitalize the D in importdescriptors.

bitcoin-cli -testnet  importdescriptors '[{"desc": "addr(tb1qxhx5gq5gwaju2lh0pxnp7qpn4685cwvsfuejza)", "checksum": "h8rwjq0n", "timestamp": "now"}]'
[
{
"success": false,
"error": {
"code": -5,
"message": "Missing checksum"
}
}
]

I told you you need to compute and add the checksum, for example using getdescriptorinfo.

Got it. Changed it to bitcoin-cli -testnet - importdescriptors '[{"desc": "addr(tb1qxhx5gq5gwaju2lh0pxnp7qpn4685cwvsfuejza)#h8rwjq0n", "timestamp": "now"}]'

The error message has changed to
{
"success": false,
"error": {
"code": -4,
"message": "Cannot import descriptor without private keys to a wallet with private keys enabled"
}
}
]

You'll need to create a wallet for watching, without private keys, using the createwallet RPC, and import into that.

Thank you! I'm able to import it into wallet test4. Then I deposited some testnet bitcoin into it. Should I supposed to see it with the bitcoin-cli -testnet -rpcwallet=test4 listunspent

Thank you @Pieter I'm able to import and segwit address into a wallet.

Created a wallet without private keys.

~$ bitcoin-cli -testnet createwallet test4 true
{
  "name": "test4",
  "warning": ""
}

Get descriptor info to obtain hash

~$ bitcoin-cli -testnet getdescriptorinfo "addr(tb1qxhx5gq5gwaju2lh0pxnp7qpn4685cwvsfuejza)"
{
 "descriptor": "addr(tb1qxhx5gq5gwaju2lh0pxnp7qpn4685cwvsfuejza)#h8rwjq0n",
 "checksum": "h8rwjq0n",
 "isrange": false,
 "issolvable": false,
 "hasprivatekeys": false
}

Imported the address

~$ bitcoin-cli -testnet -rpcwallet=test4 importdescriptors '[{"desc": "addr(tb1qxhx5gq5gwaju2lh0pxnp7qpn4685cwvsfuejza)#h8rwjq0n", "timestamp": "now"}]'
[
  {
    "success": true
  }
]

After a couple of minutes, the testnet bitcoins I've sent to the address appeared in the wallet.
bitcoin-cli -testnet -rpcwallet=test4 listunspent
[
  {
    "txid": "c50321fa5a86a281882283b507f33529682158998d32bb335c125ed2e2b6e614",
    "vout": 0,
    "address": "tb1qxhx5gq5gwaju2lh0pxnp7qpn4685cwvsfuejza",
    "label": "",
    "scriptPubKey": "001435cd4402887765c57eef09a61f0033ae8f4c3990",
    "amount": 0.00001000,
    "confirmations": 1,
    "spendable": true,
    "solvable": false,
    "parent_descs": [
      "addr(tb1qxhx5gq5gwaju2lh0pxnp7qpn4685cwvsfuejza)#h8rwjq0n"
    ],
    "safe": true
  }
]


text:
can we have multiple BTC addresses that all of them store their values in the same place?
I am creating my own shop and I will give each user an address to specify who is sending me BTC but when I want to collect all BTC address values to my main address I need to pay fees a lot since each subaddress has a little value on it.
is there a way to create a sum address refer to one address or any way to store automatically in one place/address? thanks in advance.

If you are accepting small payments and are rightfully worried about fees, you might want to look into Lightning Network.

Also, collecting all received BTC to a "main address" is address reuse, which should be avoided: https://en.bitcoin.it/wiki/Address_reuse

This should be in the comments but my initial reputation does not allow for that.
You seem to be from Turkey. IIRC the 3rd party payment processing got banned in your country this year.
This leaves you with self-hosted payment processors like BTCPay Server or CypherpunkPay.
Regarding your question, as others pointed out, it's not possible to "add" to existing UTXO. You can only combine multiple UTXO-s by periodically transferring back to yourself which is smart long-term-fee-wise but bad privacy-wise.
Realistically, disallow small on-chain payments and/or implement accepting Lightning Network payments.

There's no way to do what you suggest using on-chain transactions.
The lightning network or a payment service might help achieve your goals.


text:
Sign psbt with software wallet. [electrum & others]
So I've been looking for days to sign a PSBT transaction but upon to all my research i failed or i just haven't searched in the right place.
The PSBT content is generated from a payment gateway that I've been using for my web services  named btcpaymerchant.com and it provides me a version of the PSBT encoded and decoded with inputs/outputs/txid/pubkey/etc..
I only need to sign  it from what i understood I've tried importing the file to electrum but it doesn't let me to sign it , when attempting to sign it the button to sign it is disabled.
•What i tried:

Tried directly importing the PSBT content to electrum and saving it to transaction history and proceeding to sign it but electrum disables the buttons to sign automatically when opening the transaction.

Steps i took on electrum to import the PSBT to wallet are:
Tools -> Load Transaction -> From File/From Text -> Save
Then the transaction appears as local [rbf] without allowing me to sign it it,
image: https://i.sstatic.net/NvWA4.jpg

Tried using coinb.in to sign/verify the transaction no success.

Different wallets and wallets type from bip32->44->49.

When trying to import https://coinb.ib encoded transaction to electrum it results in error scriptsig-not-pushonly [image of the error:  https://imgur.com/bnx5LZV ]

I also tried researching the shit out of this and how to do it for 3 days.

•Most of you may ask why didn't i contacted support?
That's a good point i tried but they haven't responded, i read the documentation several times but still no success.
I ve also read the documentation for the wallet and psbt for like 20 times [https://docs.btcpayserver.org/Wallet/].
They offer the following steps for PSBT transactions.

A PSBT gets constructed with certain inputs and outputs, but no signatures
The exported PSBT can be imported by a wallet that supports this format
The transaction data can be inspected and signed using the wallet
The signed PSBT file gets exported from the wallet and imported with BTCPay Server
BTCPay Server produces the final Bitcoin transaction
You verify the result and broadcast it to the network

Most of the people use hardware wallets to sign these transactions but currently i do not own one if you have any other suggestions of software wallets that could help me out im all ears.
Thanks for your attention and helping!
What exactly needs to be signed?

The whole transaction?
The inputs or outputs?
Or anything?

How do you merge the signatures  with the message?

I know there is a setting "merge signatures from" while viewing the transaction but for me it results in a parsing error :
Electrum was unable to parse your transaction: ValueError('failed to recognize transaction encoding for txt:...)

The payment gateway that generates the PSBT also provides the features combine psbt which from my guess lets you combine 2 PSBT i tried encoding the signature and merging it but no success.
The payment gateway also provides a demo at https://mainnet.demo.btcpayserver.org if anyone is intrested.
The payment also has 1 or multiple inputs and 1/2 outputs.


text:
How to listen to deposits and confirmations of bitcoin transactions
hello I am building a web application using nodejs, bcoin and my application provides the user with a bitcoin address in which to deposit funds, I would like to know how I can listen on my nodejs server:

when the user deposits funds in the bitcoin address that my application provided
The deposit has gone through 12 confirmations.

The bcoin full node and wallet emit JavaScript events for things like blocks and transactions, which can be listened for with a websocket client.
There is a guide to sockets and events in bcoin here: bcoin.io/guides/events.html
If you have any more questions about bcoin you can join us on slack or on IRC (Libera) #bcoin

Thanks for the answer, can you tell me if the websocket client notifies me only the confirmations that a transaction that I send has or also those that send me to my address?

Both sent and received TXs should be emitted by events.


text:
Why would anyone pay with Bitcoin?
A lot of people are committed to building Bitcoin network to be a better payment network.
However, why would anyone spend it if it is a store of value and the price is quickly going up, which make it bad as a currency?

Hi Jem, I think your question may be answered in this topic already: https://bitcoin.stackexchange.com/q/408/5406

Thx @Murch, great reference and answers. Seems the topic is long-lasting. Maybe bitcoiners just hope to see it as an currency, not just a hoarding assets. However, volatility is bad for currency and there seems no way to make bitcoin stable relative to fiat.


text:
LND Port 9735 still closed after setting up port forwarding and firewall
I have set up my bitcoin/lnd full node and would like to have it run as a routing node for the network. So I have opened my port 9735 from the router and allowed access to it in my firewall (ufw on Ubuntu).

Now, although my node is running and listening, my port still appears as closed. I have had no issue establishing connections or opening channels with other nodes but it seems they cannot connect to me.

Here are are my bitcoin.conf and lnd.conf file as well:
bitcoin.conf
# server=1 tells Bitcoin-Qt and bitcoind to accept JSON-RPC commands
server=1

listen=1
daemon=1

# RPC server options
rpcuser=xxxxxxxxxxxx
rpcpassword=xxxxxxxxxxxx

zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

# Connection options
bind=192.168.0.12
externalip=94.107.123.223

# Use only TOR for routing
proxy=127.0.0.1:9050
bind=127.0.0.1
externalip=f5arugxcfm4tkjtc.onion

# Long running Bitcoin Nodes on the Tor Network
# http://nodes.bitcoin.st/tor/
addnode=pqosrh6wfaucet32.onion
addnode=btc4xysqsf3mmab4.onion
addnode=gb5ypqt63du3wfhn.onion
addnode=3lxko7l4245bxhex.onion

# Verified Online Bitcoin nodes on the Tor Network from
# https://rossbennetts.com/2015/04/running-bitcoind-via-tor/
addnode=kjy2eqzk4zwi5zd3.onion
addnode=it2pj4f7657g3rhi.onion

# Verified Online Bitcoin nodes on the Tor Network from
# https://en.bitcoin.it/wiki/Fallback_Nodes#Tor_nodes
addnode=hhiv5pnxenvbf4am.onion
addnode=bpdlwholl7rnkrkw.onion
addnode=vso3r6cmjoomhhgg.onion
addnode=kjy2eqzk4zwi5zd3.onion

# Verified Online Bitcoin nodes on the Tor Network from
# https://sky-ip.org
addnode=h2vlpudzphzqxutd.onion
addnode=xyp7oeeoptq7jllb.onion

# Maintain a full index of historical transaction IDs
# Required by LND Server
txindex=1

lnd.conf
; set external IP if not using NAT
externalip=94.107.123.223
; set node alias (seen in explorers)
alias=ln.brussels

tlsextraip=192.168.0.12
rpclisten=0.0.0.0:10009
restlisten=0.0.0.0:8080
listen=0.0.0.0:9735

[Bitcoin]
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind

[Bitcoind]
bitcoind.rpcuser=xxxxxxxxxx
bitcoind.rpcpass=xxxxxxxxxx
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333

2 questions: 1.) is your machine behind a router that has no portforwarding? Second: ufw shows tcp6 have you tried to allow port 9735 specifically for ipv4 which is the address you seem to check?

Let me respond to the second one first, as far as I know ufw allows both ipv4 and ipv6. The command ufw status shows 9735 both with and without (v6). As for the first question, I'm not quite sure, I am using a devolo wifi extender so that could be the issue. However, I believe there are no settings for port forwarding. Does that mean the only solution is to connect the node directly to my modem?

May I add, using the same website to check the open port (https://www.yougetsignal.com/tools/open-ports/), the bitcoin node port 8333 shows open. However, bitnodes shows the node as unreachable. Appreciate your help!

I cannot comment on your hardware. But there might be a general hint. If you are behind a firewall you can run a lightning node on a tour onion. Since your node connects to the tor network and people over the onion connect to you you don't need any open ports.

Nice, I hadn't thought about that! To be honest, I would really like to grow the node into a routing node for the whole network and with my understanding of tor that wouldn't be the case. I'm really at a dead end here though so my options seems fairly limited. The ISP also assures me it's not blocking the port...

@RenePickhardt thank you for the Tor suggestion, I was about to give up hope until that worked for me. Stellios Rammos, in my case looking at the LND log revealed that the LND service was not getting created because my network was incapable of supporting UPnP. I don't know why LND requires that when Bitcoind does not.