text:
Why is a blockchain often compared to a linked list?
I often hear people say that a blockchain is essentially a linked list (i.e. https://www.quora.com/Is-a-blockchain-essentially-a-linked-list)
A block stores the hash of the previous block for validation/consensus. This is similar to how a node in a linked list references the address of the previous node, but it's not quite the same.
In a block, the previous hash is stored by value, not by reference, so you can't really access the previous node by traversing the chain. Whereas in a linked list, you store the address which is a reference to the previous node. You can access any block in constant time where as in a linked list, it's linear time.
On top of this, many implementation that I've seen of a blockchain is an array/slice of blocks. I tried briefly looking at bitcoin's source code (disclaimer: I don't know C++). It looks like the implementation of the chain of blocks in memory uses std::vector which is basically a dynamic array.
Isn't a blockchain more similar to an array than it is to a linked list?

I assume the linked list analogy just arises because of the reference to the previous block as you say. It's less about how to find that block, and more just about identifying it. The actual data structure used to store the Blockchain isn't what is being described.

Thank you for the clarification. I was confused by diagrams where one block references previous block and thought you had to traverse the chain in reverse until I started digging into it some more.


text:
Where are new addresses stored?
When a user generates an address using Bitcoin Core, is that address by default stored on the blockchain or will it only be stored after it is used in a transactions

will be stored only after any transactions occur ?

Wallet addresses are not technically seen in the blockchain until they are used in a transaction, but that does not mean that they have not been generated/belong to someone. A Bitcoin "address" is derived using the public key (and the public key is derived from the private key, using ECDSA) and are really used for simplicity and readability through Base58 encoding (imagine needing a user's full 32 byte public key!).
A private key can be used to derive a public key and likewise the public key can be used to derive an address. Due to the nature of hash functions/ECDSA, these values are "computationally infeasible" to reverse. Meaning you cannot take the address and obtain the public key nor can you calculate the private key given the public key.
As the wiki states:

A Bitcoin address is a 160-bit hash of the public portion of a public/private ECDSA keypair. Using public-key cryptography, you can "sign" data with your private key and anyone who knows your public key can verify that the signature is valid.

Anyone with the private key necessary to meet the spending condition (scriptSig) of a transaction will have the means to spend it's output(s).

this means public key is not same as the wallet address ?

@PankajKumar Correct. The public key is used to obtain the address given to you when generating a new address. Refer to this from step #2 to see what is done to the public key to get the Base58 address you're familiar with.

It is also worth mentioning that although the public key is not exactly the same as the bitcoin address, the public key will always produce the same address.

So we can say that first process start with the public and private key creation .And we can use code to generate these keys locally. after these keys created then the wallet address can be generated (so far there is no communication between blockchain).When any other user try to send BTC to newly generated wallet address only then the transactions along with the newly created  wallet stored on the blockchain ? In other words we can say that address generation dont need blockchain access or communication.

@PankajKumar Exactly right. They can be created online or offline, and it is generally recommended to generate private keys offline to prevent them from being stolen, etc.

After addresses generated offline how they can be available on bitcoin network ? let me explain with example :  Suppose 'A' named user has created  valid address locally using the code (python) . Now Suppose 'B' named user want to send 1 BTC to 'A'  .Is it possible that 'B' user is able to send coin to 'A' directly ? Or is 'A' needs to do something so that the new address that he had created will be availble on the Bitcoin blockchain ?

@PankajKumar Either A or B can send a transaction in any order. The protocol doesn't care if the address have already been claimed, the transaction will still be approved by the nodes.

@Kapil is this means that if the address are generated offline its not required those addresses to be publish on blockchain ?

source: Stack Exchange

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

sort: votes


text:
How can I set the rpc user credentials in Insight to connect to a custom node?
Bitpay has done brilliant work in creating the bitcore libraries pack.
I am stuck trying to find the file in which we can add the rpc user name and password for connecting to a custom node inside the insight-api.
here is the code for the insight-api https://github.com/bitpay/insight-api

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


text:
2-3x increase in peers banned by bitcoind
In the last week, with no changes to my node's configuration, I've noticed my node is auto-banning peers at 2-3 times the rate of before. Where usually I'd have 25-30 peers banned every 24 hours, the rate has jumped to 100/day. All the bans are auto-generated by bitcoind 0.19.1, the node simply reports 'peer misbehaving' or something similar. I do not bandwidth limit my node.
Any insight as to what's causing the banned nodes?
Can this be a result of increased interest in bitcoin and more people bootstrapping nodes? I don't see nodes that are hogging a lot of bandwidth, so this doesn't seem true on the surface.
Any suggestions how to look into the increase in misbehaving nodes?

debug.log output would be useful for figuring out what's going on.

Nothing unusual, then usual reports about new blocks and connected/disconnected nodes. Note that my node still has a normal (100+) number of peers, but now the number of banned peers has increased, indicating an increase the gross number of connections to my node


text:
lightning daemon rejects bitcoind RPC variables in lnd.conf
I run lnd and bitcoind under their own users, but on the same physical machine. This means lnd has trouble accessing the bitcoind .cookie, so I'm trying to configure lnd to use RPC.
When I use the following options in my lnd.conf as described in the lnd documentation:
bitcoind.rpchost=127.0.0.1:8332
bitcoind.rpcuser=joeblow
bitcoind.rpcpass=superSecretPasswordByRPAUTH.py
bitcoind.zmqpubrawblock=127.0.0.1:28332
bitcoind.zmqpubrawtx=127.0.0.1:28333

lnd errors out with the following error:
lnd.conf:16: unknown option: bitcoind.rpchost

lnd runs fine if I specify the above options using the command line like this:
lnd -bitcoind.rpchost=127.0.0.1:8332 -bitcoind.rpcuser=joeblow ... etc

This means typing in the RPC password in the command-line and command-line options can be seen by users running 'top' or task manager. This exposes RPC password to users other than 'lnd.' Having RPC password in lnd.conf is moderately more secure because the file can be locked down with chmod.

Found out that any bitcoind.XXX options need to be under a [Bitcoind] heading. Working lnd.conf is as follows:
[Application Options]
debuglevel=info
debughtlc=false
maxpendingchannels=5
alias=WittyAlias
color=#000300
maxlogfiles=3

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

[autopilot]
autopilot.active=1
autopilot.maxchannels=16
autopilot.allocation=0.1

[Bitcoind]
bitcoind.rpchost=127.0.0.1:8332
bitcoind.rpcuser=wittyusername
bitcoind.rpcpass=VerySecretSuperDuperRPCauthPassword
bitcoind.zmqpubrawblock=127.0.0.1:28332
bitcoind.zmqpubrawtx=127.0.0.1:28333


text:
What is the incentive behind using platforms such as XDP/Dogeparty?
ELI5: What can one do with XDP that s/he cannot do with DOGE? Is Dogeparty similar to projects such as Ethereum/Ripple?
If I understand correctly one receives 1 XDP/1000 DOGE "burned". How are these DOGE 'destroyed'? And where does one go from there in using their newly acquired XDP?

The DOGE are "destroyed" by sending to them to an address for which no one knows the private key.  The address is DDogepartyxxxxxx... which is clearly human-generated.  Calculating the corresponding private key is equivalent to breaking Elliptic Curve encryption (and if someone can do that, the whole bitcoin ecosystem comes crashing down in flames -- because they could compromise any and all accounts, not just this one).
Once XDP is created, there will be an XDP/DOGE market on DogeParty, just as there is an XCP/BTC market on Counterparty.  Using this decentralized exchange, you will be able to trade your XDP back for DOGE if you desire.  (This feature is currently disabled in DogeParty but will be re-enabled soon)
DogeParty/CounterParty is considerably more powerful than the underlying currency.  It has an internal, decentralized market for tokens.  You can issue dividends.  You can place bets and broadcast information.  For more, read about CounterParty.  (The DogeParty code is identical, save for renaming BTC -> DOGE and changing the burn formula slightly)

Upvoted. Another concern I have is since the vanity address is human-generated would that mean it's possible someone owns the private keys? Perhaps I misunderstood. Thanks.

@solocshaw - The idea is that a vanity address like that would take many millions of years to generate.

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


text:
What are some possible causes of the BTC-e 'flash' crash?
What circumstances made this possible? What entities or major factors could be the cause?

For those of us who are not familiar, can you give some more information  or a link to explain what event you are talking about?

I've added a link to the Coindesk article. Thanks.

Flash crashes can and will occur in any market where technology (algos) determine trading.  Always tailed by real people panic selling (or panic buying).
Doesn't matter what market you are in.
There also the effect of futures trading (I know of a few futures/options houses that operate in the crypto-space).
There is really nothing you can do.  Worrying about it now (while it is happing is pointless). But to give you an answer (at least for litecoin pricing pressures) newer ASICs miners are 'supposedly' creating too much liquidity.
There are quotes from the old world of stock trading that ring true here (non-cited and paraphrased):
"The market is designed to make as many people look as stupid as possible..."
and
"Do you want to look like a fool before the crash or after the crash..."
Seems to apply pretty well to the new and shiny crypto-currency markets too.
But there is another quote that is pretty famous and great to light up those of us enveloped in the darkness of nasty market moves.
"Be fearful when others are greedy and greedy when others are fearful..."
Here is the thing, when everything is mined to the point that it is simply not feasible to continue and coins are lost over time then you will find yourself in a deflationary situation where all of a sudden your coins (bitcoins and litecoins) are hit with supply-side pricing movements to the up-side that will pale in comparison to anything you have seen before.
Since we are about half-way there, I would recommend relaxing and watching the fireworks because the low-hanging fruit is being consumed.
Finally, I would venture a guess that we will see this supply-side anomaly begin to take shape in early 2017.

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


text:
What happens if 1-way functions no longer exist?
Advances in AI and nanobiotech  can radically increase intelligence to the point where unsolved mathematical problems get solved.
What happens to Bitcoin (and other cryptocurrencies) if ⨕ 1-way functions cease to exist?

hash functions, or all one way functions?

@MCCCS, All 1-way functions. Otherwise we would simply replace the hash function with that new function isn't it?

No, I mean Bitcoin uses ECDSA too but that's not "hash", but a one way function.

I'd use "if", not "when", in the main question.

AI and nanobiotech??? Have these ever been used to defeat one-way functions? Or are you just spouting buzzwords?

without modifications the current bitcoin system would simply be compromised.
it seems very likely all private-public key cryptography would be compromised as well, and society as we know it would change.
however, given unknown advances to begin with, there is always the chance that something entirely different could replace the current system of secrecy when it comes to trust.
there is also the possibity that no matter how many advances we get, 1-way functions might be impossible to completely break, or that we find new maths that guarantees breakage if any 1-way function but with a cost that is prohibitive.

Luckily, reverting the one-way-ness of cryptographic hash functions is not a mathematical problem. Rather, cryptographic hash functions destroy part of the information by projecting from an infinite space to a finite space. Reversing this is only possible by brute-forcing, and the finite space is sufficiently large that this is considered to be infeasible.
It's not clear to me how either nanobiotech or advances in AI should improve the speed of brute-forcing.
However, quantum computing is brought up frequently in that context since it allows to try many different possibilities in parallel. Should we succeed at creating quantum computers that can search sufficiently large number spaces in parallel this would be very efficient at brute-forcing the reversion of hash functions. Mining difficulty would grow exponentially over night and ECDSA would possibly be broken as well.
Also see: What effects would a scalable Quantum Computer have on Bitcoin?


text:
Error running BITCOIND in Ubuntu 12.04 Desktop
Running Ubuntu 12.04 LTS Desktop under Oracle VirtualBox in Windows 7 64bit I get the following error:
sim@sim-VirtualBox:~/bitcoin-0.8.5-linux/bin/32$ ./bitcoind -rpcpassword=12345 **terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::string, boost::filesystem::path_traits> > > >'
  what():  boost::filesystem::create_directory: File exists: "/home/sim/.bitcoin"
Aborted (core dumped)**

Anyone know how I can fix this or what the issue may be?

Do you have a file named .bitcoin. in your root directory? If so, delete it with rm /home/sim/.bitcoin and try running the server again.

That did it! So far so good. I'm just trying to get the wallet from Windows imported... I'm assuming a wallet.dat is interchangeable b/w linux and windows?

Usually they are, but there's some edge cases with Berkely DB compatibility that will cause opening to fail. You'll know if it doesn't work. Just shut down the node, swap in your old wallet.dat, and do a -rescan if your node was up to date when you did the sync.


text:
Updating a Bitcoin wallet
I have a harddrive with an old wallet but I am not sure what I need to do to see how much BTC I have.
I have read quite a few notes, but I am looking for the latest information. I want to continue leaving my BTC in my private wallet until I decide to move it to an exchange or online.
How do I see how much BTC I have?

It might help to say exactly what wallet-related file(s) you have on the hard drive.

To see how much BTC you have, you just need to open your wallet up, make sure it is fully synchronised, and then check your balance. If you don't want to wait for it to synchronise, you can copy and paste your addresses into a block explorer to see the balances on there.

are there any security concerns using these sites to check the amount of coin in my wallet? Does COPY/PASTING this info have any security implications?

@PeterJenkins addresses and public keys are designed to be made public, it's fine to enter those into websites, just never the private keys. BTW remember to accept my answer if it satisfies your question so it doesn't remain unanswered :)

Note that pasting your addresses into an explorer is a serious privacy leak in case someone is watching the server logs.


text:
Why is the smallest transaction value 5340 satoshis? What is so special about that particular number?
What is so special about 5340 instead of some other number? E.g. why not 5320 or 5345?

The smallest transaction value is actually 0 as you are allowed to create 0 value outputs. However such transactions are considered non-standard and thus will not be relayed. But they are completely valid if they appear in a block.
The smallest standard output value (also known as the dust limit) changes with the fee rate. The dust limit for a given fee rate is defined as the amount of Bitcoin where spending the output would result in all of the output's value being paid as transaction fees.
Currently, the dust limit fee rate is 3 satoshis per byte which makes the dust limit 546 satoshis, not 5340. The 5340 satoshis dust limit comes from a time when the dust limit was actually defined differently and the dust fee rate was higher.
The previous definition (no longer used, but was the one used when 5340 satoshis was the limit) was the amount at which one third of the amount would be paid in transaction fees. To make calculations easier, this was redefined to the current definition and the default dust fee rate for calculating this was multiplied by 3. Under this definition, the dust fee rate was ~10 satoshis per byte.

very informative, glad to have such a detailed clarification. Will the dust limit decrease/increase in the future?

That is unknown because it now depends on the fee rate with the current minimum fee rate being 3 sat/byte.


text:
How does lightning network find paths with sufficient liquidity?
According to this article article, all hops along the route must have sufficient liquidity to process any payment they wish to service.
However, in LN, new commitments may not to be broadcast to the blockchain until one wants to close a payment channel. How does LN know that a node has sufficient liquidity when a node has paid out all its bitcoins but the transactions have not been broadcast yet?

Lightning Network nodes have their own P2P network where they send messages to each other containing information about their channels and their states. So a node will receive messages from the other nodes on the network that describe the available channels and their liquidity. So a node can build an internal map of the network's channels and the balances for each node in each channel. With this map, it can then plot a route for each payment.

Is it not impossible to keep this up to date? I mean imagine the number of messages that need to be sent to everybody everytime somebody makes a tx.


text:
How to use "lockunspent" in bitcoin core wallet console?
Try to use the Lockunspend RPC in bitcoin core wallet console. But always get wrong, and google it can't find answer.
My input is:
lockunspent false "[{"txid":"c3fa34606ae3ea416ff640d97414ef6a0a8afcebfbe2c60403ad60c0d961f04c","vout":0}]"

Is anyone can teach me where I am wrong? Thanks

What is the error that you get?

The problem is, you should to escape the inner quotes:
lockunspent false "[{\"txid\":\"c3fa34606ae3ea416ff640d97414ef6a0a8afcebfbe2c60403ad60c0d961f04c\",\"vout\":0}]"

Thanks. But it's not work. If with bitcoin-cli, your format should be work. But my problem is how to use is with bitcoin core wallet console. It seems that don't need to escape the inner quotes for console.

It should work, have you tried?

10:37:01
￼
lockunspent false "[{"txid":"c3fa34606ae3ea416ff640d97414ef6a0a8afcebfbe2c60403ad60c0d961f04c","vout":0}]"
10:37:01
￼
Invalid parameter, expected unspent output (code -8)

@yrm23 It's clearly not unspent.

Try double quoting
lockunspent false '[{"\"txid\"":"\"c3fa34606ae3ea416ff640d97414ef6a0a8afcebfbe2c60403ad60c0d961f04c\"","\"vout\"":"0"}]'

please explain why this is down voted


text:
The nlocktime parameter in createrawtransaction seems not work using Bitcoin Core Wallet GUI
If I add the CLocktime (e.g 20) at the end it always gives:
Error: Error parsing JSON:{"12CxqQHzhFxCm2TkGkKHdFFPyUerFXcSte":0.008,"1DBDDvpcHv66LD7sWz1mCitPALW1qfrga7":0.012},

If I delete the CLocktime at the end it will be ok.
Have anyone has similar experience and know why?

A nlocktime of 20 doesn’t make sense.

This is the format I used, but not work:                                                  createrawtransaction "[{"txid":"myid","vout":0}]" "{"address":0.01, "address":0.01} 20"

20 is still nonsense. It will always be valid because we are past block 20.

You're putting the locktime in the wrong place. You have
"[{\"txid\":\"myid\",\"vout\":0}]" "{\"address\":0.01, \"address\":0.01} 20"

but it should really be
"[{\"txid\":\"myid\",\"vout\":0}]" "{\"address\":0.01, \"address\":0.01}" 20

The locktime is a separate parameter, not part of the quoted parameter that has the transaction outputs. It goes outside of those quotes.


text:
Transaction fee in Bitcored
Does the transaction fee of bitcored or bitcoind change everyday?
Am I required to set transaction fee of bitcoind by using settxfee method?

Does the transaction fee of bitcored or bitcoind change everyday?

It will often change because it will estimate the fee for certain confirmation targets (e.g. confirm within 4 blocks). The fee estimation will update with each block, so it may change every day. It may also change more or less frequently than daily depending on the transaction situation for each block.

Am I required to set transaction fee of bitcoind by using settxfee method?

No. You only need to do that if you want to specify the transaction fee instead of using the estimation. I recommend that you use the estimation as setting the fee yourself will often occur in overpaying or underpaying.


text:
Handling change addresses without using rawtransactions?
Since I'm using the wonderful accounts feature which is soon to be deprecated (shame on me, i know - but i simply didn't have resources and time as a single person to do an internal accounting system in a few weeks alongside everything else the project contains, this is a school project and will not be deployed), i was wondering how to handle sending transactions & change addresses, without using raw transactions.
Would the following work
SendMany(fromacc, toaddress: amount, 1, "comment", subtractfee)

(I'm planning to use SendMany for single transactions, because it has the subtractfee parameter compared to SendFrom).
Use the resulting TXID to query Blockcypher API (https://api.blockcypher.com/v1/btc/main/txs/b7bf53a74a4e4cb61ab523cc002fc4cea83fb359471d02b212d947cf86fe6077) and "grab" the change address from there (Since Bitcoin Core doesn't allow this wihout using rawtransactions?)
VerifyAddress(changeaddress)
SetAccount(account, changeaddress)

Which means that GetBalance(account) should show the correct balance of the account and not 0?
Or should i really not do that and use rawtransactions instead? :-)
edit:
So i just realised that i confused the subtractfee parameter in SendMany from the one in SendToAddress (which is what i need), so i suppose i need to use that instead.
would using:
$balance = getBalance($myaccount)
move("", $myaccount, $sendingamount, "", "comment")
SendToAddress($receiveaddr, $sendingamount, "comment", "commentto", 1, 0, 6)

do the the blockcypher grab TX id, verifyaddress and set account here
OR
$newBalance = getBalance($myaccount)
$change = $balance - $sendingamount
move("", $myaccount, $change, "", "comment")

Work in this case and would listunspent show the amount under the right account (not "")?
Also here is what I'm trying to do from a user perspective: https://i.sstatic.net/Flntu.jpg

Why do you need to know the change address?

Instead of asking about the approach that you want to do, you should ask about what it is that you want to accomplish. Otherwise this is an XY problem (http://xyproblem.info/) and it doesn't really make sense to people who can provide you an answer. As it is right now, I don't understand what you are trying to do and what the problem actually is so I cannot provide you a good answer.

Yeah, i apologize. I've been quiet confused about sending transactions and the heat has gotten to me today. I would like for a user with an account to be able to transfer what is available in their balance, that they have received from a generated address. The fee should be deducted from what they're sending, so the receiver gets less. The change address which receives the change should be accessable by the account and should somehow be able to be shown in their balance. So if i send 1BTC of a balance of 2BTC, i would like for my balance to show 1BTC, not 0BTC.

I suppose i have to use raw transactions to accomplish this and directly specify which inputs to use for the transaction? i just heard that it's very likely to make mistakes when using this, and it's for advanced use only. I'd like to keep it as simple as if at all possible... :-)

Also in the example the 2BTC balance should be considered one input which would mean that the entire balance would be empitied for the user when trying to send some of it. I need to show the expected balance :-)

It sounds like there is a misunderstanding of how accounts work (which is not surprising given that the accounts system is very unintuitive).
First of all, addresses are only tied to accounts for receiving, not sending. So when you send from an account, any input associated with any address in the wallet can be selected for the transaction. During that send, the account's balance is deducted by exactly the amount that was sent. Change goes back into the wallet and has no effect on the balance as it was not sent from the account.
The account field in listunspent is slightly misleading as outputs are really not associated with accounts at all. When you send from an account, ANY output can be chosen as inputs for the transaction, not just ones that are part of the account.
When sending, because you know the recipients address, you can use the subtractFeeFrom parameters of sendmany or sendtoaddress to specify that the fee will be subtracted from the specified addresses (i.e. the recipients). This should still deduct from the account balance.

Thank you Andrew for clarifying. I really appreciate your efforts to helping the Bitcoin community.
One thing i still need to get clarified "During that send, the account's balance is deducted by exactly the amount that was sent".
I suppose i have to use sendmany then, since i don't understand how the users accounts balance can be deducted by the exact amount when nothing specifies it to with SendToAddress, which uses default "" account?
Can you elobarote on the subtractFeeFrom parameter in sendmany?  With sendmany you specify the receipient address, which pays the fee instead?

also what if i leave the subtractFeeFrom parameter empty, will it then deduct from the amount specified instead, so the sender pays the fee? From rpc documentation it seems that "If no addresses are specified here, the sender pays the fee."

Last thing; how should i check what the account is actually able to maximumly use/spend, currently in the UI it's just based on the getBalance(account)
Should i in this case use listunspent and filter based on what is inside the account and the corresponding balance to then add them up?
or perhaps loop through all generated addresses, for example:
listunspent 0 9999999 "["3QsuwHtXsWP8vLFZiGL2VK4MEf93YRuVkk", etc, etc, etc]"

Right, if you want to use accounts, you have to use sendmany or sendfrom. With sendmany, you specify the address(es) that the fee will be deducted from. Those addresses must be recipients and their outputs will have an equal amount subtracted in order to pay for transaction fees. If you do not specify subtractfeefrom, then the recipients will pay the full amount and the sender sends a little bit more to cover the transaction fees. What do you mean by "maximumly use/spend"? Again, the accounts and their balances are not tied to outputs (so listunspent is irrelevant).

Thanks. What i mean by maximumly use/spend is, based on an accounts receive and sending history that the amount which the account legitimately has as a final balance after all previous transactions are able to be sent out of the wallet. Perhaps this visual will explain it better: https://imgur.com/a/a3qnu5V

So lets say i have a balance of 3BTC, sending half of it using:
SendMany("hello@me.me", 3.........: 1.5, 1, "", [3...........], 0, 15)
Now half the balance of the account has been sent, and the fee will be paid by the receiving address (3...).  Now listunspent and getBalance on the account should reflect that an input has been spent, and totally there is 1.5BTC left which can be sent out of the account in a new transaction, if they wish? :-)

But then you say that accounts and their balances are not tied to outputs, so i guess it's impossible to show individual account balances like i want to based on the transaction movements?

You can't show individual account balances from the transaction history because accounts are not tied to outputs.

Would i be able to do that with a database table (every time an account sends a transaction) its logged to the database, then on wallet load the database is queried, the overall wallet balance is taken getBalance("") and then the amounts sent from the table are deducted from the balance to then match what the account is able to send? Or should i totally scrap anything related to sending transactions, as i heavily rely on individual user accounts.

Er perhaps rather than getBalance of the entire wallet then do getreceivedbyaddress with each account address/getreceivedbyaccount, and subtract the send amounts in the database from this total balance, to reflect what they're able to send

Use getbalance <account> to get the balance of an account. If you have done everything correctly, this value should never be negative (which is actually a possibility) and should reflect how much each user actually has.

I deposit 1BTC, 0.5BTC, 1BTC, 0.5BTC into my account in individual transactions.
I then send out 1.25BTC to an address using SendMany.
The account will be deducted 1.5BTC matching 2 inputs, and the change of 0.25BTC will be sent to a change address.
Doing getBalance(account) will then show 1.5BTC, which is incorrect, it should show 1.75BTC (included the change addr amount)
I suppose the only way to track the correct balance, is to track which inputs were available before the send, and which have been spent by the send? However this seems like a mess. Do you think it could work?

For example:
Check inputs using listunspent.
You receive 3 BTC( 1, 0.5, 1, 0.5).
You send out 1.25BTC
.
Check balance, it should be 1.5BTC.
Check inputs again, look at the difference from earlier (2 inputs of 1.5BTC are gone now).
Add the amounts of the removed input (+=1.5BTC) to the balance of 1.5BTC and subtract the amount sent.
Balance should now be: 1.5+1.5-1.25 = 1.75BTC.

But i don't even know if i can even manipulate the balance like that, only by using move? Seems like a bad idea overall... the confusion and frustration is real :-/ but maybe it might work?

Also sorry i mixed up inputs and outputs. I meant outputs (incoming transactions are outputs, used for inputs in send transaction) would it be possible to link them to accounts as such?

Lets say i dropped accounts and i link my account hello@peterdalby.me to be "" using SetAccount on the receiving addresses to "", i then use SendToAddress and subtract the fee. Would the "" account reflect the correct balance (including the change address amount)? This seem like the simpler "solution". I guess i should've never touched accounts to begin with... The typical uses at the bottom of this (https://en.bitcoin.it/wiki/Help:Accounts_explained) made it seem like it was possible to show individual account balances correctly.

It seems like the only way to ensure that individual account balances will match what they expect after a send is to never send out more than the amount of 1 output received, to remove the change address amount. But the "" account should reflect the change address amount in it's balance, right?

I wonder how the bigger wallets such as Coinbase & Blockchain.info handle individual account balances. I suppose they use rawtransactions to specify the specific outputs to use for the transaction? And then have a massive internal accounting system to keep control of all the movements?

I think the best solution for me is to keep my hands of sending anything, and have individual user accounts export their private keys as strings or QR codes using dumpprivkey on receiving addresses, to then import to a third party wallet and send from there. I'm sad that it came to this, but again i really appreciate the time you have taken Andrew. Sorry for all my stupid ass questions. Understanding everything has been hard, to say the least.


text:
Lost funds on my lightning node?
I've been using lightning network daemon (LND). In an effort to have a balanced node with somewhat equal amounts on both side of my channels, I've sometimes opened channels with the command lncli openchannel Xdest_nodeXX local-amt push-amt and specify push-amt to be approximately 50% of the local-amt. Over the last year or so I've opened and subsequently closed numerous channels in this way. This discussion on stackexchange indicates the funds are irretrievably send to the other node and my funds are lost! Is that true?

Yes. Unfortunately this is true. Using push-amt means that you send over an amount to the other side wich they own. While it takes place offhand it is final in a similar way as sending Bitcoin to an address.
The only way I see to get your funds back is if you talk to the owners of the nodes you opened channels with explain them the situation and ask to get reimbursed.

F*!$& idiotic, particularly that there isn't better documentation to that effect. People need to be informed of this.


text:
How do I compile Bitcoin Core to be more portable?
Background: I compile bitcoind on one system but run it on another. When I compiled bitcoind 0.19.1 some time back using the following method, I was able to run bitcoind and bitcoin-cli on the target system without issue
./autogen.sh
./configure --disable-wallet --disable-tests --disable-bench --disable-gui --enable-util-tx=no --prefix=$HOME/bitcoind/x64 --exec-prefix=$HOME/bitcoind/x64
make && make install

Today I compiled v0.20.0 using the same method. If I run ./bitcoind -version on the system I compiled the binary it runs fine, but if I take the binary to my target system I get the following error:
./bitcoind: error while loading shared libraries: libboost_filesystem.so.1.67.0: cannot open shared object file: No such file or directory

The binary seemed to be portable last time, and the pre-compiled binary I download from the Bitcoin Core team runs fine.
Note that on the target system libboost-filesystem-dev and libboost-filesystem1.67-dev are not installed, this is likely the source of my error. That said, running the pre-compiled binary from the Core team runs, so why doesn't mine?
Can someone help me understand if I did something wrong or if I need to add ./configure flags to make the binary more portable? Specifically what I likely did differently than the core developers that made my binary fail where theirs worked?
EDIT 1: Running ./configure --enable-static or ./configure LDFLAGS=-static does not result in a portable binary either.
Also note that installing libboost-filesystem library with apt does fix the error.

By default, the binaries that you build are dynamically linked. This means that they use libraries installed in standard search paths on your computer. What you want is a statically linked binary where those libraries are packaged together with the binary.
Bitcoin Core achieves this by using the "depends" system. Documentation for this can be found here and in the windows cross compilation docs.
Basically, you cd into the depends directory, run make in there, then back in the root directory, you configure and point to the configuration stuff produced by the depends system, and when you compile with make, it will use the libraries build in the depends system and be statically linked.
For example, you might do these commands:
cd depends
make HOST=x86_64-pc-linux-gnu
cd ..
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/
make

x86_64-pc-linux-gnu is the platform that you want to build binaries for. The depends system will create a directory in depends/ with that name. That directory contains the depend system's build results.
The resulting binaries should be portable.

That did it, thanks! I ran make in the depends directory as you mentioned, but changed the ./configure line to the following: ./configure --prefix=$PWD/depends/x86_64-pc-linux-gnu and it worked great

@Mike this will move your binaries to $PWD/depends/x86_64-pc-linux-gnu right?


text:
How is the reward that you got after calculating the right hash added in the blockchain?
I have a question. If for each transaction, the hash is calculated and so the pool who calculates it gets the bitcoins as reward, now getting reward means bitcoins gets added to your wallet, but this also becomes 1 transaction so doesn't it require that transaction to be included as well? And if yes, then doesn't the process become recursive?

When you are mining, you always compute hashes of blocks assuming that you will be the one to find the block. So you already include this special transaction, known as a coinbase transaction (not to be confused with a transaction made using the service Coinbase - here coinbase just means coin generation), in the block you're hashing. If you're right, then great, you've found a block and included a transaction that sends 25 BTC + transaction fees to yourself. If you're wrong, and someone else finds the block first, there's no harm in that. Just give up on the current block and start working on the next one.
For a more technical side, when you compute a hash you're really hashing the block header. It includes a bunch of things, one of which is the hashMerkleRoot, a hash of the transactions in the block.

Yeah I understood that but this 25BTC + transaction fee amount will be added to my account, so this transaction also needs to get added in blockchain right???

As I said, you put this coinbase transaction into the block before you even find a hash for it. When you find a qualifying hash, you're ready to submit it to the network.

k k got it..It means coinbase transaction is the one who will pay you reward and will add this transaction in block chain???

@Pooja: Yes, that is right.

ok ok Thanks Tony for clearing my doubt. Thank you Murch.

I have another doubt, how many worker nodes can be there in one pool? and how work get divided in pool? what algorithm worker node uses?

There can be arbitrarily many workers in a pool. Everyone gets the same work, but faster miners submit shares faster. Workers use the same algorithm as whatever the network is at (which is SHA-256 for Bitcoin), but at a lower difficulty.


text:
Access coins stored at Cryptobridge?
I have just discovered, albeit far too late, that Cryptobridge has closed.
Now, there is a lot to say about this particularly dodgy move, but I won't and I'll keep this simple:
How can I access the coins stored in the Cryptobridge wallet?
I saved the .bin file and can access my Bitshares account via OpenLedger, but the only coin listed is Bitshares. Bitcoin is just one of the coins that are/were stored in that wallet.
I've searched around and a few forums say it's possible by logging in to another exchange. Well, that's what I've done and that clearly didn't work.
I am hoping that this simple question has a simple answer, even if that answer is: "You can't."

P.S. I searched for this question on here but couldn't find it. I found that quite surprising.

Do you have a backup for the wallet of any sort? Eg a mnemonic seed phrase, or a wallet.dat file or equivalent. If yes, you can probably recover your coins. If no, you're out of luck.

The .bin file is the equivalent.

How can I access the coins stored in the Cryptobridge wallet?

According to Cointelegraph in late 2019:

[CryptoBridge] announced that all of the firm’s services and servers will be terminated within two weeks. Users will be able to withdraw funds from the exchange until Dec. 15 — the last day of operation.

I'm not familiar with CryptoBridge but it seems like they acted as custodian of Bitcoin and other cyptocurrencies and used their Bitshares blockchain to keep track of their customer's funds. If so you don't have any direct way to recover control over the money that you transferred to CryptoBridge.
Any keys or backups you have might only give you control over their Bridgecoins and those appear to have no value now and are probably not exchangeable into other cryptocurrencies.

I am hoping that this simple question has a simple answer, even if that answer is: "You can't."

I think that is the simple answer.

As I suspected. Thanks.

Yet another ‘DEX’ that is actually fully centralized around a custodian/admin of some sort... what a sham. ‘DEX’ is pretty much a marketing buzzword at this point, not a technical specification. Sorry for your losses :(


text:
How to get unconfirmed transactions
I am trying to learn how mining is done in bitcoin , wrote a simple mining code in python that works fine on sample data set of raw json coming from https://btc.cryptoid.info/btc/block.dws?693649.htm, but these are all mined blocks .
How to get unconfirmed transactions and make a block and submit the proof of work. I referred to below link but none of the links mentioned in the page are working.
https://en.bitcoin.it/wiki/Getblocktemplate
This is purely for learning purpose, I am not trying to make money out of this mining .
Thanks In Advance.

How to get unconfirmed transactions [...]

To be notified of new unconfirmed transactions, to retrieve them and to make other nodes aware of blocks you have mined you will need to implement the Bitcoin peer to peer protocols as described at https://developer.bitcoin.org/reference/p2p_networking.html

[...] and make a block [...]

You say you already have written code that does this.

[...] and submit the proof of work

The proof of work is in the block header you produced, it's the hash you produced that is lower than the current network target.
You "submit" the block by using the Bitcoin peer to peer protocol to make peers aware that you have new block data they can retrieve. Essentially you send an inv message that lists your new block. Any interested peer can then send your node a request for that block.
If you are mining in a pool, you instead implement whichever network protocols are used by your chosen pool. For example stratum V2
Since you are doing this for learning purposes you should not do any of this on mainnet, but should probably do all this on the network designated for testing.


text:
A person paid me with a fake check. How can I report a fraud?
A person paid me with a fake check. I deposited the check through an ATM, and the money went into my account, so I made a Bitcoin transfer to him. But yesterday, the bank took the money back from my account because they are fake checks.
I have only the wallet ID and the TX ID. All the other information that they provided to me is fake.
Can I do something?

You cannot do anything aside from trying to seek legal action. Transactions on the bitcoin network cannot be undone.

In addition to @m1xolydian answer, You should be careful while selling Bitcoin, Never deal with Bank transaction/Checks/Credit Card Payments as final even if you got the money from the bank to your hands.
Don't you wonder why %99 of Bitcoin wallets don't support credit card payments for buying bitcoins? Because of Bitcoin transactions are final and they can't do a chargeback.

Depending on the country, you can often report handling in fake cheques and fake ID's to the relevant authorities e.g Police, Gov't Department, etc. sometimes there are several relevant bureau's.
It is sound business advice to always wait for a cheque to clear before accepting it as payment, which it seems that you did in this case (in Australia once the cheque clears it is ordinarily final - they pass the cheque to the originating bank for verification before honouring it and if you want it done straight away there is a hefty fee but they still run it over to the appropriate branch bank to be checked and cleared) but, nonetheless you need to allow for both clearing time and bounce time after that.


text:
transaction broadcasts, declining node count, mining basics and costs.
I read a lot about bitcoins and mining and nodes but there are a few questions that are still not answered, which are the following:

As I read when a transaction is broadcasted, at first it gets confirmed by active nodes and later goes to mempool and miners pick the ones with higher fees. So the question is, when I make a transaction on a website how can I make sure that the website is broadcasting my transaction? Maybe the site is holding it because it has high fee so that he can include it in his own block?
I noticed that nodes are becoming fewer every day , does this mean
when they become less the security of bitcoin or its value will
decrease ?
In order to become a miner, do you have to be a node too?
Btc.com has a crazy fast hash rate. Is it even worth to get into mining?
Say I want to become a miner with a chance of solving at least one block in a month, approximately how much should I invest? And should I buy cloud space or mine on my own?

When making a transaction, it is always broadcast on the entire p2p network. Either from the node your wallet is running on, or from the connected node, in case of a light wallet (SPV).
Value is not connected to node count. Security only to a minimal degree. The decrease must  be a short term effect. In the long run, node count will increase with adoption.
In theory yes. In reality, you would point your miners to a pool, which will be running a node.
Unless you have to access to electricity at industrial rates, mining is not profitable any more. The profits you might make will be from BTC price appreciation, which you can also achieve by just buying and holding BTC.
You can calculate your rewards by the ratio of your equipmemts hashrate to the overall network hashrate. E.g. you have 1/100000 of the network's hashrate under your control, you can expect to mine 1/100000 of the block rewards, which will yield you 0.000125 BTC every 10 minutes.
Avoid cloud mining, as it is more profitable for the service provider than you. Often, those operations are even outright scams.

As I read when a transaction is broadcasted, at first it gets confirmed by active nodes and later goes to mempool and miners pick the ones with higher fees. So the question is, when I make a transaction on a website how can I make sure that the website is broadcasting my transaction? Maybe the site is holding it because it has high fee so that he can include it in his own block?

The vast majority of BTC-transacting services and wallets are not miners. They have no incentive to hold your transaction to include in their own blocks. You can also verify that a tx has been broadcast by looking up the txid on an unrelated blockexplorer.

I noticed that nodes are becoming fewer every day , does this mean when they become less the security of bitcoin or its value will decrease ?

While fewer nodes do have a negative effect on the network, they will not really decrease the security (although if the number of nodes really falls off a cliff it could allow attackers to more easily divide the network and cause a chainsplit; however, I do not have any concrete numbers for this). As long as there is a copy of the blockchain available, and enough nodes to route to each other safely, the network will carry on.

In order to become a miner, do you have to be a node too?

In the original implementation, all nodes were meant to be miners. Today, since the advent of ASICs, this is impractical. If you are mining as part of a pool, you do not need your own node. If you are running a pool, you do.

Btc.com has a crazy fast hash rate. Is it even worth to get into mining?

BTC.com is a mining pool, one of many. Their hashrate is comprised of the hashrate of all of their members. If you are able to contribute a high enough hashrate with cheap enough electricity, it can still be profitable to mine.

Say I want to become a miner with a chance of solving at least one block in a month, approximately how much should I invest? And should I buy cloud space or mine on my own?

It's difficult to answer this authoritatively, as the network difficulty is always changing (every 2016 blocks). Solo mining a block every month, even with ASICs and cheap electricity, is impractical without investing millions in hardware (at which point you might as well just run your own pool).
Most people mine as part of a pool, which tends to find multiple blocks in a day. Each person is then paid a share from each block, proportional to the amount of work they did. This technique can be profitable if you have cheap enough electricity, and the price of BTC doesn't drop too much. However, even this requires upfront investment into one or more ASIC miners, which can cost upwards of $1000 (an S9 costs $1010 at the time of writing).


text:
In a multisig wallet setup what needs to be backed up and why?
In a multisig wallet setup what needs to be backed up and why?

Ben Kaufman answered this on Twitter.
The main caveat in a multisig wallet is that, while you need only a threshold of devices (ie. 2 of 3, 3 of 5, etc.) to sign a transaction, losing access to even a single device could potentially prevent you from being able to spend the funds - if you don't back up properly!
The reason is that (usually) in order to make a Bitcoin transaction, it is not enough to be able to sign it, but you also need to provide the "terms for spending", that is, the Script (code) that is used to lock the coins.
That's because the full script is usually not stored directly on the blockchain, but only as a hash (a unique identifier of it). In a single key wallet, this is trivial.
The script is composed of the public key of your wallet and a few standard commands - and satisfying it requires the signature for that key, so both the script and signature can be constructed by having access to that one private key.Then on spending, you need to provide both the original script code which matches that hash, and satisfy any condition that the script may include.
With a multisig, this is not the case. The script for a multisig contains the list of public keys of all possible cosigners - which means it can be constructed only by knowing the public keys of ALL devices in the multisig, not just of the devices you are signing with.
To demonstrate, let's assume a 2 of 3 multisig. When you want to get an address of your multisig, your wallet software is taking the public keys of all 3 cosigners, lists them in a standard way inside a script, hashes it, then with this hash constructs the address.
When receiving bitcoin to that address, there is a "commitment" on the blockchain for all 3 public keys, out of which 2 signatures are needed. But the public keys themselves are not listed yet on the blockchain - you must provide them too when spending from the address.
Now assuming you have lost access to one private key (a device and its mnemonic backup), you won't be able to tell its public key anymore - so you won't be able to reconstruct the script of the address. So even though you have enough signatures, you won't be able to access funds.
The solution - which is the extra step of a multisig backup - is to also keep a backup of the list of public keys (xpubs) of all cosigners, from which you will be able to recreate the script.
Since this list of public keys does not contain signing (private) keys, there is no risk of losing funds even if an attacker manages to access it, but this would be a privacy concern since the attacker will then be able to see the balance on the multisig wallet.
That's why it is not recommended to leave this file on some cloud backup or some other insecure option.
It's recommended that you keep it with each one of the cosigners/ seed backups so that you can recover regardless of the combination of signers you eventually use.
Besides the list of public keys, it is also necessary to know the script type used (whatever native SegWit, nested SegWit, or legacy), and the threshold chosen in order to construct the multisig script. These are possible to know by guessing (brute force), but better keep it too.
The last piece which you should include is the derivation paths used for each device. Each derivation path tells your wallet how to turn each master public key, into a different individual "disposable" public key used to generate every new address.
This data of derivation paths is standardized so that all wallets should use the same derivation path by default, but it is best to keep that around too especially if you use a unique one for some reason.
This might sound like a lot of components, but to simplify usage, there’s a standard for storing and recovering such information, which is called Output Descriptors.
Just as an example of what the final backup might look like, here are a few pics of a PDF backup generated from Specter Wallet.

This contains the individual devices keys list, as well as everything in an output descriptor format (and a bit of extra data like wallet name etc.)
You could save this by simply printing the PDF, storing it on an SD card, or just keep it encrypted on a cloud backup. What you need to remember is:

You need this information to recover the wallet.
Anyone with access to this information can see your wallet history.

So to simply sum it up, the additional piece you should backup when using a multisig wallet is the output descriptor - a list of the public keys of the cosigners with some data on the wallet.
This information is possible to derive only with access to all devices in your multisig and is necessary to spend from it.
So to remove the single point of failure of losing access to one cosigner, you should keep this backup along with each of your devices.


text:
Should the Policy to Miniscript compiler(s) be considered as deterministic and is this the end goal?
Should the Policy to Miniscript compiler(s) be considered as deterministic and is this the end goal?
This question was asked by Jeremy Rubin on ##miniscript on IRC and has been paraphrased.
For basic explanations of Policy and Miniscript see this previously asked question.

The mapping between Miniscript and Script will never change. (At least, not without a major version bump of this library and at this point, probably a "Miniscript 2" which is billed as a different language.)
The mapping from Policy to Miniscript may change even between successive runs of the compiler.  Currently, the Miniscript compiler produces the most optimal compilation in terms of average satisfaction costs but the compiler internal uses non-deterministic HashMap traversal. It might produce two different compilations of the same average satisfaction cost. So it is not advised to rely on the Policy compiler producing the same results. Even the C++ and Rust implementations may differ in actual Miniscripts but will have same average satisfaction costs.
In the future the compiler could be improved and Miniscript extended. In addition there may be auxiliary information someone has that changes the optimal script but doesn't fit in the currently accepted Policy compiler. Policy language and the current compiler should be seen as a demo and not the final authority on declarations of Miniscript. The real value of Miniscript comes with being able to reason about arbitrary scripts that people give you regardless of how they came up with them. If you reduce that to needing the Policies they were compiled from you're massively restricting its possibilities.
There is a concern that the ecosystem comes to implicitly rely on knowing Policies in this quick and dirty Policy language and a compiler can't evolve because of it. The end goal should be eventual interoperability and the the layer at which things interact should be Script/Miniscript not Policies.
This question was answered by Sanket Kanjalkar, Pieter Wuille and Andrew Poelstra on ##miniscript on IRC but has been paraphrased. Any errors are my own (and I will gladly correct).


text:
What is the benefit of forced signaling in a soft fork activation mechanism?
What is the benefit of forced signaling in a soft fork activation mechanism? e.g. the MUST_SIGNAL phase in revised BIP 8.
I understand the benefits of setting lockinontimeout (LOT) to true (some of those benefits are described here) but why have a period of say two weeks when miners have to signal before the soft fork moves into the LOCKED_IN phase. Why not just define when that LOCKED_IN phase will begin (assuming miners fail to activate the soft fork before then) and ditch the MUST_SIGNAL phase?
Matt Corallo states "Forced signaling isn’t required for many flag day designs, and is the biggest single risk of any proposed feature for an uncontroversial activation."

A two week (2016 blocks) forced signaling phase has two major advantages.
Firstly, it offers a signal to the network that miners will be enforcing the soft fork rules in the next phase following the forced signaling. It is an imperfect signal as miners could follow the forced signaling and then not enforce the soft fork rules but it is better than nothing. To actually do this would suggest maliciousness or incompetence.
Secondly, it presents the possibility for mined blocks that aren't signaling being rejected in advance of when soft fork rules are supposed to be enforced. Not only does this provide an incentive for miners to signal (their mined blocks could get rejected otherwise) but it attempts to, temporarily until they agree to enforce the soft fork rules, kick them off the network so only miners that are enforcing the soft fork rules are on the network post activation. The whole point of soft fork activation is to attempt to coordinate across economic full nodes (and miners) a block height for when soft fork rules will be enforced from. We attempt to do everything possible to provide clarity to the network on what this block height is. In a scenario where miners have failed to meet the signaling threshold for a long period (e.g. a year) forced signaling is an important tool in the toolkit. If miners meet the signaling threshold in advance of the forced signaling it obviously is not needed.
Luke Dashjr stated on IRC:

The primary purpose is to definitively indicate the soft fork is active on the chain. While it still relies on enforcement, this ensures there is no dispute over what the correct rules are. As a side effect this also makes it easy for any group of dissenters to reject the new rules. The intent of a soft fork should never be to literally force new rules (upon dissenters)

(Luke is referring to dissent against the soft fork rather than dissent against the activation mechanism set in a Bitcoin protocol implementation.)
David Harding added that MUST_SIGNAL forced signaling has additional value in a scenario where there are both BIP 8(LOT=true) and BIP 8(LOT=false) nodes on the network. It ensures the soft fork activates for nodes setting LOT=false when the majority of the network is setting LOT=true.

I run a node with LOT=false; everyone else runs a node with LOT=true. At block xxxxxx, y'all start enforcing taproots rules, but I never saw any signal, so I continue treating taproot transactions as anyone-can-spend, which is bad for me personally.  If there are a lot of people with LOT=false, it also makes it unclear whether taproot is really being enforced, increasing the risk that miners may try to steal funds sent to taproot outputs.

In addition David Harding argues that forced signaling is not particularly dangerous.

What makes forced signaling so dangerous?  We had that with the BIP34, BIP66, and BIP65 forks.  Except for a hiccup with BIP66 due to spy mining, I don't think there was any problem. BIP8 forced signaling is also only required for a brief period, so any disruption should be short

Comparing a forced signaling phase to a flag day was discussed further on this BIP PR.

It should be noted that the new rules can be just as easily rejected without forced signalling by requiring that the block at activation height is invalid according to the rejected rules.
Can you elaborate what "no dispute over what the correct rules are" means? There can be dispute over what a signalling bit means just as well as there can be dispute over what a flag blockheight means.

Thanks for the comment nickler. It is Luke's quote but my understanding of "correct rules" is whether the network is enforcing the soft fork rules or not. Indeed a forced signaling bit is not perfect in this respect but it is better than nothing. At least in my eyes following forced signaling but then not enforcing the soft fork rules afterwards demonstrates either maliciousness or incompetence. Although these are both possible you would expect in majority of cases that miners following forced signaling demonstrates that they will be enforcing the soft fork rules in an upcoming phase.

It depends highly on who you ask. Indeed, I (and several others) have argued that there is no reason whatsoever for forced-signaling. Greg Maxwell wrote a long and in-depth piece about why it provides no additional assurances beyond what any soft fork provides on GitHub, which is likely of interest to anyone coming across this post. Ultimately, the point is all about "when is a soft fork active". Probably the best resource on the subject is Pieter Wuille's old post from 2015 on bitcoin-dev, but to summarize, the answer is, largely "when it is understood that the vast majority of economic nodes in the Bitcoin system are enforcing the rules via full node software which they run", in other words "when full nodes are enforcing it".
Some confusion has entered the discussion as, in many past soft forks, we've utilized miner signaling to bridge the gap between old full nodes unaware of an upgrade and new full nodes enforcing the rules. Effectively, we've said "the soft fork is active when new nodes have upgraded and miners have signaled readiness above a certain threshold" - ultimately it's about nodes having upgraded and enforcing the rules, but there's nothing to stop us saying "nodes only enforce the rules if miners upgrade". Similarly, there's nothing wrong with saying "nodes always enforce the rules, because miners aren't doing something users want".
In general, the argument in favor of forced-signaling basically goes like this: "if we start by assuming users are running software which interprets the signaling bit, then ensuring the bit is signaled on ensures that users are enforcing the rules". However, there's not a lot of reason to make that initial assumption. The reason we do use miner signaling in the first place is it reduces the risk of forks and reorgs visible to un-upgraded nodes - something that could expose some users to fund thefts due to double-spend. However, if we use forced-signaling, that advantage goes out the window, indeed, we get the exact opposite outcome - on day one of the fork, we immediately create reorgs visible to un-upgraded nodes, putting their ability to accept payment at risk.


text:
What is Valgrind? When should I use it for debugging Bitcoin Core over using gdb, lldb, pdb etc?
I was watching Fabian Jahr's presentation on debugging Bitcoin Core at Bitcoin Edge Dev++ 2019. He mentioned Valgrind briefly at the end. What is it and when should I use it over gdb, lldb, pdb etc?

If you watched Fabian's presentation (or read the transcript) you'll have seen that he said you can use Valgrind for memory leak checks and that it can be used similarly to lldb.
valgrind --leak-check=yes src/bitcoind -regtest

There is a section in Fabian's doc on debugging Bitcoin with instructions on how to install Valgrind on MacOS and run it.
Install Valgrind:
brew install --HEAD https://raw.githubusercontent.com/sowson/valgrind/master/valgrind.rb

Run bitcoind with Valgrind:
sudo valgrind src/bitcoind -regtest

Valgrind has also been added as flag to the functional tests in Core in PR #17633 so you can run:
test/functional/test_runner.py --valgrind

The --valgrind flag is documented as a Valgrind memory error detector and that you should expect at least a ~10x slowdown with Valgrind 3.14 or later required.
In that PR practicalswift states:

Regular functional testing under Valgrind would have caught many of the uninitialized reads we've seen historically.

Another great resource is a Bitcoin Core PR review club session (hosted by Jon Atack) on running the unit tests under Valgrind. In the notes for that session it describes:

Valgrind is a debugging and profiling tool suite to make programs faster and more correct. Its most popular tool, Memcheck, can detect memory-related errors common in C and C++ programs that can lead to crashes and unpredictable behavior. Here is a tutorial. Memcheck is not perfect: typical slowdown is 3-10x, memory usage is 2x, it can produce false positives (there are mechanisms for suppressing these; see the valgrind.supp file in Bitcoin Core), and it doesn’t currently detect out-of-range reads or writes to arrays allocated statically or on the stack.


text:
Generate new .onion address for bitcoind over tor
Been following this guide just to tinker around with bitcoind over tor. According to the guide, when bitcoind controls the tor daemon using controlport=9051 whenever you restart bitcoind tor should generate a new .onion address. This is not happening. If I restart bitcoind, tor or both, it always uses the same old .onion address. A fully system restart doesn't work either.
how do I generate a new .onion address?
Note: I am NOT using /blah/var/hidden_service and cannot just delete the private key in that folder. When using controlport there doesn't seem to be a private key anywhere. Or is there?

bitcoind will cache the private key used. It is located at in the onion_private_key file in your bitcoind data directory (default will be ~/.bitcoin/onion_private_key). Delete that file and you should get a new onion private key and thus a new onion URL.

Perfect. How is this not documented anywhere. I've been searching high and low. Even TOR's official manual/guide says it will generate a new .onion when bitcoind reboots

It's mentioned here: https://github.com/bitcoin/bitcoin/blob/master/doc/files.md, but I agree that the documentation could use some work.


text:
LoadBlockIndexDB: transaction index disabled after copying blockchain
Previously discussed here: LoadBlockIndexDB: transaction index disabled but thread was abandoned. Started a new thread here.
Twice I have gotten the same error:
2018-11-20 15:43:41 LoadBlockIndexDB: transaction index disabled
2018-11-20 15:43:41 : You need to rebuild the database using -reindex to change -txindex. Please restart with -reindex or -reindex-chainstate to recover.
2018-11-20 15:43:41 Aborted block database rebuild. Exiting.

Here is my procedure that results in the error:

Shutdown bitcoind on server #1
ran rsync -Lru --info=progress2 /path/to/blockchain /path/to/external/usb (note: /path/to/external/usb is a BLANK directory on the external drive)
unmounted external USB
plug into Raspberry Pi, boot
Made sure blockchain was visible in /home/USER/.bitcoin
Ran bitcoind at the terminal.

Notes:

txindex is turned on in bitcoin.conf on server #1
txindex is also on in bitcoin.conf in /home/user/.bitcoin. on the raspberry pi I can verify bitcoind on the raspberry pi is loading that exact .conf, see the log below.
commenting out #txindex in the bitcoin.conf file and simply running bitcoind with no flags results in a successful startup.

Here's the output of my log file when it failed:
    2018-11-20 15:43:13 Bitcoin Core version v0.16.3 (release build)
    2018-11-20 15:43:13 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
    2018-11-20 15:43:13 Assuming ancestors of block 0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0 have valid signatures.
    2018-11-20 15:43:13 Setting nMinimumChainWork=000000000000000000000000000000000000000000f91c579d57cad4bc5278cc
    2018-11-20 15:43:13 Using the 'standard' SHA256 implementation
    2018-11-20 15:43:14 Default data directory /home/satoshi/.bitcoin
    2018-11-20 15:43:14 Using data directory /home/satoshi/.bitcoin
    2018-11-20 15:43:14 Using config file /home/satoshi/.bitcoin/bitcoin.conf
    2018-11-20 15:43:14 Using at most 64 automatic connections (1024 file descriptors available)
    2018-11-20 15:43:14 Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
    2018-11-20 15:43:14 Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
    2018-11-20 15:43:14 Using 4 threads for script verification
    2018-11-20 15:43:14 scheduler thread start
    2018-11-20 15:43:14 HTTP: creating work queue of depth 16
    2018-11-20 15:43:14 No rpcpassword set - using random cookie authentication
    2018-11-20 15:43:14 Generated RPC authentication cookie /home/satoshi/.bitcoin/.cookie
    2018-11-20 15:43:14 HTTP: starting 4 worker threads
    2018-11-20 15:43:14 Cache configuration:
    2018-11-20 15:43:14 * Using 50.0MiB for block index database
    2018-11-20 15:43:14 * Using 8.0MiB for chain state database
    2018-11-20 15:43:14 * Using 342.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
    2018-11-20 15:43:14 init message: Loading block index...
    2018-11-20 15:43:14 Opening LevelDB in /home/satoshi/.bitcoin/blocks/index
    2018-11-20 15:43:15 Opened LevelDB successfully
    2018-11-20 15:43:15 Using obfuscation key for /home/satoshi/.bitcoin/blocks/index: 0000000000000000
    2018-11-20 15:43:40 LoadBlockIndexDB: last block file = 1437
    2018-11-20 15:43:40 LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=57, size=71779403, heights=550735...550791, time=2018-11-19...2018-11-20)
    2018-11-20 15:43:40 Checking all blk files are present...
    2018-11-20 15:43:41 LoadBlockIndexDB: transaction index disabled
    2018-11-20 15:43:41 : You need to rebuild the database using -reindex to change -txindex. Please restart with -reindex or -reindex-chainstate to recover.
    2018-11-20 15:43:41 Aborted block database rebuild. Exiting.
    2018-11-20 15:43:41 Shutdown: In progress...
    2018-11-20 15:43:41 scheduler thread interrupt
    2018-11-20 15:43:41 Shutdown: done

I COULD just run bitcoind -reindex but that doesn't solve the problem of 'what is causing the txindex database to not work between machines.' I feel like this is an important question to answer.

Are you using the same version of Bitcoin Core on both machines? Which files and directories are you copying over (give filenames, not just "blockchain")

Server #1 BCC version: 0.17.0.1
Raspberry Pi BCC version: 0.16.3
I'm copying the entire bitcoin directory including: banlist.dat,  bitcoin.conf,  blocks,  chainstate,  database,  debug.log,  fee_estimates.dat,  indexes,  mempool.dat, and  peers.dat
I bet the version difference is the problem. I'll upgrade BCC on the RPi

Yes, in 0.17 the format of the txindex changed, so 0.16 will see it as a database without txindex.

Bitcoin Core 0.17.0 changed how the txindex is handled. The txindex is no longer stored where it used to be, so using a data directory from 0.17.0+ with an older version of Bitcoin Core will result in the older version not recognizing the txindex. You will need to upgrade your raspberry pi to use Bitcoin Core 0.17+.

I can confirm this fixed the problem


text:
scriptcode, scriptsig, pubkeyscript confusion
I've been banging my head on a desk for a few days trying to understand the segwit protocol properly.
Another roadblock has thrown me off-guard and I am struggling to grasp the concept of "scriptCode:" used in the signature examples of bip0143 https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki#specification
I understand that a scriptPubKey is basically the locking conditions put on an output when spent. And I also understand that scriptSig is to redeem a previously locked output (destined for my pubkey/pubkeyhash).
I had come to pretty good grips with what I have just stated above, with the scriptSig data items being pushed onto the stack then getting evaluated by the pubKeyHash ect. But now there is this weird "scriptCode" field delcared that looks suspiciously identical to a p2pkh pubKeyScript.
So I came to the conclusion that it is just used the same in every hashPreImage:
DUP  HASH160  <keyhash>  EQUALVERIFY  CHECKSIG

But then I started thinking about stack evaluation order and got confused again. What is the order of stack evaluation? Is it: scriptSig data push > pubKeyScript evaluation > scriptCode? What about if there is witness data invloved? When is that pushed onto the stack? Or am I totally missing the point here?
Another thing I am confused about is p2sh-p2wpkh evaluation. I do not understand why the scriptSig has to be a push of the redeemScript:
 0 <20-byte-key-hash>

re-emphasising my main question. I am struggling with the concept of scriptCode and script evaluation order in general. I would like to know if the scriptCode is always the same format if I am only planning to sign p2sh-p2wpkh, pk2pkh, pk2pkh

The execution order is:

scriptSig/witness to construct the initial stack
scriptPubKey (which may invoke redeemScript evaluation in case of P2SH, and witness script invocation in case of P2WSH)

The scriptCode is simply a name for "the code being executed". Inside scriptPubKey evaluation, it is equal to the scriptPubKey. Inside redeemScript evaluation, it is equal to the redeemScript. Inside witness script evaluation, it is equal to the witness script.

Okay, I kind of understand the execution order a bit better. But I still don't understand what scriptCode is. Is it just scriptPubKey when signing an input? You might have to break it down for me in simplistic terms of why it is used. I know it checks the signature of the resulting stack containing pubkey and signature but what is the duplication (OP_DUP) and the push of data for? I thought this matching keyhash OP_HASH160 business was already done by the witness + scriptsig + scriptPubKey.

The reason it is used is historical. It just happens to be there. Yes, when you're signing an input it is it equal to the script which contains the CHECKSIG opcode which is going to verify your signature.

I'm not totally understanding this either, from my understanding the scriptCode in the bip143 p2sh(p2pkh) example is never used in execution at runtime? My understanding is that the witness ( ) and scriptSig (<0 <20-byte-key-hash-compressed-pub-key>>) are pushed onto the stack, then the scriptPubKey: HASH160 <20-byte-script-hash> EQUAL is executed, eventually resulting in the execution of    CHECKSIG. At what point does this scriptCode executed, or does it?


text:
What are seednodes?
A follow up from a comment on this answer.
What are seednodes, and how do they differ from fallback nodes?

"Fallback nodes" is a page on the Bitcoin Wiki which lists some reliable Bitcoin nodes. "DNS Seeds" are DNS servers hard-coded into Bitcoin which return IP addresses of Bitcoin nodes which can be used for bootstrapping. "Seednodes" are Bitcoin nodes which have their IP addresses hard-coded into the Bitcoin client (see list here); they're used as an alternative bootstrapping method.

This link from your answer is (three years later) rotten. Fixed link (based on post date).

DNS seeds aren't necessarily "seednodes" as they don't necessarily have have Bitcoin running as well.  Instead these hosts have standard DNS servers with A records that new Bitcoin nodes use for bootstrapping to learn of peers.
Currently, Bitcoin master shows these four:

bitseed.xf2.org
dnsseed.bluematt.me
seed.bitcoin.sipa.be
dnsseed.bitcoin.dashjr.org

Source code:
https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L1170
// DNS seeds
// Each pair gives a source name and a seed name.

// The first name is used as information source for addrman.
// The second name should resolve to a list of seed addresses.

static const char *strMainNetDNSSeed[][2] = {
    {"bitcoin.sipa.be", "seed.bitcoin.sipa.be"},
    {"bluematt.me", "dnsseed.bluematt.me"},
    {"dashjr.org", "dnsseed.bitcoin.dashjr.org"},
    {"xf2.org", "bitseed.xf2.org"},
    {NULL, NULL}
};

Those are DNS seeds. Seednodes are different.


text:
getblocktemplate fails in regtest mode even when it is connected to the other node
I have created two nodes and connected the 1st node with the 2nd node in regtest mode . Now when I make the getblocktemplate command using bitcoin-cli . It fails with bitcoin is downloading the block.
Bitcoin core vs v0.16
admin1@root:~/Projects/bitcoin$ ./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test getconnectioncount
1
admin1@root:~/Projects/bitcoin$ ./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test getblocktemplate
error code: -10
error message:
Bitcoin is downloading blocks.

You need to mine a block so that the software thinks that the blockchain is fully synced. The most recent block in the regtest blockchain is probably old so you just need to mine one more block to make the blockchain "recent".
Just use the generate command. You can do:
./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test generate 1

to mine one block.


text:
Armory issues on macOSX
I bought BTC a few years ago and stored them in cold storage. I encrypted it and saved it in google drive.
Some time ago I decided to check on it. But I couldn't open Bitcoin Armory at all, so in the end I downloaded it via terminal (with cask and homebrew). And that worked!
I opened it, saw I had money but for some reason I couldn't send it. Whenever I would press send button, nothing happened.
So, I reinstalled it a few times and still nothing.
So, I decided a few days ago to delete entire blockchain, remove Bitcoin Core and Armory and remove all files from application support and start over.
Now, I finally downloaded the blockchain with pruning and Armory is stuck on organizing blockchain for a few days now.

So, today I decided to export the keys into Electrum but Electrum says there no Bitcoins inside of it...
I am worried that in the process I didn't accidentally lose them.
My question is, should it take this long?
And what can I do to speed it up, to get to the funds faster?

Armory does not work if the blockchain is pruned. You must have the full blockchain in order for Armory to work.


text:
confirmed but unspent transaction
I have a problem that I hope that you can solve.. I have, for 6 days now, confirmed but unspent transaction.
This is link:  https://blockchain.info/address/37gsnq1RYrUQrFy5jJvwUSBJBQYqSGdWnn
screenshot from my wallet link to blockchain:
Please, can u advice me what to do.. I'm a little desperate now, it has been 6 days and stillI cant reach my funds.
Please help,thank you in advance.
RoTop

Thx Murch for your explanation..excuse my limited English language.
Thing is that I bought with Bitcoin in that transaction BCCash .. Transaction was made in my Coinomi wallet 11.11.2017 and was confirmed on 13.11. And from that point nothing else happened.
I'M stuck.. I don't have BCoin that I spent and I don't have BCoin Cash that I bought..
My situation is not good at this moment..
I contacted Shapeshift exchange and Coinomi and still I didn't get any answer from them..
One thing I don't understand.. Can this transaction be always unspent and have I lost my money ?
I hope I clarified my situation..
Thx in advance for your assistance..
Rotop.

i didnt get any Bitcoincash for this transaction and in my Coinomi wallet it is still unspend (screenshoot). Em I'm in serious trouble?

You seem to be confusing the terms "unconfirmed" and "unspent".
When you create a transaction, you're spending existing unspent transaction outputs (UTXOs) on the input side of the transaction, and creating new UTXO on the output side.
Your transaction is confirmed. This means that the transaction was included in a block and written to the blockchain. The confirmed transaction has successfully signed over funds to the recipient. The output of your transaction being "unspent" means that the recipient of your transaction has not spend the money again, but that doesn't mean that they haven't received it.
The thing that leaves me confused, is your comment that you were expecting to receive Bitcoin Cash for your transaction. Did you sent the money somewhere in order to trade it? If that's the case, you should ask your trading partner what the hold-up is.
If you thought you'll get Bitcoin Cash by sending Bitcoin to a Bitcoin Cash address, you're mistaken.
Bitcoin and Bitcoin Cash are two separate networks. You'll have to recover the Bitcoin Cash by using your Bitcoin private key to create a Bitcoin Cash transaction.

Don't know what the question is, so...
You sent
from:154Ky1D5jKLoViPA1ep1FqaxGa8LNWzmJh
to:  37gsnq1RYrUQrFy5jJvwUSBJBQYqSGdWnn
The payment is done and confirmed.
So, the address 37gsnq1RYrUQrFy5jJvwUSBJBQYqSGdWnn has the funds and it IS spendable.  You can only spend it if it is YOUR address.  If you sent the funds to someone else, then you likely know who you sent them to.  They can spend the funds.


text:
My spv node received in a nTx = 2 in headers message
I am coding an spv node for dogecoin. I am syncing the headers and I am exceping to have nTx=0 for all the headers received but for one of the headers i have a nTx = 2 and some weird data following...
{ version: 6422786,
 previousHash: 'b7ac5cc3ca94d8b154661cba795fc4912f3b6ce83a3c5669053e7f677b360dab',
 merklerootHash: 'd55d5c789080a64707a528ce06c80b36708910d80126f0b0f5c5a73534333354',
 time: 1407228150,
 nBits: 503697504,
 nonce: 0,
 hash: '47cf9eaf17f37672ef610c15c6aeb5257c318e76943b809d79c6fb486fd36115',
 transactionCount: 2 }

I am doing something wrong ?

I think I might have found what I am doing wrong. At one point Dogecoin switch to AuxPow and so I believe that the headers might have a diifferent structure that the one in Bitcoin (because of the lack of documentation for DOGE I use the Bitcoin ones). Here a page which explain the differences : https://en.bitcoin.it/wiki/Merged_mining_specification

I have found what I was missing.
Dogecoin switch to merged mining so the header has a new structure which I didn't know about. I found this wikipedia page (https://en.bitcoin.it/wiki/Merged_mining_specification#Merkle_Branch) which explain everything.
I should have noticed also that my nonce is 0. When I see this and that the next bit is not null I can extend my structure to a merged mining header.
I hope it will help people.


text:
I NEED YOUR HELP URGENTLY Bitcoins
I really need your help on this. It has stated in my wallet that i've received my bitcoins of 1.182691BTC on 29/05/18. This's my wallet address: muFjdWSy2DKStSP2gUH2aHZq6kRBva8ZDV it stated on the insight.bitpay.com. It stated confirmed. However, i can't send out to another wallet address as it stated insufficient funds. Please advise me what should i do? Is it a scam? I really need the money soon. My mum is in icu & needed the money soon. I got into mining because i want to earn more money to help my mum.
My transaction ID is b2898b8c5f5f01f573e768ec21fc4f15c1e433e7255960fb71551f06cec36651. It seems that my transaction confirmed. What should I do next? I’m stuck.

I was told to create a bitpay wallet & tick Testnet & Single Address. And i have received 1.182691BTC on 29/05/18. I wanted to send this bitcoins to localbitcoins to sell my bitcoins, but i was prompt that it's insufficient. I'm wanted to sent out the whole bitcoins i've to my other wallet apps. When i see the insight.bitpay.com, my bitcoins is stated in Total Received & Final Balance. But it's not under Total Sent. And indicated (U) - Output is unspent. This money is very urgent for me, i need it for my mum illness.

What should i do now? There's nothing i can do right? It's a scam right? Now i'm in huge debts. The miner said i will not be able to use them because they're being held in escrow by the bitpay servers due to bit large use of bitcoin payment. Until i pay USD $1000 then they will ask bitpay servers to release it so i can use it.

Yes i do have all the conversations & the profile of the fake miner. He still said he's a christian that won't scam people. He knows my mum illness so he definitely won't scam.

What wallet software are you using? How much money are you trying to send?

I was told to create a bitpay wallet & tick Testnet & Single Address. And i have received 1.182691BTC on 29/05/18. I wanted to send this bitcoins to localbitcoins to sell my bitcoins, but i was prompt that it's insufficient. I'm wanted to sent out the whole bitcoins i've to my other wallet apps.
When i see the insight.bitpay.com, my bitcoins is stated in
Total Received & Final Balance. But it's not under Total Sent. And indicated (U)  - Output is unspent. This money is very urgent for me, i need it for my mum illness.

test net, as the name suggests, is used for testing purposes and not real transactions. The main net is where you get real bitcoins... No wonder why I wasn't able to get this transaction id on any of the websites.

You received testnet Bitcoin, they are completely and absolutely worthless. You do not have any actual Bitcoin.

Whatthe. What should i do now? There's nothing i can do right? It's a scam right? Now i'm in huge debts. The miner said i will not be able to use them because they're being held in escrow by the bitpay servers due to bit large use of bitcoin payment. Until i pay USD $1000 then they will ask bitpay servers to release it so i can use it.

If u have proof of this conversation and the identity of the miner, you could take help from your local authorities. YES, it definitely was a scam.

Yes i do have all the conversations & the profile of the fake miner. He still said he's a christian that won't scam people. He knows my mum illness so he definitely won't scam.

Your "miner" is not a miner, just a con-man. Everything they say is lies to trick you out of more money.

This is a scam.
You should report this to your local police.
However your money is gone and you will never see it again.
If you pay the scammer the $1000 they ask for, they will just come up with another reason that you need to send more money or just ignore you.


text:
Get private-keys from wallet using bitcoinj
I'm using bitcoinj for transferring bitcoin.
Now I want to export private key of my wallet.
So how can I get the private key from bitcoinj?

for address prv key
  void key(){
        ECKey key = new ECKey();
        Address pubAddress = new Address(NetworkParameters.prodNet(), key.getPubKeyHash());
        DumpedPrivateKey privKey = key.getPrivateKeyEncoded(NetworkParameters.prodNet());
        System.out.println("Public address: " + pubAddress.toBase58() + "; Private key: " + privKey.toBase58());
}

if you want master private key then do something like this
        NetworkParameters params = NetworkParameters.prodNet();
        Wallet wallet= new Wallet(params);

        DeterministicKey watchingKey = wallet.getWatchingKey();

        // Get the standardised base58 encoded serialization
        System.out.println("Watching key data: " + watchingKey.serializePubB58(params));
        System.out.println("Watching key birthday: " + watchingKey.getCreationTimeSeconds());

I want private keys of all my generated addresses. Please help if you know.

@BandishMehta please accept the answer if it satisfied your question, because otherwise it remains "unanswered" on the site :)


