texts: Can I mix P2PKH and P2WPKH inputs in the same transaction?

texts:
I'm trying to increase my knowledge of bech32 and SegWit and to that end am working my way through this explanation.

Here's a hypothetical situation I'm trying to understand. Let's say Jamal has access to a a couple of UXTOs.

UXTO #1: 10 BTC (P2PKH)
UXTO #2: 10 BTC (P2WPKH)

Further, let's say Jamal wants to send 11 BTC to Tyrone. Tyrone provides a bech32 address of BC1_XXX.

So when Jamal constructs his transaction, he'd have:

Inputs:
    UXTO#1 10 BTC (P2PKH)
    UXTO#2 10 BTC (P2WPKH)

Outputs
    BC1_XXX 11 BTC
    BC1_CHANGE 9 BTC (a newly created P2WPKH address)

(assume zero transaction fees in this example)

Is it acceptable to mix P2PKH and P2WPKH inputs in the same transaction as described above? None of the examples I've viewed thus far have covered this scenario.

and next...

Regarding the article here: It indicates that there are two supported transaction formats:

(a) nVersion|txins|txouts|nLockTime
(b) nVersion|marker|flag|txins|txouts|witness|nLockTime

...and then later states that:

  If all txins in a transaction are not associated with any witness
  data, the transaction MUST be serialized in the original transaction
  format, without marker, flag, and witness. For example, if none of the
  txins are coming from segwit UTXO, it MUST be serialized in the
  original transaction format. (exception: coinbase transaction)

My questions are:

When would I encounter a situation where "all txins in a transaction are not associated with any witness data"? It says this situation would arise if "none of the txins are coming from segwit UTXO". But even in the case where the inputs came exclusively from P2PKH (not P2WPKH) UTXOs, wouldn't I still have witness data (i.e. the signatures) that need to be "segregated" at in the 'witness' portion of the transaction? Or is it saying that if all inputs are non-segwit, it means the transaction itself is non-segwit, and I should therefore use format (a) -- despite having segwit output(s)?


texts: How does blockchain.info's mixing service work?

texts:
Blockchain provides a mixing service.

How does it work?


texts: New version of Bitcoin Wallet is signed with a different key

texts: F-Droid is offering an update to Bitcoin Wallet, but when I try to update, the following message is shown. I haven't found any official news from the author about this key change. What should I do?


texts: What is the protection against a malicious node with a bad block chain?

texts: How does a bitcoin node protects against connecting to a node with a forged block chain? How does it say: "Ok, I just got this block chain and it is a valid/legit one" ?


texts:
Apologies for my limited understanding, still learning.

According to https://en.bitcoin.it/wiki/Genesis_block:

  The first 50 BTC block reward went to address
  1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa,[1] though this reward can't be
  spent due to a quirk in the way that the genesis block is expressed in
  the code.

I understand this to mean that the reward for mining the genesis block could not be spent.

To me this creates a catch-22 situation: If the first coins were not spendable, how was Satoshi be able to transfer the first 10 BTC for pizzas? Where did these first 10 BTC come from, if the first 50 BTC reward were not spendable? And how could then there be more coins, if you first need some transactions in order to fill the blocksize and mine the next block?


texts: How do I compute merkle root for genesis block?

texts:
I wanted to help out the community and create a pure C application independent of the reference client, that given a timestamp and a public key, will produce a merkle root for creation of a genesis block.

My knowledge of C++ is very little to none. After looking at the source code, this is the relevant code

    const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
    CTransaction txNew;
    txNew.vin.resize(1);
    txNew.vout.resize(1);
    txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
    txNew.vout[0].nValue = 50 * COIN;
    txNew.vout[0].scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;

Which produces this merkle hash

 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b

I am not sure whether CScript() << 486604799 << CBigNum(4) <<... is bitshifting all of this, or simply writing it out to .scriptSig.
And I am going to assume that CScript() is the constructor that initializes .scriptSig.

As I delved into the source code and following what BuildMerkleTree calls I ended up in

template<typename T>
uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int     nVersion=PROTOCOL_VERSION)
{
    CHashWriter ss(nType, nVersion);
    ss << obj;
    return ss.GetHash();
}

So I started following ChashWriter, and ended up in

template<typename T>
CHashWriter& operator<<(const T& obj) {
    // Serialize to this stream
    ::Serialize(*this, obj, nType, nVersion);
    return (*this);
}

And I got lost there. But the closest I got was double SHA256-ing this

04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73 5000000000 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG after supposedly converting to a byte array.

And I was obviously wrong about it, as the result was not correct.

Apparently, Bitcoin uses something known as Serialization to serialize the object's variables, perhaps concatenate them, but unfortunately due to my inexperience with C++ I could not understand which variables, in what order and so on. Basically, the Bitcoin source code was more complex than I had imagined.

So my question is how I may produce a merkle hash for a genesis block, without using serialization and in C?


texts: Why is there going to be only 21 million bitcoins in circulation?

texts: Bitcoin production will stop at 21 million bitcoins. Why 21 million and why was the limit put in place?


texts: Ripple: what’s the difference between “block” and “ledger”

texts:
I have heard many times that Ripple changed the concept of Blocks for Ledgers.

What would be the difference between a bitcoin block and a ripple ledger?


texts: Transaction with a high fee keeps getting skipped... Reason why?

