24 votes
Accepted

How can I manually (on paper) calculate a Bitcoin public key from a private key?

I've spent a fair bit of time thinking about this and can provide a fairly comprehensive answer about the state of the art. But unfortunately the TL;DR is that we don't know how to do this (yet) in ...
Andrew Poelstra's user avatar
10 votes

How to build a bitcoin trading bot

Building trading bots that interact with the exchanges is very similar to interacting with other RESTful APIs. Basically, you make query objects to whichever exchange you like to use. Here is a simple ...
Adam Cox's user avatar
  • 111
9 votes
Accepted

What are the differences between Bitcoin and Libra?

This question might be considered too broad and too opinion based according to the rules of this forum. However, tackling it from a technical standpoint based on facts rather than opinions might be on-...
Ugam Kamat's user avatar
  • 7,408
8 votes
Accepted

In Bitcoin, what happens if there is no viable nonce?

It's important to note that the block hash is over the entire block header, which contains: Block Version Nonce Previous block hash Timestamp Merkle Root nBits Of these, only the nBits and previous ...
Raghav Sood's user avatar
6 votes

At which point and how does the miner who successfully solved hash get coins?

The block subsidy isn't awarded by anyone. It is taken by the miner, by virtue of creating a block that gives himself money. The system's role in this is restricted to permitting blocks to indeed ...
Pieter Wuille's user avatar
6 votes

SegWit signing algorithm and its improvement

To be clear, this is talking about the way the message that is signed is computed. It is unrelated to transaction or block hashes and the signature algorithm itself, just how Bitcoin determines what ...
Ava Chow's user avatar
  • 70.4k
6 votes
Accepted

Why does bitcoin.core's algorithm uses ancestor score instead of just ancestor fee rate to select transactions?

This is intended to be a performance optimization when generating a block template for mining. The issue is around how many transactions we end up looking at while iterating over the mempool during ...
sdaftuar's user avatar
  • 599
5 votes

Why are there different mining hardware for different hashing algorithms?

The hardware you are referring to are called Application Specific Integrated Circuits (ASICs), and they are named that for a reason. It's because they are not general purpose computers like desktops, ...
Jestin's user avatar
  • 8,812
5 votes
Accepted

Are bitcoin Merkle trees always binary?

Merkle trees in general can have more child nodes, but the Merkle tree for transactional data in Bitcoin is a binary tree. "Merkle trees are binary trees of hashes." –Bitcoin-Wiki Protocol ...
Murch's user avatar
  • 75.2k
5 votes

Algorithmic trading python library?

Check out my ccxt library on GitHub: https://github.com/kroitor/ccxt With it you can access market data and trade bitcoin, ether and altcoins with many crypto currency exchanges. It is used to ...
Igor Kroitor's user avatar
5 votes

Could Bitcoin be based on accounts instead, more like banks?

It could, yes. Ethereum works on something similar to an account system, at least as far as ethereum balance is concerned. Both models are valid, and have their benefits and drawbacks. The UTXO model ...
Raghav Sood's user avatar
5 votes
Accepted

Is verification of a blockchain computationally cheaper than recreating it?

Is verification of blockchain computationally cheaper than recreating it? Yes, far easier How do you verify the blockchain integrity? Don't you also have to recalculate all the values to see whether ...
RedGrittyBrick's user avatar
4 votes
Accepted

Algorithmic efficiency for transaction lookup in blockchain

No, you can't. The block chain is a linked list of blocks, and each block contains an array of transactions. Block headers commit to a Merkle tree of the transactions in them, but they are sorted ...
Pieter Wuille's user avatar
4 votes
Accepted

What is the difference between BFT and PBFT