text:
Find my block chain
How can I find all of my lost bitcoin accounts and transfer the funds? I was just recently made aware that there are multiple Bitcoin accounts in my name and a block chain. I don't know where to go from there to locate the accounts and transfer the funds so I can gain access to my cash.

How were you made aware of this? There are many scams that use such tactics to fain access to your details.

I should clarify. It's more along the lines of perception. Whether or not my perception is correct is an entirely different subject but I would like to find out before I discount the validity of said perception.

Bitcoin accounts are not linked to names, per se. There is not really a way where you can sign up for a bitcoin account under so-and-so's name, unless you go through an exchange such as coinbase.
There are basically two scenarios here:
If you are receiving messages/emails telling you to claim BTC, you are likely being scammed. Scammers send such messages out to try and get you to log into various sites, and steal credentials. Even if you genuinely do hold BTC on a site they tell you to log into, never click on the links in the email/message. Instead, open the site yourself, and log in to verify, and preferably change your password immediately (and set up 2fa if you can).
The alternate is that you genuinely did have BTC some time ago, but simply forgot where. Here, there are two options:

You were using an exchange such as Coinbase, Mt. Gox, Bitstamp, etc. or a hosted wallet such as blockchain.info (now blockchain.com). If this was the case, you will be able to find some trail in your email.
You used a regular wallet such as Armory, MultiBit, Bitcoin Core, Electrum, etc. In this case, the only possible way to recover any BTC would be to either find the wallet backup words (if it is a relatively recent wallet), or the actual wallet data file from whichever machine it may have resided on.