texts:
I was sent a transaction that has been unconfirmed for 3 days now - but the feerate is relatively high (53.8 sat/vB). Blocks have been confirming transactions with lower feerates for days, but for some reason skip over mine. For example, last night there were whole blocks of transactions < 50sat/vB, but for some reason they skipped over mine (ex: https://mempool.space/block/00000000000000000006e91bfcee72653533739b834f56c550405862508883f1).
My Tx: ed45c837d26c25fb6a763708376a87f1875ff57efbb0f56d1b26d00a16c1899e
I also see other unconfirmed transactions with high fees (https://blockchair.com/bitcoin/mempool/transactions?q=fee_per_kb_usd(17..40)&s=time(asc)#) some that have been waiting for weeks.
Is there a technical reason as to why miners are skipping over transactions like these?
Thanks!


texts: Retrieve money back from wrong prefix address

texts:
Normally, p2pkh address is generate by Base58(Prefix+ PublicKeyHash + Checksum), and prefix is set 0x00.

What if by accidently, prefix is set 0x05, then the address prefix becomes 3, which becomes a p2sh address.

And unfortunately some btc already sends to the 3 prefixed address, would I am able to spent the balance provided that I own the private key?

The very bad thing here is that I created a too special type pay to script:
to be specific, <OP_HASH160> <ScriptHash> <OP_EQUAL> the ScriptHash is hash160(public key). Is there a way to sign this kind of script?


texts: I know of Avalon and Butterfly Labs, but they aren't currently shipping. Does anyone know where, if anywhere it is possible to order and receive shipment before the year's out?


texts: How to send bitcoin with a message attached

texts: Is it possible to send bitcoins with an attached message with the transaction? If yes how to do it?


texts: Decentralized transactions between two decentralized currencies

texts:
Currently, bitcoins and namecoins are implemented using the Bitcoin protocol. And there might be several reason for new block chains to appear, but this is not the subject here.

As far as I know, Bitcoin was not designed with ‘cross-currency atomic transactions’ in mind.
For example, as of today, one cannot exchange bitcoins for namecoins using the Bitcoin protocol itself.
A partner might be willing to trade, but some trust is required: who will send their coins first ?

Given that the main interest in Bitcoin comes from its decentralized nature, accepting the need of a third party to arbitrate exchanges between two such decentralized currencies is rather disappointing.

Is there anything to be done to allow ‘decentralized cross-currency transactions’ using the protocol itself (scripts maybe)? or could it be achieved with some simple modifications to the protocol?
Is this theoretically impossible under some specific conditions?


texts: Does a segwit based side chain like the lightning network allow for fractional reserve?

texts:
I'm confused.

I've watched the video The Lightning Network Explained (Litecoin/Bitcoin), and read the following comments by Craig Wright:

  This occurs because schemes such as segregated witness allow for the
  introduction of fractional reserve systems into bitcoin.
  [Sources: coingeek,
   SegWit and the Illusion of Scale]

From the video explanation of segwit/lightning it would seem that a bitcoin is required to open a payment channel and create the "IOU" that is used for the lightning transaction(s).

How can this be considered fractional reserve if there is a 1-to-1 mapping from bitcoins to payment channel balances?

It would actually seem to do the opposite and keep 3rd parties honest.

What am I missing?

Thanks.


texts: I have a serialised transaction in raw hex format that I want decoded in JavaScript. Can Bitcore do that for me?


texts: Is "inherited" replace-by-fee signaling implemented as described in BIP125?

texts:
From Bip125:

  Explicit signaling: A transaction is considered to have opted in to
  allowing replacement of itself if any of its inputs have an nSequence
  number less than (0xffffffff - 1).

  Inherited signaling: Transactions
  that don't explicitly signal replaceability are replaceable under this
  policy for as long as any one of their ancestors signals
  replaceability and remains unconfirmed.

However, it looks to me like only "explicit" signaling is tested. See this part of the BIP125 pull request that was merged into Bitcoin Core:

https://github.com/bitcoin/bitcoin/pull/6871/files#diff-7ec3c68a81efff79b6ca22ac1f1eabbaR841

It's very clear that incoming TXs are checked for conflicts (double spends) and if the conflicting TX does not explicitly signal RBF with its input sequence, then the new TX is rejected.

If implicit signaling were implemented, I would expect to see a recursive check for the conflicting TX's mempool ancestors, or check some kind of flag stored with the TX metadata.

OR, is the text of the BIP just describing what happens to descendants of replaced transactions, in that they are evicted when their explicitly-signaling ancestor is replaced.


texts: What happens if two miners mine the next block at the same time?

texts:
The process of mining as described in the answer to this question is simultaneously repeated by multiple miners.

Is it possible for two miners to find the next block at the same instant? If it is, what happens if they do?


texts: Is there really no manual for Bitcoin Core?

texts:
This is not the first time I'm desperately searching for Bitcoin Core help and finding none, but look at this: https://bitcoincore.org/en/doc/0.20.0/
That's the closest thing to a "manual" I can find. But it's about RPC commands. I've gone through their entire damn website (both ones, in fact) and made numerous web searches but find nothing resembling a manual. Where is the manual? Is there a manual?
Right now, I'm trying to get official descriptions of these two configuration options:

blocknotify
walletnotify

They are not mention anywhere on that page, and seemingly nowhere else officially. Am I supposed to guess what they mean and try to piece together information from ancient questions asked by random people online? How is anyone supposed to get a Bitcoin payment system running and actually use Bitcoin when there is no manual and a hundred BIPs are released per week?
The lack of information has caused countless of my projects to never get off the ground. I don't understand the mentality that a lot of people have that things are somehow "obvious" or "don't need a manual". Especially not when it's for a crucial piece of software which we're supposed to use to revolutionize the world.


texts: Bitcoin-cli sendtoaddress error Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee

texts:
I am following the documentation to perform transactions when I put the command:
bitcoin-cli -regtest sendtoaddress "xx address" 1.0
return:
Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.

In my bitcoin.conf I enable this option in fallbackfee = true or enabled but nothing happed
this is my mempoolinfo:
{
  "loaded": true,
  "size": 0,
  "bytes": 0,
  "usage": 0,
  "maxmempool": 300000000,
  "mempoolminfee": 0.00001000,
  "minrelaytxfee": 0.00001000
}

I have read the other posts but I still don't have the solution, help.


texts:
Does anyone know some reliable Bitcoind fork which allows to use address index?
I know that there are
 https://github.com/bitpay/bitcoin and
 https://github.com/btcdrak/bitcoin/releases

But is seems that there are not supported any more.

What I really need, it is getting unspend outputs for any address (not for the wallet only), and it need to work fast(max 1-5s).


texts: I was reading that brainwallet.org uses low-entropy RNGs, so any address generated using their website will be unsafe. I used their website to make a cold storage address last December, and so far no one's stolen anything from it. Is it worth it to make a new address on a more secure website? I've put a large amount of time into the current one; I memorized the first 2/3 of the private key and have the last third written down (most secure method in my opinion).


texts: Why is 20 the maximum public keys in a multisig transaction?

texts:
In script.h the following limit is set:

MAX_PUBKEYS_PER_MULTISIG = 20

I'm wondering:

Why is the limit set to 20?
How would one would construct a script that allows n more than the current OP_16?

E.g. would this work?

OP_m <pubKey1> ... 1 20 OP_CHECKMULTISIG


texts: Why does bitcoin not have something like nicknames?

texts: It would be much easier to exchange bitcoins if everyone could have one or more unique nicknames on the blockchain. Of course what should not be possible is that other people can check the balance by just using a nickname. Wouldn't there be any technical solution to achieve that?


texts: If a transaction takes anywhere from around 10 minutes to hours to get written to a block and put on the chain, how is it possible to have things like bitcoin vending machines? In those cases, the transaction would have to be near instantaneous to make it practical.


texts: Can you assume that all inputs to a Bitcoin transaction are controlled by the same person?

texts:
When you are looking at a Bicoin transaction in the block chain and it has inputs from multiple addresses is it safe to assume that those addresses are all controlled by the same person/organization/wallet software?

Here is an example of a transaction with 31 different input addresses

https://blockchain.info/tx/a6bffa6208c72412399997b0c504670662e259fd5ba50128d0e2823b739bd18b

If I have definitive proof that one of those addresses is associated with someone can I infer that the other 30 are as well?


texts: How would intergalactic time delay work with bitcoin blockchain syncing correctly?

texts:
The year is 2097, we just colonized mars. Sending any type of data from Earth to Mars takes about 10 minutes.

If I made a transaction on mars sending some bitcoins to someone on earth, it would take at least 10 minutes for it to propagate to all the nodes on Earth. During this time gap, I make a double spend transaction on Earth to send to mars. Because the nodes on Earth hasn't gotten my updated balance from the transaction on mars. What happens?

Does this cause a fork in the bitcoin blockchain due to this large delay? What if the time gap is 1 hour or even a few days, say sending a message to a colony on pluto? How does the bitcoin blockchain solve this problem?


texts: Merkle tree structure for 9 transactions

texts:
I've been reading the developers documentation, other sources and the good books about Bitcoin. But none of the resources shows a merkle tree with 5 or more leafs. I'm confused, does the bitcoin core make a merkle tree of transactions (a,b,c,d,e,f,g,h,i) like:

H(
  H(
    H(
      H(a,b), H(c,d)
     ),
    H(
      H(e,f), H(g,h)
     )
  ),
  H(i,i)
)

or It's wrong?

I'm asking, because the structure of this one is not close to a complete binary tree, as every example I've found in the resources. If I'm right, the structure would be something like:

               _____/\______
             / \           / \
            /   \         i   i
           /     \
          /       \
         /         \
        /           \
      /   \       /   \
    / \   / \   / \   / \
   a   b c   d e   f g   h

Thanks


texts: 6 x GPU mining rig only installs drivers for 5

texts:
I built the following rig:

5x SAPPHIRE TRI-X R9 280X 3GB GDDR5 OC (UEFI)
1x AeroCool Templarius Imperator 1150W 80 Plus Gold
1x HighPower Tech 1200w Gold Plus (HP-1200-G14C-GOLD)
1x Asrock H61 Pro BTC  Mother board
1x W.D Caviar Green 500GB SATA III HDD
1x Kingston KHX1600C9D3B1/4G
6x Powered risers 1x 16x

I Installed Windows 8.1 and plugged one GPU. It automatically installed the Radeon HD 7990 driver. Then connected the second GPU and followed the same process with the other GPUs. Everything works fine for 5 GPUs. But for the sixth one, it won't install the driver.

I try to update the driver of the sixth one but it says that the last driver is already installed.

Regards,


texts: Mining: what is the lowest possible target? Could it be a block hash of all zeros?

texts: I had a basic question about Bitcoin mining. I understand that as the bitcoin difficulty adjustment becomes harder the hash output will require more 0s in the beginning of the hash. Is it theoretically possible that the Bitcoin difficulty adjustment would be so large that the hash output would just be all 0s? I know this is theoretical bit I'm just curious.


texts:
I normally keep only small amounts in a web wallet because I heard that web wallets are not secure. The rest of my Bitcoins are kept in cold storage in my safe.

I'm just wondering if you have any experience with web wallets, if they have gotten hacked and/or if you think I should worry about it.


texts: Complete definition of 'tx_witness' data structure used in 'tx' data structure

texts:
I'm reading the Protocol Documentation page for the 'tx' data structure and cannot find a completely clear definition of the 'tx_witness' data structure.

After the 'tx_out' table, there is short comment stating that "The TxWitness structure consists of a var_int count of witness data components, followed by (for each witness data component) a var_int length of the component and the raw component data itself."

Could someone post a table, similar to others on the Protocol Documentation page, defining clearly how a 'tx_witness' data structure should be formed?


texts:
I am trying to connect to different nodes and keep track of the inventory messages that they send to me. I tried to do this with bitcoinj and libbitcoin, but I didn't make it. The goal is to connect to much nodes as possible and listen to inv messages.

Any help? I am sure there must be a straightforward solution.

Thanks!


texts: Is there a real threat of so called ">50% attack"?

texts:
According to Bitcoin Wiki attacked who has majority of computing power of the bitcoin network can successfully do some nasty things such as potentially book double-spending or prevent transactions from gaining confirmations or block other minders mining valid blocks.

Today the vast majority of computational power is controlled by mining pools. According to blockchain.info GHash.IO is 30%, BTC Guild is 23% and Eligius is 12% (as of today 15/12/13).

Is there a threat for the network if pools would pair up to get more than 50%? Alternatively two major pools could get compromised simultaneously in order to get more than 50%. I was wondering how real is such scenario?

References mentioned:

https://en.bitcoin.it/wiki/Weaknesses#Attacker_has_a_lot_of_computing_power
https://blockchain.info/pools?timespan=4days


texts:
(Copied from reddit)

Hey. I recently made a bitcoin transaction for the first time in a while. The transaction fees have gone through the roof (!!) since the last time I used it, and I figured it would be no issue to use the default fee on my electrum wallet (104 sat/byte).

I now realize this was a big mistake. My transaction is stuck in mempool and I don't know what to do about it.

What should I do? How long do transactions stay in mempool before they are not considered "sent" anymore and I can spend the bitcoins in another transaction? Is there a way to retroactively attach a higher transaction fee to my transaction?

I'd really appreciate any help with this. Having your money stuck in digital limbo sucks.


texts: Find sender's public key in SegWit Transaction

texts:
How can I retrieve the sender's public key in a Segwit transaction?

For example: https://www.blockchain.com/btc/tx/3179d18d6f36fa77b88909496535485d8188d96b79d295843789a9e0ff6c3e6a

I can happily parse the witness part as in

02 : 2 items to follow

47 : 0x47 = 71 bytes (signature)

304402201cf8db0c4afc164970ec4397327fe9b1dd9b7ff4a9093f94e554d624b5ffdcb702202848072c17f2bcce16b8d3d7cb2efdad87bc6c942b79f44b79f1c52f817d81ea01 : the actual signature (last byte is the sighash code)

21 : 0x21 = 33 bytes (the pubkey)

02384052a5ecde83bf8ee7ed77f378edb58aa65de22c4e91af87eee68015b9d509 : the actual pubkey

But this pubkey is not the public key of the sender. It's probably the pubkey of a segwit (or something like that)...

How exactly is this signature made up and what pubkey is that? And more importantly, how can I retrieve the sender's public key (the one belonging to 35yfMa3CRBiWny8DFdb4tUu9fn7fcdvVp9 in this example).


texts: How to get input and output address in a transaction with blocksci?

texts:
I have downloaded bitcoin core and have parsed it with blocksci. I want to get the data about the inputs and outputs of each transaction like this:
import blocksci
chain = blocksci.Blockchain('./btc.cfg')
for block in chain:
    for tx in block:
        result = tx.inputs.address.with_type(blocksci.NonstandardAddressIterator)

address is a property under class blocksci.InputRange, with type blocksci.AddressRange.
I do not understand the below part in document so I can't figure out what should be filled as argument in with_type to make it return the inputs as a list to result.
class blocksci.AddressRange
    Bases: blocksci.AddressSequence, blocksci.GenericAddressRange

with_type(arg0: blocksci::AddressType::Enum) → Union[blocksci.NonstandardAddressIterator, blocksci.PubkeyAddressIterator, blocksci.PubkeyHashAddressIterator, blocksci.MultisigPubkeyIterator, blocksci.ScriptHashAddressIterator, blocksci.MultisigAddressIterator, blocksci.OpReturnIterator, blocksci.WitnessPubkeyHashAddressIterator, blocksci.WitnessScriptHashAddressIterator, blocksci.WitnessUnknownAddressIterator]

I really appreciate any answering and helping :)


texts: Bitcoin-ruby returns "nil" value for bitcoin-cli calls

texts:
I am new to test "bitcoin-ruby" to parse bitcoin blockchain data. But while testing it, I am having issues to make some bitcoin-cli commands to get this to work. The environment I'm using is :

*Linux version- Ubuntu 16.04 LTS
*Bitcoin Core version- 0.14.2
*Rbenv version- 2.4.3
*Gem version -2.6.14
*Ruby version-
*Bitcoin-ruby version
*ruby -2.4.3p205 (2017-12-14 revision 61247)
*bitcoin-ruby version- 0.0.15

Here are the codes I am using to parse the data :

require 'bitcoin'
require 'net/http'
require 'json'
RPCUSER = "***"
RPCPASSWORD ="***"

HOST = "localhost"
PORT= 8332

def bitcoinRPC(method,param)
http = Net::HTTP.new(HOST,PORT)
request = Net::HTTP::Post.new('/')
request.basic_auth(RPCUSER,RPCPASSWORD)
request.content_type = 'application/json'
request.body = {method: method, param: param, id: 'jsonrpc'}.to_json
JSON.parse(http.request(request).body)["result"]
end

The following bitcoin-cli commands are working via bitcoinRPC :

bitcoinRPC("help",[])

bitcoinRPC("getnewaddress",[])

bitcoinRPC("getchaintips",[])

But following returns "nil" vale :

bid = "0000000000000000004bd4aff1966f6df18b1dba6f6ef83a878e526ab31eee73"
bitcoinRPC("getblock",[bid])-> "nil"

Any idea how to fix this issue?

Thanks in advance.


texts: Detect types of ScriptSig and parse each part

texts:
As explained in

https://en.bitcoin.it/wiki/Script

there are many types of scriptPubKey and scriptSig like:

<sig> <pubKey>
<sig> <pubKey> <pubKey>
<sig> <pubKey> <pubHashA>
<sig> <pubKey> <pubHashA> <pubKeyHash>
...

how can we detect type of ScriptSig and separate each part?
In other words is there a length variable or something like that to parse each part separately?


texts:
Newbie in this area. Trying to understand how lightning network would work in real world.
If I want to buy a coffee on BTC network, I go and pay and unfortunately me and the cashier need to wait 5-10 min before the transaction is "confirmed" on chain. This the cashier wouldn't know for sure if my money is good for that amount of time.
With lightning network, my understanding is that we would be making a transaction on a "side chain" (so the money would be transferred "instantly").
My question is that instantly - Does the lightning network also solve the problem of giving confidence to the cashier that I have the money required? I.e. does the cashier have to wait for the side chain to get "settled" onto the main chain and thus wait 5-10 minutes for a confirmation?


texts: How to establish connection for mining testnet blocks?

texts:
I am new here. I really want to know how scryptcoins work so i wanted to create and altcoin to learn on something.

I learned c++ years ago so i know i have some basic knowledge but sometimes i get stuck, and i need help.

Now i have a problem. I created my coin. I wanted to start on testnet on local network beetwen 2 pcs.

Server PC:

./xxxd -testnet -listen=1 -server=1 -connect=

Client PC

./xxxd -testnet -connect=

Than tried getinfo:

Conenctions: 0

The two pc can ping each other.

I tried other ways like:

Server PC:

./xxxd -testnet -connect=

Client PC

./xxxd -testnet -connect=

Server PC:

./xxxd -testnet -listen=1 -server=1 -connect=:

Client PC

./xxxd -testnet -connect=:

In getinfo they didn't have any connections. I searched forums, topic and found nothing.

If you can help me, please write down your oppinion.


texts:
We know that the bitcoin distributed ledgers is stored in a serialized blockchain based on the transactions' chronicle order.

The current size of this database is about 100 GB. How can they search easily within this database? For example, if I got a paper-wallet previously loaded with some bits from Xapo, and I try to sweep its bitcoin value into a copay wallet (different from Xapo), it takes about 75 second to search & get its balance!

So, how can they search in this large serialized database within this short-time? I am asking about the technology behind that!


texts: Why is the scriptPubKey required when using signrawtransaction?

texts:
The signrawtransaction rpc method calls for the following use:

signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )

Why is scriptPubKey included in here? It seems from the code that it just looks it up anyway and compared to the value given:

if (coins.IsAvailable(nOut) && coins.vout[nOut].scriptPubKey != scriptPubKey) {
    string err("Previous output scriptPubKey mismatch:\n");
    err = err + coins.vout[nOut].scriptPubKey.ToString() + "\nvs:\n"+
    scriptPubKey.ToString();
    throw JSONRPCError(RPC_DESERIALIZATION_ERROR, err);
}

My best guesses:

Maybe there are some cases where it won't be able to look up the scriptPubKey?
Maybe so this will work offline?
Maybe it's not actually needed, but kept for backwards compatibility?


texts: I want to buy some xrp and hold them offline

texts: I want to buy some ripples (xrp) and hold them offline ( I want to keep the secret key with myself rather than trusting some hosted websites). Are there any steps to do this? Is ripple trade account mandatory to hold xrp? Can I simply buy xrp in cryptsy.com using btc and transfer them to an address managed offline in my computer?


texts: Why would someone use a BTC faucet if it pays 200 satoshi every 15 minutes?

texts: I've seen many people talking about faucets but why would a sane person do it to get less than 1 cent every 15 minutes???


texts: How can I get the confirmations of a transaction using bitcoind?

texts:
I installed bitcoind on my linux server. So far, it has downloaded blocks 0-386561 according to bitcoin-cli getinfo.

I went to a random block within that range, and picked up this transaction:

TXID: a3d7b336b5e1024de75c21612bc8af7f4b30e05ccb863a438463fda4034d34db

I want to check how many confirmations this transaction has using my bitcoind through a CLI command.

So I typed bitcoin-cli gettransaction a3d7b336b5e1024de75c21612bc8af7f4b30e05ccb863a438463fda4034d34db.

It gave me this:

Can someone please explain what is wrong??


texts: How to calculate the Average velocity and the Average acceleration of Bitcoin transactions

texts:
I am working on a Bitcoin project and I would like to extract the following features

1- Average velocity: represents the speed with which bitcoins flow to a user

2- Average acceleration: represents the acceleration of bitcoin flow to a user

I have the following attributes:

user ID ( represents the user)
the total number of transaction (e.g 100 transactions)
the total value of Bitcoin transferred (e.g 10000 BTC)
the date of each transaction (represents the date of each
transaction)

Can you please help me how to calculate the velocity and acceleration?

Thank you for any help you can provide

Regards,

Khaled


texts: python-bitcoinrpc: only DEBUG available?

texts:
I'm starting with python-bitcoinrpc from J.Garzik.

I'm using to try it the code provided by James D'Angelo (from Bitcoin 101 on youtube):

Apparently, there were some major changes with python-bitcoinrpc, not taken into account by old tutorial as the ones from James since you don't do now:

from bitcoinrpc.util import *
from bitcoinrpc.exceptions import *
from bitcoinrpc.__init__ import *
from bitcoinrpc.config import *
from bitcoinrpc.proxy import *
from bitcoinrpc.data import *
from bitcoinrpc.connection import *

bitcoin = connect_to_local()
NEW_ADDRESS = bitcoin.getnewaddress()
print(NEW_ADDRESS)

But now:

from bitcoinrpc.authproxy import AuthServiceProxy

access = AuthServiceProxy()
info = access.getinfo() # Not WORKING: info is None

That's okay for me, and very shorter.

The problem is to get access.getinfo()to a variable? According to the README from python-bitcoinrpc, you can use the logging module to print stderr to the screen

logging.basicConfig()
logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG)

rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))
print(rpc_connection.getinfo())

But how do you put that into a variable??
Like with:

info = access.getinfo()
(which is not working: infois None


texts: Bitcoin Core ZMQ messaging system has hashtx along with 4 other topics. But nowhere it is documented whether the transactions that comes from hashtx are confirmed transactions which are added in a block or unconfirmed transactions that is yet to mined.


texts: How can I access my private keys? Will the key get lock further if I enter the incorrect password too many times?

texts: I exported my private keys and Multibit unencrypted but when I try to import the key files I am being asked for a password... copying the the key from text edit and pasting it into blockchain results in an "unreadable key" type of message.  Trying to import to Multibit results in asking for a password. Have I lost access to these bitcoins?


texts: What happens when an attacker completely controlls your Internet connection?

texts:
Bitcoin assumes that everybody sees the same ledger. However, what if your ISP is evil, and modifies your view of the Bitcoin network? Is it possible for such an evil ISP to make your own transactions not go to the real Bitcoin network, while returning results that make you believe that everything is fine? Your local blockchain could end up extremely badly out of sync with the global blockchain.

Is this scenario possible? If so, what happens when you finally sync back with the real blockchain? As far as I understand, Bitcoin always chooses the longest blockchain, but couldn't your evil ISP simulate a really busy Bitcoin network to you so that your fake blockchain is even longer?

Does this mean that applications like Satoshi Proof and Namecoin aren't really secure if networks can be maliciously partitioned? In Namecoin, for example, wouldn't it be possible for a bad ISP to simulate a blockchain that contains wrong domain information?


texts: Where can I get a list of command options for bitcoind and primcoind?

texts: I just installed bitcoind and primecoind on my ubuntu server. I was wondering where can i get all the command options for these daemons. The --help list does not display everything on primecoind as i dont even see the option "listaccounts" there. How else can i get a list of these options?


texts: Placing price bounds on MtGox market depth api request

texts:
I'm making an order book for MtGox, but the market depth file is huge and I'm really only interested in values near the inside prices.

Is it possible to place price bounds on the mtgox market depth request http://data.mtgox.com/api/1/BTCUSD/depth/fetch and if so how?


texts: Passing incomplete information to an SPV node

texts:
I am wondering how SPV handles the following scenario:

A transaction has been confirmed by some block X, and funds address y.
At some later block, the transaction's output are spent again
SPV node queries the balances of y, the full node peer returns the answer along with the merkle proof for block X.
But.. the answer doesn't give you the most up to date response, because y funds were depleted in a more recent block...

I know some ideas like UTXO commitments were around but I am not sure that they were ever merged into bitcoin.

So, was this problem ever solved? Or maybe no one tended to it because it was concluded to not be so bad?


texts:
So I have been reading up on bitcoin and blockchain for awhile now, but I have yet to fully understand it. I understand that bitcoin leverage on DLT, which uses cryptography to verify transaction. This is what I have understood so far:

When I make a transaction, this transaction is added to a pool of unconfirmed transactions
This pool of unconfirmed transactions forms a block and miners will solve a mathematical problem as verification
The first miner to solve it will have the block verified and added on to the chain

However, how do they know if my transaction is valid? What if I have 1 BTC but decide to send 2 BTC, how does the solving of mathematical problem verify that I do not have 2 BTC? What if I just purchased 5 BTC from Coinbase using fiat, how will anyone know that I have 5 BTC?

I believe this should not be a very difficult question but I cant seem to understand it fully. Hope someone can point be to the right direction and enlighten me thanks!


texts: How do I pay for something anonymously from the UK using bitcoins?

texts:
I've seen the following guide but it's no good as I can't use bitinstant from the UK. Can someone recommend an alternative?

Step 1.
Download and install TOR

Step 2.
While using TOR create a Tormail account
You can confirm the address at http://tormail.org/

Step 3.
While using TOR, visit http://www.bitinstant.com

Step 4.
Choose the Cash deposit to Bitcoin to email option.

Step 5.
Follow the instructions on Bitinstant to make your cash deposit, and have your Bitcoins sent to your new Tormail account.
No ID is needed.

Step 6.
Receive your Bitcoins via email.


texts: bitcoin core command line walletpassphrase incorrect but works for the main system?

texts: My command line won't accept my passphrase, but on the main system it says it's correct and I can change it. I want to dump private key but no matter what I try, it continues to say incorrect passphrase. What can I do?


texts: I read a lot about how bitcoin clients find each other. I would like to do a fork from bitcoin and I have a question. How my network will differ from bitcoin? How the client will understand if this is bitcoin's client or mine?


texts: AFAIK, the generation of the address pairs occurs on your computer but the concept still makes me nervous as it's occurring in the browser and I have to trust the owner of the site, I think.


texts: retrieving an original data from a hash: is it reliable?

texts:
Normally, one of the purposes of hashing a string (such as a transaction) is summarizing the data to save the size because of the space limitation.

If this proposition is true, now assume we need to read the original data and so we need to extract the exact original data (with all details).

Now the question is if the extracted data from the hash data is exotically equal to the original data?

And if yes, is there any tool to do this? (for example, for retrivieng the original data from SHA256 hashing algorithm).

And if we cannot retrieve the original data from a hashed value, how hashed data can help us for validating an original data?


texts:
I am not sure how to set to do market buy and sell
Please help


texts:
Can a multisig address creation process use other multisig addresses as signers to result in a new multisig address

Would this also result in a greater number of signers to be necessary to approve a result/transaction?


texts:
In testnet, txid:fb7a8658ec015133e36e2cf7ddf7e8c887c3a5becec2f30f24ebfe43e72f4b59
transaction has two inputs.
This two inputs indicate the same txid and vout,
6a08723bc717e1ddf91fa60fde25784ef66952e8687f3bffe391fc2c819dbfd9:1.

Is this a double spending?


texts: Bitcoin core txindex option - does it take argument or not?

texts:
-txindex is documented (in multiple places) to take no (numeric) argument and that "default: 0".

Does this mean that you have to say -txindex=1 to set txindex, or does the mere appearance of -txindex on the command line set it to 1?

(IOW, is the value of the naked -txindex option 0 or 1?)


texts: Why does the mainline client limit the number of outbound connections to 8?

texts:
The mainline Bitcoin client limits number of outbound connections to 8 however allows up to 125 total connections.  To achieve greater than 8 connections (due to outbound limitation) requires either using uPnp or port forwarding so that the client can accept inbound connections.

Why is there a limit of 8 connection and only on outbound connections?  Why not allow the client to create 20 or 125 outbound connections?


texts: How does ShapeShift operate on 0-1 confirmations

texts:
ShapeShift can exchange user's crypto currency almost instantly. They state that most transactions don't require any confirmations:

  Small deposits are processed with zero confirmations. Larger deposits wait for at least 1 confirmation.

How can they do this and cover themselves from double-spending?


texts:
I did go thru a lot of articles which say's It's highly impossible to break the bitcoin public-key and get a private key from it.
I understand that the public key does hold some info of it's corresponding private key.
Can anyone suggest me some steps for manual calculation and reversing the scalar multiplication from the public key so I obtain the private key?
I'm not looking for any scripts for doing this but I'm looking for mathematical steps in-order to reverse the public key to private key.


texts: How could the bitcoin protocol be changed? Has this ever occurred?

texts:
I keep coming across answers in questions on this site and on the wiki saying that the protocol might need to be changed in the future to create more scalability / security.

It seems to me that it is difficult to update the protocol now that there are so many different people involved and so much invested in the current protocol.

How could the bitcoin protocol be updated?  Has this ever occurred to date?


texts: Is there a fairly simple way to include a standard-looking but not too elaborate "Bitcoin accepted here" logo in a LaTeX document?


texts: How to create watch-only wallet on a server with a full node?

texts:
Given: there're online shops and a server with a full BTC node that I plan to run. I'll be using a full node to monitor incomming transcations thus receiving payments in an automatic manner. Only. Namely, a customer will see a result of his payment in, at most, 10 minutes.
Question: How can I create a wallet that's receive-/watch- only, that'll have to stored on a server?
That is, if a server gets broken into, a hacker won't be able to do anything with a wallet he steals, later on. But I will be because a private key will be stored on my local computer. I'll login into a server once a week and withdraw the funds from a wallet.
--
I don't consider any other - paid, free, open source - ready solutions. The question isn't about a solution to receive BTC payments.


texts: I have a 12 word mnemonic but I'm unsure of the order, I know that the BIP39 mnemonics use a checksum, are there any tools I can use to re-order the 12 words correctly so that they pass the checksum?


texts: Can there be Bitcoin-like network that also works as whatever@home?

texts:
There are Bitcoin-like network that performs calculations that are not locally useful, but interesting for peers.

There are {SETI,folding,...}@home networks that calculates something that is (probabilistically) useful locally, but not such interesting for peers.

Can there be a network that:

Allows starting useful distributed calculations and
Have notions of proof of works, signatures, checking and other building blocks that can be used to run BitCoin-like currency?

Ideally, if somebody finds an efficient way to solve some useful task (compare: start using GPU while everybody else using only CPU), he not just start having larger share in a zero-sum game, but also automatically help that calculational task.


texts:
I am building a script to generate secp256k1 using OpenSSL in MacOS.
Seems to work fine.
My question: is this SECURE enough?

#!/bin/bash

if [ $# -eq 0 ]; then
  echo "Missing name, for example generate_key.sh bob"
  exit 1
fi

FILE_NAME=$1
PRIVATE_KEY=${FILE_NAME}_private.pem
PUBLIC_KEY=${FILE_NAME}_public.pem
BITCOIN_PRIVATE_KEY=bitcoin_${FILE_NAME}_private.key
BITCOIN_PUBLIC_KEY=bitcoin_${FILE_NAME}_public.key

echo "Generating private key"
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out $PRIVATE_KEY

echo "Generating public key"
openssl ec -in $PRIVATE_KEY -pubout -out $PUBLIC_KEY

echo "Generating BitCoin private key"
openssl ec -in $PRIVATE_KEY -outform DER|tail -c +8|head -c 32|xxd -p -c 32 > $BITCOIN_PRIVATE_KEY

echo "Generating BitCoin public key"
openssl ec -in $PRIVATE_KEY -pubout -outform DER|tail -c 65|xxd -p -c 65 > $BITCOIN_PUBLIC_KEY

echo "Files created!"


texts: What happens if R is not revealed by one of Lightning Network nodes? (Payment cancelation)

texts:
Let's say we have route of 3 hops A -> B -> C -> D (A pays D). And in the middle of payment (revealing secret R stage) node C disappear from network. In this case B will be not able to finalise payment because he don't know secret of hashlock.

I know that there is timelock, so most probably node B will need to start closing channel procedure (channel B -> C).

But what is happening with payment? Is it accepted/rejected/hanging? What is happening with A->B and C->D channels? Will they be hanging until situation with B->C is resolved? Or there is some kind of payment cancelation protocol?


texts: How to convert High-S value to low-S value without signing the transaction again?

texts:
I created a bitcoin transaction but I'm getting an error when trying to broadcast it:
mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high) (code 16)
I googled it and seems the problem is that S value in ScriptSig is High. I didn't find a working method to convert my High-S value to Low-s value. Could someone help me with that? Any help would be appreciated and well rewarded Cheesy. Maybe there is some python script that can convert High-S value to Low without signing this transaction again?


texts: How to make a Hidden Tor Bitcoin Mixing Service?

texts:
Bitcoiners. I have been trying to seek out a legit Bitcoin Mixing service, and I just don't feel secure by putting my coins in their hands. I have scoured the internet trying to find a tutorial on how to make a .onion Mixing Service. I want to be able to help others and me become safer with transactions, and I am running out of luck. If you know how to make a Mixing Service, please let me know how, or give me a link. Also, I would like to be able to have a small transaction fee [E.G. Base Fee of: 0.75%; For every transaction/day an additional 0.002 BTC is taken]. I am really feeling annoyed that I can't find an answer ANYWHERE, so please reply to me ASAP with an answer on how to host a service.

P.S. I am using a Windows XP [Dell Desktop] and Windows Vista [Toshiba Satellite] to host it on. If you have something I ABSOLUTELY NEED to download for the service, you can send it to adaptornode@tormail.org


texts: My transaction in Multibit HD has seen by 124 peers but yet after 11 hours, not confirmed?

texts:
my transaction size is 1850 (bytes) with fee of 0.00051 BTC and it is seen by 124 peers in multibit HD .
but now after 11 hours, it is not confirmed!
in blockchain.info it said "Estimated Confirmation Time: Very Soon (High Priority)"
why it is not confirmed?
here's the hash:
4fba9205ed407f941a35ebb4f8e56ee565625d3a55da903bfae4c95dbe1548b1
thanks


texts: Was there ever reasoning presented for the size of a satoshi (i.e., the minimum amount of bitcoin that can be transacted)?

texts: If not, what are the prevailing critiques and concerns of that design choice?


texts: Historical prices via API for major alts (not BTC)

texts:
I am trying to build a small project of mine using historical prices for major alternative currencies such as LTC, DGC, MOON, TIPS, etc and so far I managed to collect only current prices of cryptsy API.

Which APIs provide historical data?


texts: How can we find the hashrate distribution of different pools?

texts:
we can see that different websites propose some graphs in which the hash rate distribution is depicted, like the attached Figure.

1) I want to know that how do these websites approximate this distribution? Are these websites understand the generator of the block by reading the Coinbase Transaction?

2) If AntPool generates a block, does AntPool inform others that it was me who did that?!!


texts:
I lack something in my understanding of how the mining process works.

If a miner has to loop over a block and re-calculate it's SHA256 for only 2^32 (the amount of different nonce values possible) until it finds a SHA256 with a value lower than the target value , isn't that too fast (only 2^32 possiblities per block ?) ? I know I'm missing something here ...
So what am I missing ?

Thank you.


texts:
I'm using Bitcoin Core 0.18.0-rc2 (64-bit) on Qt 5.9.7.

How can I make it respect -prune=550?

This is the minimum prune number, and should be approximately 550 MB.

Yet, my client is downloading tens of gigabytes worth of data, with no end in sight.

In "Options" it is stated:

"Options set in this dialog are overridden by the command line or in the configuration file: -prune=550"

Hence, it seems like the program is able to recognize the command line argument. It simply doesn't respect it as far as downloading and pruning the blockchain goes.

What can I do differently to fix this problem?


texts: Where can I see the average transaction fee payed in the last 100 blocks?

texts:
Is there a site that shows what's the average transaction fee payed in the last X blocks? Or just raw data about this?