BFT is a class of problems where a group of nodes needs to find consensus, where some of the nodes may be malicious. PBFT is an algorithm that generates consensus in one of those environments (...
Yaoshiang's user avatar
  • 226
4 votes

Is verification of a blockchain computationally cheaper than recreating it?

The reason that is often stated is that you would have to re-calculate all the headers with all the hash values of the whole chain which is practically un-doable. It's not the mere recalculation of ...
Murch's user avatar
  • 75.2k
3 votes

Transaction signature algorithm

The ECDSA digital signature scheme returns two values. To be specific, the X and Y values computed on the elliptic curve are returned. In Bitcoin the signture is DER encoded, which is represented as ...
Bjarne Magnussen's user avatar
3 votes

How to build a bitcoin trading bot

The key steps you outlined for creating a cryptocurrency trading bot are correct. As for the daunting tasks you can also take a look at my ccxt library from GitHub. It allows to skip steps 1-3 and ...
Igor Kroitor's user avatar
3 votes

Is Quark as secure as SHA 256?

The biggest problem with Quark (or any other "memory hard" algorithm) as a hashing algorithm is that verification is synchronous. So in order to verify things you have to do a lot of work, compared to ...
Нонн Болдырев's user avatar
3 votes
Accepted

Implementing NiPoPoW algorithm

I. This is almost correct. The only difference is that you still need the χ suffix mentioned in the paper, which includes the most recent |χ| = k blocks of the blockchain. This is because the “last ...
Silviu's user avatar
  • 161
3 votes

What happens if I use same k twice in DSA algorithm?

If you sign two messages using the same nonce, then it is possible for someone to derive your private key. See How do you derive the private key from two signatures that share the same k value?
Mike D's user avatar
  • 3,569
3 votes
Accepted

If there was an easy way to check for double spends, will consensus algorithms be needed?

Yes, if you assume that the central challenge of a distributed system in an antagonistic environment doesn't exist, hypothetically creating such a distributed system is indeed much easier! Currently, ...
Murch's user avatar
  • 75.2k
3 votes

Where is a good source of information for procedural algorithm to program my own Bitcoin QR code generator?

You're mentioning private keys, which are obviously not supposed to be shared while the purpose of QR code is to share information. A QR Code is the transformation of a string into a 2D picture. It ...
Maxime CATY's user avatar
3 votes
Accepted

What criteria does Bitcoin Core use to create block templates?

As of Bitcoin Core v26.1, the mempool tracks each transaction in the context of its ancestor set and prioritizes their inclusion on basis of their ancestor set feerate. Let’s assume a cluster of five ...
Murch's user avatar
  • 75.2k
2 votes

Get uncompressed public key from compressed form

You can use bouncycastle ECPoint to do this conversion: static ECParameterSpec SPEC = ECNamedCurveTable.getParameterSpec("secp256k1"); static byte[] compressedToUncompressed(byte[] compKey) { ...
michaelliao's user avatar
2 votes
Accepted

Get uncompressed public key from compressed form

Yes, you can convert a 33-byte compressed public key into a 65-byte uncompressed public key in Java. Here is the code to perform the operation. It is correct, robust, and only requires Java SE ...
Nayuki's user avatar
  • 882
2 votes

How to build a bitcoin trading bot

You have the basic steps down. You can cut out #1 since your wallet will likely be the on the exchange you are trading on. #4 is the hardest part, at least if you are trying to make money! Overall ...
m1xolyd1an's user avatar
  • 5,636
2 votes
Accepted

How bitcoin protocol checks transaction is valid (in particular that inputs are unspent)?

Yes, you've basically got it. Regarding multiple outputs, the solution is quite simple. Your input, instead of just specifying a transaction to spend, instead specifies a particular output of a ...
Nate Eldredge's user avatar
2 votes
Accepted

Does full node store all valid forks and "alternative" blocks from blockchain history?

Do nodes store all the branches from entire blockchain history? They will store all branches that they know of so long as the block headers of each branch are fully valid. The way that Bitcoin Core ...
Ava Chow's user avatar
  • 70.4k
2 votes
Accepted

I want to know how I can express a phenomenon found in Merkle Trees mathematically

Ceiling of the binary logarithm?
Nate Eldredge's user avatar
2 votes
Accepted

What is the optimal way to increment extranonce?

The Merkle root of the transactions is calculated by building a binary tree from the transactions as leaves where each parent node is the hash of its two children. As the coinbase transaction is the ...
Murch's user avatar
  • 75.2k

Only top scored, non community-wiki answers of a minimum length are eligible