If neither of these two apply, you either never had BTC, or have lost it permanently.


text:
missing USDT transaction in Copay or Bitpay Wallets
I have a missing transaction, a guy sent me a bitcoins USDT, on his side we can see the money went out and the transaction is confirmed, on my side the money are not at my wallet, what I can do, here is the hash URL:
https://omniexplorer.info/tx/d39bf8c8ba9ad5311818c2eef20a161d3a8c6c2f64247e6ca479c0fcc3b68a0b
https://www.blockchain.com/btc/address/1Bg2UbR3QgPBsPgSKKBezjKiMEHeURx743
please help,
Deyan

What wallet software are you using?

Copay v3.9.2 http://prntscr.com/mg71s2 , thank you

i just installed BitPay v5.5.0 but its the same, the transaction is not there too :S

It looks like you were actually sent USDT, not Bitcoin, which are not supported by Copay. You will have to move your keys to a wallet that supports USDT.

ok but did i lose this money in this case ? , how i can move my keys to another wallet

thank you guys, I have solved the problem with importing my copay private keys to omniwallet.org as they support USDT and I get my funds available

As Raghav Sood commented

It looks like you were actually sent USDT, not Bitcoin, which are not supported by Copay. You will have to move your keys to a wallet that supports USDT.


text:
bitcoin recovery when exchange ceases business
I had bitcoins with Coinroom exchange but I see they are gone. They should be independent of the exchange that manages them I assume. How do I recover my bitcoins or get them allocated to another wallet? Thanks, Peter