I checked BlockExplorer and Sytes and they don't seem to show this information.


texts: How long can my lightning node be safely offline?

texts: I am interested in setting up a full bitcoin and lightning node on my pi.  I want to open a few channels and be well connected in the network.  I intend to keep this machine on permanently, but may have to unplug it if I need to move it to a different socket or maintain it.  How long can my node safely be off the bitcoin network without risking loss of funds in my channels?


texts: How can a third party spend BCH accidentally sent to a BTC address?

texts: I transferred BCH to an Electrum wallet address and haven't ever received it because Electrum uses only BTC. As I have been trying to recover it, I looked up the transaction on explorer.bitcoin.com and it was input but has also been output 5 times and the  balance shows 0. So it would appear that someone has access. How is that possible? Shouldn't it be secure? Do I have any sort of recourse?


texts: Bought a bitcoin, sender said it was sent, not showing in blockchain or wallet. Where is it?

texts:
So I bought a full btc off of localbitcoin with amazon giftcard code.
I sent the code and clicked that payment was completed.
It's been about 2 hours. About 1 hour since he said that he sent the btc. I'm wondering if I got ripped off?
I'm not showing any transaction in the block chain and it's definitely not in my wallet.
Please help? What's going on?


texts: Time/memory complexity of Bitcoin API calls

texts:
Is there a way to see the time/memory complexity of Bitcoin's API? For example, bitcoin-cli getblock "some-header-hash" fetches the block with a matching hash.

How is this implemented under the hood? Does it do a linear scan of the entire blockchain all the time or does it keep a (key, value) table where keys are header hashes? I'm concerned with the implementation as given in http://chainquery.com/bitcoin-api.


texts: How to send my 2X coins to an exchange from a private BTC wallet I had during the fork?

texts:
So, I have a private Bitcoin wallet for which I own the private key, it is not in an exchange.

Despite the segwit2x fork was canceled, some people are still trading it and the segwit2x fork seems to still be user-activated. So it exists somewhere, isn't it?

I'd like to keep the BTC intact in my wallet and to send the 2x coins from the fork to an exchange.

Which wallet or software could I use to send the 2x coins? I googled and nothing comes up except a website that suggests using eth wallets, which is a non-sense and seems scammy.

Also, I would think of sending the 2x coins to another private wallet and then the BTC coins to another new wallet (so as to prevent replay attacks), and only then move my 2x coins to an exchange.


texts: What's the formula giving the % of succesfully maliciously messing the blockchain?

texts:
With the recent (early 2014) GHash.io concerns about that particular mining pool getting too big, many people have talk about what a powerful miner could do if it wanted to "harm" bitcoin or double-spend, etc.

At one point someone pointed on that if you have 40% of the mining power, you have a 50% chance of reverting 6 blocks.

I'd have expected it to be (0.4 exp 7) (6 blocks + the next one) or something like that and not 50%.

What is the formula to use to compute the "harm" that a malicious miner could do and how many blocks he could revert?

EDIT

Here's a page containing the formula:

https://people.xiph.org/~greg/attack_success.html

Don't put too many blocks otherwise the code will have a numeric overflow.

But normally it's using the formula in the bitcoin paper and that page has been written by the person who came up with the concept of deterministic wallets (if I'm not mistaken). So I tend to think he knows what he's talking about.


texts:
I know that non-SegWit node could verify a block without witness.

For SegWit node, is witness necessary to verify a block? Because I know witness are committed as wtxid merkle node in coinbase. What's the purpose of the wtxid merkle node?

If witenss is necessary for SegWit node, then can I say witness is an part of blockchain in SegWit node's view?


texts: Can a bitcoin bank solve the problem of intensive value fluctuation caused by hoarding?

texts:
Let's assume a bank dealing in bitcoins is not any central of government bank that could control the money supply.

Instead, let's say there was a bank where the people would deposit money at some interest rate, and also the bank would give loans to the people at some interest rate.

The intention of the bank would be to keep the bitcoins in the circulation (by taking and giving benefits to the people with some interest rate) instead of hoarding, as we know hoarding may hurt the Bitcoin economy.

Or, suppose I deposit some BTC in HSBC bank (or some kind of reliable online bank), and HSBC will give the interest every month.


texts: How do I join a NXT mining forging pool? And how do I register for payouts from the pool?

texts:
I found the following pool: http://pool.nxtcrypto.org/howto.html

But I'm a bit unclear on these instructions:

  To claim your earnings, simply send an AM (can be empty or put
  whatever you want in there) to the pool account 1460178482 and after
  this AM has 1440 comfirmations, your confirmed earnings will be sent
  to you, minus NXT transfer fee.

What do they mean by "simply send an AM"? What is AM?

On the lease nxt page, it says I can attach a message. Do I just attach it during the lease transaction? Or do I have to send a separate empty message to the pool account after sending the leased funds?


texts:
I'd like to get some information(BTC's difficulty, hash rate).
I think I can get that from api of BTC.com, and I checked github of btccom, but I can't mount api with python.

How Can I use btccom api(v3)?
maybe for the first time, I need to install something on terminal(mac).
It's like a [pip insall ***].

Than you


texts: Lightning Node (MyNode) gone missing. How to recover funds?

texts:
I had a RaspPi/MyNode with a few LND channels open. The node has unfortunately gone missing/stolen and I'm trying to figure out the best way to get the funds back.

I have access to my seed words for the LND wallet.
I have access to a channel backup file.
I don't have great internet currently, so doing a full node
rebuild/restore will take days if not weeks to sync (unless someone
has a better idea to shortcut this).

What would the best way to move the funds that were on those channels -- probably to an on-chain wallet? I'm guessing this would be a forced-close? Hopefully I can avoid any detrimental impact to those channel peers, not that the node was all that well connected/funded to do any significant routing, but still, trying to be as ethical as possible given the situation! :)


texts: Electrum via command-line: can generic blockchain info be requested?

texts: For example can I ask the Electrum client via it's API what the height or version of the latest block is? Looking through the docs all I currently see is wallet commands.


texts: In an event when nobody mines the next block in the blockchain, how are the transactions supposed to get published into the blockchain?

texts: I understand that miners are never gonna stop mining given the transaction fee reward for each block. But just in case of an event when nobody is able/willing to mine the next block in the blockchain, what happens to the new transactions, how are they supposed to get published? And also, how is it going to effect the blockchain consensus?


texts: How to work out the balance for an HD Wallet extended private key?

texts:
I am working in C# with NBitcoin.  I have created an extended master private key, and I can create the hierarchy of derived keys.  In TestNet, I have requested some coin from a faucet, and the transaction has gone to the test address (checked in testnet.blockexplorer.com).

I have a local testnet chain running (and a mainnet chain, but testnet for now is all that matters) and I am trying to interact with it via the bitcoind RPC, as per the Bitcoin developer examples.

How do I work out the balance (value held) on my private key, that pairs to the public key, that generated the receiving address?  Am I right in thinking that the RPC bitcoind client will not show this, as it maintains it's own keys?  If so, how can I query the blockchain for transactions on this address?  There is an RPC to import an address, but that seems like a kludge.  I should be able to do what the bitcoin core does for it's own local addresses, but for my locally generated addresses.

Thanks in advance for any guidance.


texts:
First of all, this refers to

How to calculate transaction size before sending
What is the exact formula for calculating transaction fees?

I want to estimate the TX-Fee I would have to pay in a simple scenario where my wallet contains only 1 address Z that has received X payments.

I then want to pay all the wallets balance to Y different addresses at once.

Because I want to spent all of its balance, it would be great to know the transaction-fee, so that I can reduce Y, or pay the fee to Z in advance.

Since I prefer a worst-case-calculation, is it legit to count every incoming payment to my address as Input?

Is the following calculation correct?

normal_fee := 0.0005                            // Taken from Bitcoin-QT
size := X * 148 + Y * 34 + 10 +- X
fee := normal_fee / (1 - size / 500kB)


texts: How do bandwidth requirements for running a full node grow with blocksize?

texts:
I know they increase.

I'm looking for something more precise than that.


texts: Transfer Bitcoins From Bitcoin Core To Blockchain Wallet?

texts:
I used to have Bitcoin core on another computer and kept it on C drive with 2TB hard drive. I kept the dat on a USB.

However it broke and on my new computer the C drive is a fast but small drive that doesn't have the space to download the blocks now. So after a google search i found some info to use my D drive for the downloads which i have done.

The problem is every time i load the software it seems to need to verify the blocks as if there is some error and constantly stays on 3 years and 7 weeks behind and never seems to get further. My internet speed is ok but not ultra fast also so the software wallet just seems like a nightmare to use now as the balance remains at 0 and i can't seem to do any transfers until all the blocks have updated i guess. Why the wallet can't do a quick blockchain based balance update to save people from this serious problem i have no idea.

I have about $50 in bitcoin in the Bitcoin Core wallet though and would like to transfer it to the online Blockchain wallet, is this possible?


texts: Is the keypool erased when changing wallet password?

texts:
In Bitcoin-qt, when a previously unencrypted wallet is encrypted, the keypool is erased and replaced with new keys.

Does this also happen when the password of an already encrypted wallet is changed?


texts: Does Bitcoin transaction has information on remaining bitcoins with the sender?

texts:
I am new to Bitcoin and have gone through a couple of video introductions and articles. I have few questions on Bitcoin transactions:

1) I read that the sender needs to encode the numbers of remaining Bitcoins with him in the transaction. This is to say if Alice has 50 Bitcoins and she wants to transfer 40 to Bob, her transaction data would have two destinations: 40 BTC to Bob's address and 10 BTC to Alice. But I looked at the below link with transaction data:

https://blockchain.info/block/0000000000000000003434300a3196f759c78ccba63a3e79eb2a3476d6bd6731

This does not have any case where the sender is same a recipient. Is it that this info is excluded for web reporting or am I missing something.

2) How are the number of transactions in a block decided? I know that block size has a limit but how is it determined which transactions would a block pick from pool of unconfirmed transactions?

Regards,
Gaurav


texts: Bitcoind, Multisig, and the default account ""

texts:
I've been attempting to do transactions to and from a multisig address for a couple of days, but I'm finding that my default account "" keeps paying for things, even though I'm explicitly saying other accounts should pay for things via the txid field in createrawtransaction.

For a quick example, if I create a transaction like:

bitcoind createrawtransaction [{\"txid\":\"504aa16418fbb871d307249448bcecdaa5699872a4d22b84d170ae64a2fe89ca\",\"vout\":0}], {\"2NASaVRks1dFupX1e6y3SK8BomjhvSv7xGh\":50}

(It's formatted this way because I'm running this in a windows command prompt at the moment, hope to be able to run linux soon!)

the account associated to the address in the transaction's vout where n=0 is "test", but after I sign and send this raw transaction and check listaccounts, "" is debited 50 instead of "test".

If it helps at all, 2NASaVRks1dFupX1e6y3SK8BomjhvSv7xGh is a 2 of 3 address of which "test" is a part of.

Am I doing something wrong, or is this just how bitcoind handles situations where all of the addresses in a (multisig) transaction are associated with accounts in my wallet? And if so, why??

It's also all being done in regtest mode, but I wouldn't expect bitcoind to handle transactions differently in that mode.


texts: Bitcore explorer insight testnet initialisation

texts:
I am using bitcore explorer and I want to initialize insight api in testnet.
It has the following code.
I try var insight = new Insight('testnet') but it is not working.
What value for url should i input so that  Networks.get(url) === testnet

function Insight(url, network) {
  if (!url && !network) {
    return new Insight(Networks.defaultNetwork);
  }
  if (Networks.get(url)) {
    network = Networks.get(url);
    if (network === Networks.livenet) {
      url = 'https://insight.bitpay.com';
    } else {
      url = 'https://test-insight.bitpay.com';
    }
  }
  JSUtil.defineImmutable(this, {
    url: url,
    network: Networks.get(network) || Networks.defaultNetwork
  });
  this.request = request;
  return this;
}


texts: Why does Bitcoin adjust the difficulty every 2016 instead of 2048 blocks?

texts:
I am reading Bitcoin wiki and it says

over the previous 2016 blocks. Can be further simplified to
D * 2**32 / 600

without much loss of accuracy.

I guess the reason of reducing to 2**32 is for computing convenience (bit operation). However, 0xffffff / 2016 = 32.507440476190474 and 0xffffff / 2048 = 31.99951171875 which is more accurate.
Why was 2016 chosen instead of 2048?


texts: micropayment channels, n-m addresses, interoperability

texts:
I just read bitcoinJ's working with contracts tutorial and I am puzzled as:

it seems to me that n-m addresses are implemented in Bitcoinj using plain multisig (as defined in this bit of the developer's guide, and discussed here)
I looked for implementations of addresses controlled by more than one private key with pybitcointools (tutorial on that here) and on libbitcoin's wiki. It seems to me that these two libraries use P2SH.

Most libraries seem to use P2SH, but bitcoinJ chose the other way it seems (or is it?)...

In an implementation of micropayment channel with bitcoinJ on one side and, say, libbitcoin on the other ; will the two sides be able to interoperate?

(edit: I m talking here only about unidirectional payment channels)

Thanks


texts: About changing the endpoint in insight API (in bitcore)

texts:
I am just trying to find docs on bitpay's bitcore node to change the endpoint of one of its services , which is insight-api

https://github.com/bitpay/bitcore-node

https://github.com/bitpay/insight-api

The API endpoints will be available by default at: http://localhost:3001/insight-api/

Question: Is there a way to change localhost:3001/insight-api/ to say localhost:3001/btcApi/ ? I understand the config file is like SomeNode/data/bitcoin.conf


texts: Would proxying a lightning hot-wallet with a lightning cold-wallet make the hot-wallet safer?

texts:
(Edit: I realize how Mt.Gox-y the below setup sounds, but I'm coming at it from a "lightning routing problem perspective", not necessarily a straight "bitcoin security perspective"...though...those two things overlap quite a bit.)

The setup/problem:
I have two lightning nodes: (A) a Casa lightning node ("Casa-Node") that I trust in my apt, and (B) a BTCPayServer lightning node hot-wallet ("hot-wallet node").

BTCpayServer makes it REALLY easy to integrate a btc and lightning payment pipeline into my website, however the btcpay website has a warning the lightning wallet is a hot wallet, unsafe(ish) :(

I'd like to use my Casa node with BTCpayServer but they (casa) don't have that functionality yet. I don't want to simply put thousands of dollars on my BTCpay LN hot-wallet, as I don't trust it. The think of the casa node = trustworthy-node, and the Hot-wallet = less trustworthy-node.

A potential solution?
Came up with this idea: use my Casa Node as my primary routing node with payments coming in from strangers/customers, and have only one channel between my Casa Node and my Hot Wallet Node..so all LNpayment requests generated by the Hot Wallet Node get routed through the Casa Node, and I can easily balance the Casa/HotWallet, channel balance as needed (at the end of the day, move the funds back to the Casa Node and close that one channel out on-chain).

Example flow:

CasaNode = CN
BTCPAY Hot-wallet = HWN
Other nodes trying to pay HWN = L1, L2, L3

Step 1: Setup my website with BTCPay server, and enable HWN for the lightning payment pipeline. (assume my website is CatToys.info, and I sell four different $25 dollar items..made up but it helps the picture).

Step 2: Create a big LNchannel between my CN (more secure) and HWN (less secure storefront node). E.g., create a $1,000 payment channel between my Casa Node and the BTCPay Lightning Hot Wallet Node.

Step 3: Create a bunch of random payment channels between CN and other big nodes in the lightning network. These random payment channels increase the odds of a routing path being found between a given website customer's LN node and HWN node that generated the LNrequest (e.g., the BTCpay server that is generating the lightning payment request).

Step 4: Random customer browses CatToys.info, checks out via, which causes BTCPayserver to generate a lightning payment request for $25 via the HWN node.

Step 5: Customer uses his lightning node (L1) to pay HWN...the routing proceeds as follows:

$25 (in btc) from L1 --> CN --> HWN.

Other customer use the same flow:

$25 (in btc) From L2 --> CN --> HWN
$25 (in btc) From L3 --> CN --> HWN

Step 6: At the end of the day, HWN has 75 dollars (from the three customers paying 25 each for a cat toy). When I want to "close the store down" (which is a brick/morter thing to say, but just stay with me), I move all the funds in the CN--HWN channel back to CN, so the full $1000 is back on CN (i.e., move $75 back to CN), then close the channel out on-chain.

Step 7: if I need to "open the store" for the next day, I just need to recreate a single channel from CN---HWN, which is cheap as it's only a single channel to open up, and CN is ready to go (always connecting to lots of nodes (and CN is trust worthy)).

This approach would: let me use BTCPay server's hot wallet (or any wallet that I don't trust too much) with larger-ish funds, and give my hot-wallet channel instant liquidity by connecting to CN, and I would only need to worry about closing/opening/rebalancing a single lightning payment channel between CN----HWN, instead of trying to constantly open channels with different amounts of funding to keep my website enabled to receive lightning payments.

Thoughts? Would the above sequence work in the lightning network? And be safe/secure, and would payments actually be successfully routed to the website okay?

Any input appreciated, thx.


texts: I sent an amount of Bitcoins to my Bitcoin Cash-wallet on Coinbase instead of my Bitcoin-wallet on Coinbase. What now?

texts:
A few days ago I bought bitcoins (on btcdirect.eu) and sent them accidentally to my BCH-wallet on Coinbase (!). I contacted both btcdirect and Coinbase, unfortunately I received the same answer twice: they can't do anything about it.

The exact answer of Coinbase was: "Unfortunately, digital currency transactions using most blockchains are irreversible, meaning once they are sent there is no way to reclaim funds. If you sent digital currency from your Coinbase account to an email address by accident, your funds will be returned to you in 30 days if the funds remain unclaimed. If the email address has not already been claimed, you could do so to ensure the funds are returned to you."

Does someone know what I can do in this situation? It's a big amount of money for me and I really can't lose it...

Thank you in advance!


texts: How does the wallet identify which UTXOs belong to a public address while creating a new transaction?

texts:
I am a beginner here. A Transaction output has a field for amount and a locking script but no direct field for public address for which the output is meant. When a new transaction is being created, the wallet searches the UTXO set for outputs that is locked to one of the wallet's public addresses.

  My question is, how does the wallet, while searching, know that a
  particular UTXO is locked to its public address?

  Does it check each UTXO using a unlocking script to find whether it
  is locked to its public address?

  Or does it maintain a separate database which maps public addresses to
  UTXOs meant for it, or anything similar for faster lookup?

  How does it find this subset of UTXOs which is locked to the public
  address?


texts: Is block height always sequential? Can it serve as a 100% reliable block counter in case if I want to check whether I missed a block or I need to account for any corner cases?


texts:
Long time ago I registered on ripple.com and had some ripples there. I still remember my login/password but the site is completely different now and it looks like there is no option to log-in anymore.

Is there any hope to log-in to my old account and get my ripples?

Few other details to not confuse people who try to help by answering my question: I am pretty sure it was a ripple.com (I use lastpass which stores information about the site/login/password). I have not bought XRP, I got them for free (as far as I remember in the very early days they were giving ~100 or so to people just to try it).


texts: Does a low profit margin on mining reduce the integrity of the blocks stored in the transaction history?

texts:
As the mining Bitcoin payout decreases from 50 to zero, what incentive is there for miners to continue operating?

Is there a need for miners to continue to operate when the payout decreases to zero?

I thought part of the purpose of mining is to validate the Public key with the General Ledger that is replicated in P2P fashion between nodes.  If the miners go away, will GL validation stop?


texts: Bitcoin purchased but not received into my wallet

texts: I paid over 12k for bitcoins and it was sent and I have a copy of the bitcoin transaction.  I have not received the amount into my wallet. Is there any way that I can still retrieve my bitcoins?  It has been 3 days now and they provider is one that I have used before and I trust that the bitcoins are there but I need to find a way to access them.


texts:
I was analyzing a Bitcoin transaction that works both with Segwit and non-Segwit for multisig Scripts.
Here is the transaction: https://www.blockchain.com/en/btc/tx/80975cddebaa93aa21a6477c0d050685d6820fa1068a2731db0f39b535cbd369

Note that on indexes 0, 1 and 2 we have the unlocking script in the scriptsig filed and on index 3 it is using witness program. No problems until now.

What is bugging me is why when I get the redeem script from indexes 0, 1 and 2 and execute the ripemd60, sha256, create checksum and encode to base58 it generates the Public address as we can see in the screen of blockchain.com. But when I do the very same thing using the redeem script which is in the witness section, it returns to me a completely different address, why is that happening?

Also, what is the scriptSig on the index 3? How it is generated?

Example:

Redeem Script of index 0:

522102194e1b5671daff4edc82ce01589e7179a874f63d6e5157fa0def116acd2c3a522103a043861e123bc67ddcfcd887b167e7ff9d00702d1466524157cf3b28c7aca71b2102a49a62a9470a31ee51824f0ee859b0534a4f555c0e2d7a9d9915d6986bfc200453ae

The address generated from index 0 using my script:

3JUJgXbB1WpDEJprE8wP8vEXtba36dAYbk

It is the same as the transaction.

Redeem Script of index 3 (Segwit):

5221021e6617e06bb90f621c3800e8c37ab081a445ae5527f6c5f68a022e7133f9b5fe2103bea1a8ce6369435bb74ff1584a136a7efeebfe4bc320b4d59113c92acd869f38210280631b27700baf7d472483fadfe1c4a7340a458f28bf6bae5d3234312d684c6553ae

The address generated from index 3 using my script:

36aKiVksQRLKwByBYVz3KwquFcvHZkwroP

Address from the transaction recovered from blockchain.com

3CYkk3x1XUvdXCdHtRFdjMjp17PuJ8eR8z


texts: What happened to my coins, balance account is zero ... hacked?

texts:
Yesterday I was surprised to seen that my wallet drop to zero by this transaction id : 504ebc5aa9c6dcdbfadfd97ccd47a289a309d829530e529e558b715563c4ec3b
It seems the adress : bc1q8yl5pq7p0cg6dtd85lz3hznj30rhe8k2s5kxhm
has picked all my BTC, plus others small transaction from somebody else are also availlable
Right now the transaction has been 36 times confirmed
and my balance show zero BTC.
Seems to be hacked ?
Did someone can help as I'm a newbie
Thx


texts: Why a specific bitcoin value of a tx message appears in source IP address and then comes to same IP address as the destination address?

texts:
Sometime back, I created two wallets on two distinct cellphones. I sent a specific bitcoin value (A bitcoin) from one cellphone to another one. During this process, I captured the entire traffic.

After that, I extracted all tx values and output addresses. I saw same value (A bitcoin) and its output address (Address B) in the output which was sent from Source IP address (my cellphone) to destination IP address. Also this value and address was sent to some other IPs.

I also saw that this value (A bitcoin) and its output address (address B) is in some tx messages which is sent from another IP address to my IP address (my cellphone). In another words, I see that the specific value and its address return to my address again. It should be noted that this is a spent value and is not an UTXO. Why does my Bitcoin transaction value and its address in some tx messages gets returned back to me?


texts: What exactly is checked at various -checklevel's?

texts:
The standard bitcoin-qt/bitcoind client has an option -checklevel which purports to perform various checks on the block data stored on disk.  Is there current documentation (other than the source) describing specifically what is checked at the different levels?

The function VerifyDB in the source has brief comments describing the levels:

// check level 0: read from disk
// check level 1: verify block validity
// check level 2: verify undo validity
// check level 3: check for inconsistencies during memory-only disconnect of tip blocks

It would be nice to see these explained in terms of the Bitcoin protocol.  For example, are block hashes verified?  Do we check that all the blocks in the chain correctly link back to one another?  Are transaction signatures verified?  Et cetera.


texts:
Surprised this one hasn't been asked yet.

But how / what is the recommended best practice for shutting down bitcoind ?

Right now I'm manually killing the process with either sudo kill {pid} or if this is failing (like just now) using sudo pkill -9 -f bitcoind


texts: Trouble compiling bitcoind on OSX with homebrew

texts:
I've read the README on the bitcoin github page which instructs you to install the following libraries using MacPorts - boost db48 dbus openssl.
I have these installed using homebrew which I use instead of MacPorts. They are also the correct versions as homebrew installs, later, incompatible versions.
With these installed I edited the make to point to the libraries homebrew installed namely DEPSDIR=/usr/local and adding  -I"$(DEPSDIR)/Cellar/berkeley-db4/4.8.30/include" to INCLUDEPATHS
However I'm getting this compiler error which is cryptic to me:
https://gist.github.com/ashleyconnor/944f611b969444f06430145972b880cf
Has anybody managed to get this working?


texts: How to move sync's data to another partition after run Bitcoind for a while?

texts:
I have download a new bitcoin package from official site. And then I ran it with daemon mode also with default configuration (Default means not bitcoin.conf file was created in ~/.bitcoin/.bitcoin.conf). After ran 2 hours. I got stuck, and the process exit. When I checked my disk with:

df -lh

And then, I got those:

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G   20G  118M 100% /
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           3.9G  233M  3.6G   6% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/vdb        800G  7.7G  792G   1% /data
tmpfs           783M     0  783M   0% /run/user/1000
tmpfs           783M     0  783M   0% /run/user/1001

And I googled for a while, but could't find a good way to move all sync's data to the /dev/vdb. I understand what my mistake came from, but I just fixed it by move data and then put a new configuration with --data-dir=/dev/vdb. and then keep sync it.

So, How do I reach that?


texts: How to compile sources on MAC OS in 2017?

texts:
I know there are a few questions like this on the stack already, but currently I'm facing issues with a compilation. I've tried an official guide from the github for mac os, but end up with a lot of errors.
First of all, I always get this kind of errors:

aclocal: error: aclocal: file '/usr/local/share/aclocal/introspection.m4' does not exist

and other files from aclocal.

If you have an experience, and know how to setup, or know any guides, please share share. Thanks in advance :)


texts: Can the Lightning Network work on any other cryptocurrency?

texts: I believe Lightning can be used with other cryptos such as LTC, what needs to be implemented to make it compatible with other cryptos? How difficult is it to implement on those other cryptos if they are compatible?


texts: How are transactions and blocks relayed?

texts: What is the protocol for relaying transactions and/or blocks in bitcoin? I realize that nodes never relay a transactions and blocks with a variety of properties (e.g., invalid transactions). This question is concerned more with the specific broadcast/relay protocol. In particular, are there any issues with broadcast loops and if so, how are they solved? Is it as simple as each node remembering which txs and blocks it has already transferred and never relaying twice? Thanks.


texts:
What is a double spend?

As someone who uses Bitcoin, what do I need to know about how the Bitcoin system prevents double spends? Are there still circumstances where they can occur?


texts:
Why do transactions have to be bundled in a block? Why not mine single transactions separately?
What is the advantage of bundling transactions in a block?
Also are there any blockchains/decentralized ledgers that mine transactions separately?


texts: A Proof of Concept for P2P Bitcoin Exchange?

texts:
Has anyone proposed or developed a proof of concept for a P2P bitcoin exchange?

Edit:

Let me add some layers here. How would trust work in a P2P exchange? How would one actually get the money they have exchanged for? Does this require a bank to be involved?


texts: Lightning Network: what if one broadcast an old transaction?

texts:
I understand that after a channel is created, A and B need to agree and sign to create a new transaction. The new transaction overrides the previous transaction. A or B could quit the channel by broadcasting the transaction onto Bitcoin network so that the transaction is final:

txn 0: A:0.5, B:0.5
txn 1: A:0.3, B:0.7
txn 2: A:0.9, B:0.1

A or B quit channel, broadcast txn 2, so A will have 0.9 and B will have 0.1

But what if B quit the channel, broadcasting txn 1 rather than txn 2 on to the Bitcoin network? Wouldn't the txn 1 becomes final and B could walk away with 0.7?


texts: what is the best software based solution to secure the private key in Bitcoin

texts:
Would you mind telling me what is the best introduced approach to secure the private key in the wallet and a transaction which is done using Bitcoin? I do not want to use a separate hardware, I am seeking for the best software based approach to protect the private key.

Thanks in advance

Best Regards


texts:
I've started creating my own wallet in bitcoinj and I have serious problem. I want to create raw transaction without wallet object. So I wrote this piece of code:

    //String to a private key
    DumpedPrivateKey dumpedPrivateKey = DumpedPrivateKey.fromBase58(params,
            privKey);
    ECKey key = dumpedPrivateKey.getKey();

    //String to an address
    Address address2 = Address.fromBase58(params, address);

    Transaction tx = new Transaction(params);
    //value is a sum of all inputs, fee is 4013
    tx.addOutput(Coin.valueOf(amount-4013), address2);

    //utxos is an array of inputs from my wallet
    for(UTXO utxo : utxos)
    {
        TransactionOutPoint outPoint = new TransactionOutPoint(params, utxo.getIndex(), utxo.getHash());
        tx.addSignedInput(outPoint, utxo.getScript(), key);
    }

    tx.getConfidence().setSource(TransactionConfidence.Source.SELF);
    tx.setPurpose(Transaction.Purpose.USER_PAYMENT);

    System.out.println(tx.getHashAsString());
    b_peerGroup.GetPeerGroup().broadcastTransaction(tx);

But this ends with:

  mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack e

What is wrong with my code?

EDIT:
I found a solution. I've changed only this line: tx.addSignedInput(outPoint, utxo.getScript(), key, Transaction.SigHash.ALL, true);


texts: Can I sign a message with an Open-PGP key?

texts:
I want to prove that I control an address for asset verification. To lawyers that might not even know what a blockchain is.

Signing using the private key of an address does nothing for me, as it doesn't prove I control the address (I could have told someone else to sign their address). Is there a way I can leverage PGP signatures in the signing message?


texts: Is there a way to get data on exchange-specific crypto prices using Yahoo finance?

texts: Yahoo finance provides information on country specific cryptocurrency prices, but it seems they don't have information on particular exchange prices like coinbase for example. Is there a way to access this by using their site?


texts: Where can I get historical prices for coins, with the ability to store the information. I understand that most APIs do not allow you to save their information, any that do?


texts: What are the advantages to become a bitcoin node?

texts:
As far as I understand, the nodes are responsible for verifying the transactions and the blockchain, but also to relay transaction over the bitcoin network.

Being a bitcoin node require a certain infrastructure and thus it costs money.

Who wants to create a new bitcoin node and what are the benefits?


texts: Is there a way to get the address of associated with a transaction input with bitcoinj?

texts:
If I was not mistaken, with transactioninput.getConnectedOutput(), the output which is used for the input is obtained.

But what to do later? There seem to be two relevant methods: getAddressFromP2PKHScript(NetworkParameters networkParameters) and getAddressFromP2SH(NetworkParameters networkParameters). Am I correct that either one of them will give me the correct address?

Also how to obtain the addresses involved in multisignature transaction with bitcoinj?


texts:
My intention is to setup a site with 1 or 2 products, which user can select the product that they wish to use and pay with arbitrary amount.
My BTCPayServer Setup
Payment

Allow anyone to create invoice
Network fee: on every payment
2 confirmation

App

Type: Point Of Sales
User can input custom Amount

Am I doing it correctly?
And what are the API and flows that I need to invoke from my own website to achieve the following:

User select the item and amount from my own website (not BTCPay)
User select pay, and my website will display a QR Code
User scan and pay.
My website check for the payment status

Seems like I only need to create an invoice and then monitor the status of the invoice. Is that correct? But why do I need to setup Apps and my Products in BTC Server? Is that necessary?


texts: addnode in bitcoin.conf doesn't work (Regtest mode)

texts:
I'm trying to make to nodes on the same computer communicate.
I set up two bitcoin folder with two bitcoin.conf files.
bitcoin.conf in the second node is the following:

rpcuser=bitcoinrpc
rpcpassword=roiroiroiroiroi
addnode=127.0.0.1:18444

while in the first node is just I've just set the rpcuser and rpcpasswords

Now I start the nodes with the following command

First node
./bitcoin/src/bitcoind -regtest

Second node ./bitcoin/src/bitcoind  -regtest -rpcport=5444 -port=18888 -datadir=/Users/tommaso/.bitcoin/

But they don't connect to each other.

Only if a run the command ./bitcoin/src/bitcoin-cli  -regtest -rpcport=5444 -datadir=/Users/tommaso/.bitcoin/ addnode "127.0.0.1:18444" "onetry"
 they finally connect

Why does addnode=127.0.0.1:18444 in bitcoin.conf doesn't work?


texts: Is possible extract the original script P2MS from the transaction locked with the P2SH address?

texts:
This is a stupid question because if the P2SH contains the hash160 (and the hash160 contains the sha256) of the P2MS doesn't possible return to the original hex P2MS.

So, but for verifying the P2SH I must insert the real redmee script inside the scriptSig, so if I parsing the scriptSing I can found the N signature and the M "public key" inside the script P2MS, right?

An example, inside an scientific article this address is cataloged such as scam address, but this address is a script address, so it could is:

a P2MS script with M "public keys"
a script without the "public keys"

But I can access the scriptSig and parsing the hexadecimal, I should be found the original script, right?


texts: Why is my transaction not confirming after a month?

texts:
My Bitcoin transaction 016a647fdb45d0f1a679ae7b3b4465ced76b817f63595c37e3214d63098ddd47

is still unconfirmed. Although I do realise this transaction was made with a low fee 10.044 sat/B, it is not as low that the transaction should not confirm. According to data provided on https://bitcoinfees.earn.com/, this transaction should still confirm within a day.

I tried everything already. I have heard a reset of the wallet may work, however I do not have an actual wallet, but only use the Blockchain.info wallet, where I believe a restart of the wallet is not an option. I also tried rebroadcasting the transaction with various websites, however none of it worked.

What am I supposed to do at this point, that my coins have been stuck in limbo for a month now?


texts: Why would we ever need 10k new addresses in average per day?

texts:
Generally speaking, the address space of Bitcoin seems to be sufficiently large to make it unlikely that a hash collision will ever occur (see below).
Pacerier stated in a comment on Is it possible to brute force bitcoin address creation in order to steal money? that we'd "want Bitcoin to scale to [...] 10b people, each generating 10k different addresses a day, that's 100 trillion addresses created daily." He followed up with "10k may be a severe underestimation".

100 trillion is 10^14, so if we kept up that pace, we'd have used one address per satoshi after 21 days. I am confused as to what might be the reasons for users to need 10k addresses per day.

Please explain: Why does it seem likely that we will need such a large number of new addresses each day? In what scenario would each user in average need 10k new addresses per day?

Total number of satoshis:

At one address for each satoshi that could be ever in existence (2.1*10^15), with the giant address space of 2^160 possible addresses, the simple approximation of the Birthday paradoxon, which works well for probabilities less than or equal to 0.5...

... tells us that the chance of single hash collision occurring is still pretty small: 1.508*10^(-18).


texts: What is the incentive for including transactions in a block?

texts:
I've been doing research in trying to answer this question and haven't found a good answer yet. I was wondering what is the incentive for miners to include a transaction in a block when mining bitcoin? Since it's a race to solve the proof of work problem, why wouldn't miners just leave the block empty to save time?

The reward for mining the block is much bigger than the transaction fee(s) so it doesn't seem to make sense to me to waste time validating transactions for the block just to accumulate small transaction fees. If anyone can provide an answer, that would be greatly appreciated. Thanks.


texts:
To run a lightning node I followed the instructions here: https://medium.com/@dougvk/run-your-own-mainnet-lightning-node-2d2eab628a8b except that I downloaded and installed bitcoind and lightningd from source and not in a docker. I can fund my on-chain wallet, connect to peers but when I try to open a channel the daemon crashes, with the following message in crash.log:

+61107.734361005 lightningd(30005):BROKEN: wallet_channel_save: UPDATE channels SET  fundingkey_remote=?,  revocation_basepoint_remote=?,  payment_basepoint_remote=?,  htlc_basepoint_remote=?,  delayed_payment_basepoint_remote=?,  per_commit_remote=?,  old_per_commit_remote=?,  local_feerate_per_kw=?,  remote_feerate_per_kw=?,  channel_config_remote=? WHERE id=?: no such column: local_feerate_per_kw
+61108.166336903 lightningd(30005):BROKEN: FATAL SIGNAL 6 RECEIVED

What does local feerate per kw mean? To set the tx fee of bitcoind I followed the instruction from the blog post:
bitcoin-cli settxfee 0.0004

Thanks!


texts:
So I found this question: How much Bitcoin will I mine right now with hardware X?

I'm interested in understanding what exactly are the following values: 65535 and 2^48. I know that the former is concerned with 16 bits? And if that is correct, then for the unsigned integer of 16 bit size, you can express 2^16 - 1 values (i.e. we do not count zero), so you get 65535. I do not understand why we plug it into this equation though:

  (H*B/D) * (60*60*24 * 65535 * 10^6 / 2^48)
= (H*B/D) * (5.662224e15 / 2^48)              BTC per day (1)

But I also know that D*((2^48)/65535) is the number of hashes (in Mhash) that you have to solve to find a block.

So the equation that I gave you, I can understand that 60*60*24 is number of seconds in a day. Let's denote it as S. Then:

(H*B/D) * (S * 10^6 * (65535 / 2^48))

So I assume, 10^6 is some kind of hash to Mhash modifier (and that makes sense because 65535/2^48 is inversed, so we have to multiply and not divide).

So my question is, what is 65535 and 2^48. And then what is 2^48/65535 and what is 65535/2^48. Please be technical, but clear. Thank you.

EDIT:

From here: https://arxiv.org/pdf/1112.4980v1.pdf, I understand that 1/(2^32 * D) is the probability of finding a correct hash, or more precisely: (2^16 - 1)/(2^48 * D). They once again, do not tell us what those numbers are though

EDIT EDIT:

Number 16 must either deal with the fact that you require 16 leading zeros in block hash that you are looking for, or the fact that you have 16 hexadecimal values (0,1,2..,9,a,b,c,d,e,f). It probably deals with former because we have 2^16, which feels like it is binary state 16 times. Another reason why its trailing zeros is because hash has 64 values, and we have another number 2^48. And you get to 48 by deducting 16. So you have: total number of binary permutations in the numerator minus one (for length 16 bits) divided by total number of binary permutations of length 48 bits.. hmmm


texts: Why do we need CCoins in addition to CTransactions?

texts:
As per my understanding CTransactions represents the atomic unit in Bitcoin. It has the inputs CTxIn and outputs CTxOut.

Can any expert give the intuition of why we need CCoins in source code ? Why should we have a separate pruned class just for storing outputs ?


texts: Openssl magic values? Secp256k1 and ECDSA similarities? What makes secp256k1 special?

texts:
Part 1:

Running this command seems to be a reliable way to produce a pubkey from a valid private key that for Bitcoin. Is this a correct assumption?

openssl ec -inform DER -text -noout -in <(cat <(echo -n "302e0201010420") <(echo -n "PRIVATE_KEY_HEX_STRING") <(echo -n "a00706052b8104000a") | xxd -r -p) 2>/dev/null | tail -6 | head -5 | sed 's/[ :]//g' | tr -d '\n' && echo

These magic values:

302e0201010420

a00706052b8104000a

Openssl seems to use these values for DER encoding rules, and it doesn't seem to have anything to do with secp256k1 or Bitcoin specifically. Is this a correct assumption?

Part 2:

It doesn't seem like the y^2 = x^3 + 7 formula / secp256k1 is used anywhere explicitly when deriving the pubkey from the private key in the above openssl command.

Are all public keys for Elliptical Cryptography practically derived the same way.. meaning there is a ton of overlap between these ECDSA curves?

Seems like the only thing specific to Bitcoin compared to another ECDSA curve is the maximum upper limit for a private key of FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141.. is this a correct assumption? How is it that I'm able to produce the private and public keys without having to use the formula? It's like Satoshi lied to us and this formula has no meaning!

A bit confused here would love if someone could clear this up for me and the 2 other people who can't sleep at night because of this.


texts:
I am currently running bitcoind v0.16.0.0 on my macbook (osx 10.12.6) and the initial sync time is really slow. I'm syncing at roughly 88 blocks per hour which would mean it would take another 2 months to sync up..
In the activity monitor it looks like bitcoind is using only 3% of the CPU time.
Could this be the issue? Is there any way to speed it up?


texts:
So, I have a wallet - and the balance is incorrect.

I have looked into it a bunch and finally tracked down what I think is the issue.

If I view all of the addresses used in my wallet I see a list of Addresses with balance and unused addresses.

The problem is that one of the "unused addresses" actually has a balance.

The address is: 1HYMfJhgiprZ3n1oHKiSZ1n2e85Cyn7HAe

How can I make bitpay "use" this address again?

I have tried the following:
  - Clear wallet cache
  - Scan addresses for fund
  - Restoring wallet to another device

I thought I could try importing that address into electrum - but I cannot figure out how to get the private key for that address out of bitpay wallet.

Any advice?


texts:
bitcoind IsFinalTx() as seen here checks the properties of a transaction in this order:

Is nLockTime exactly 0? That's final. return.
If it's not 0, is it below the current block height / time? If so, it's final. return.
Ensure that every tx input is exactly 0xffffffff. If so, it's final.

Because these are checked in order with return statements, nSequence won't even be checked if nLockTime == 0. Furthermore, a transaction that is NOT past its nLockTime value could still be "final" as long as all the nSequence values are 0xffffffff

Non-final transactions are not valid in blocks, so my questions are:

Why is a "bad" locktime ok as long as all sequences are final? The tx won't be mineable anyway, right?
What are the implications for replace-by-fee and Check Sequence Verify transactions (when a non-final nSequence value is used)? Does this mean that to use those features, nLockTime has to be set a certain way?
Or, maybe, because nLockTime has to be below the current time/height anyway, this is all just moot and really, nSequence doesn't really impact transaction finality at all.


texts: What happens if the power goes out during bitcoin mining process and system shuts off?

texts: I am in an area where there is power outage. I want to know, what will happen to bitcoin or my wallet or anything. Just need the basic information here.


texts: How to enable wallet encryption from the command line?

texts: Which command should I use to encrypt a previously unencrypted wallet from the command line?


texts: How to findout the sender of a transaction

texts:
How do I find out which addresses are the inputs of a given transaction, given its transaction ID?
I know there is a way, as satoshidice.com uses this.
I would like to do this with own software and not rely on some third party provider, which could easily kill their service.

EDIT:

Basically I'm creating a PHP project, where I need to find out when a new transaction arrives and which address sent it. So I need a way to get a notification or start a PHP script (called with needed variables [txid, sender address, receiving address, value]) when a new transaction arrives.