If you do not have the private keys for the bitcoin addresses where the bitcoins were stored you never really controlled those bitcoins.  If the exchange is gone, sorry but your bitcoins are gone

They should be independent of the exchange that manages them I assume.

Should be
If coinroom was a regulated currency exchange then there might be some financial arrangements they would be required to make by law. There is no indication this was the case. Even if it were the case, people often set up businesses that do not obey the law, through carelessness, incompetence or deliberate criminal intent.
Cold storage
Coinroom may have claimed they kept funds in cold storage but I am not aware of any independent audit of their processes - no one can easily tell whether such claims were true.
Even if they were kept in cold storage - that does not by itself provide any guarantees about how those funds would be disposed of when the business ceases operations.
Not your keys, not your bitcoin.
When you buy BTC at an exchange, you are giving money to someone else that you trust. The exchange owns the BTC not you. What you "own" is a debt whose amount is denominated in BTC.  You have 0 BTC until you use that exchange's facilities to transfer that BTC out of the exchange and into your own standalone wallet - to an address for which only you know and/or control the private-key.

How do I recover my bitcoins

Creditors of a failed business
When you gave money to the business in Poland, you would, if prudent, have made a note of the registered company (if any), its address, registration details and it's owners and managers names etc. You could then find out the legal status of the company and if it has been placed into any insolvency process by company regulators in Poland. If so, you might be able to register as a creditor in any winding up proceedings.
Debt recovery, breach of contract etc.
You gave some money to a business in Poland. The way to recover money from a business in Poland is to engage a lawyer in Poland and see if a prosecution is possible under Polish law. This is likely to be expensive. It will take a long time (compare MtGox) there is no guarantee that this process will be successful.
Recovering stolen money
If you believe a crime was committed, you could report the crime to your local police. I wouldn't hold out too much hope of recovering your money, especially if you are not a resident of Poland.

If you send your bitcoin to an exchange and their website say they have no more, then they are lost, you should contact them.
How did you assume those are independant, do you have a cold wallet with a private key ?


text:
how to validate testnet and mainnet bitcoin address via online api or offline for Android App?
I would like to know web api provider to validate Mainnet & Testet3 Bitcoin Address.
How to validate a Bitcoin address is a real one?
Validate bitcoin address from android application
Gone through above references but Want a web service provider or local bitcoinJ type java library class.

Here are list of references to validate mainnet and testnet Bitcoin addresses:
Offline
IN JAVA
https://rosettacode.org/wiki/Bitcoin/address_validation#Java (mainnet + testnet)
https://github.com/timqi/btc_address_validator/blob/master/BTCAddrValidator.java (mainnet only)
IN GO
https://github.com/niksmac/btc-validate/blob/master/src/btc-validate.go
IN PHP
https://github.com/niksmac/btc-validate/blob/master/src/btc-validate.php
IN RUBY
https://github.com/niksmac/btc-validate/blob/master/src/btc-validate.rb
Online Api
https://blockexplorer.com/api/addr-validate/mjdkX5oxbc9ioTmbnRtc5g4Cojyr5esUuZ (mainnet + testnet)
Note: For around 30 languages we can take benefit of same by following reference:
https://rosettacode.org/wiki/Bitcoin/address_validation


text:
How to display a list of incoming bitcoin Transaction history in my own wallet?
I have gone through various references including
How to get a history of incoming and outgoing transactions for a certain address?
Fetch list of transaction where i have received the bitcoin?
I am creating a Bitcoin Wallet,
And I want to display transaction list as a part of my Wallet.
To achieve this goal I can make a local database entry of all the send transactions which are within the Wallet.
But How can I get the incoming Bitcoin Transaction Details which are perform out side my wallet?

Did this answer not help you? https://bitcoin.stackexchange.com/a/19516/60443

No It didn't exactly. From the link I believe We can have the Tx list from addresses. But imagine if 100 addresses will be there in a wallet and to fetch all the Txs of all the 100 addresses will have to query 100 times and to get details again for that much iterations. :D

But How can I get the incoming Bitcoin Transaction Details which are
  perform out side my wallet?

Unless you are using bitcoin-core wallet (e.g. listreceivedbyaddress), there isn't a way to query bitcoin-core for transactions by address. To do this, you will need to parse the blockchain and create your own database indexed by address.
An example implementation that can be used for reference is Bitpay Insight: https://github.com/bitpay/insight

Oh man! really! I am using a blockcypher apis for my wallet. Is there any other way to achieve this? Or Other way is I will display Tx list which performed only within Wallet. If it's acceptable!! Don't know.

Yes, if you want to use a 3rd party api. I'd recommend looking into this endpoint, it returns a list of tx related to an address: https://www.blockcypher.com/dev/bitcoin/#address-full-endpoint

But imagine if 100 addresses will be there in a wallet and to fetch all the Txs of all the 100 addresses will have to query 100 times and to get details again for that much iterations?

Yep. That's a good reason to parse the blockchain into your own database to reduce the latency

The way I go now is to record the address in the wallet in mongodb, and then parse the address in the block and the database for comparison. If it is the address in the wallet, record it