Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

8

Is there a way to get to the hash160 address from bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c Yes, you could use the reference implementations in various languages to encode and decode a bech32 address. For example, I have decoded the sample address you mentioned in the question, bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c, using python below. The decode ...


6

All current addresses are cross compatible. At a technical level, the chain has no concept of an address, only of locking scripts, which are fragments of a bitcoin script program. You send coins by specifying the locking script, and spend them by providing the unlocking script (also called the script sig), which completes the program by providing the ...


5

Displaying two would be justified if you were asking about a BC1 p2wpkh vs a 3xxx p2sh(p2wpkh) because not everything supports BC1 but its pretty good to use when supported. Displaying two isn't useful between p2pkh/p2sh as you've asked about because p2sh is supported everywhere and many wallets and services have used p2sh exclusively for a long time. ...


5

Nope. Not 1 bit. A balance (in this context) is the sum of all UTXO's for a given address. There is no limit on the number of UTXO's or their total amount (from the perspective of how the blockchain works and the blockchains limitations). Software interpreting the balance may have limitations on consuming, processing and/or displaying a number beyond a ...


5

The blockchain does not see wallets at all. It only sees spent and unspent transaction outputs (txouts). A txout is either completely spent or completely unspent - it cannot be "partially" spent and so there is no notion of balance. (If you want to spend less than the full value of a transaction, you create a change output.) In your example, there are ...


4

This is not currently possible, as Bitcoin Core uses hardened BIP32 derivation to compute keys and addresses. This derivation scheme does not have a usable xpub that lets you derive the same keys publicly. For more background, an xpub (or extended public key) is a string defined by BIP32. Every xpub has a corresponding xprv (extended private key). From the ...


3

There are 2160 P2PKH addresses. There are 2160 P2SH addresses There are 2160 P2WPKH addresses. There are 2256 P2WSH addresses. There are 16 defined but unused witness versions which can be encoded by BIP173 (Bech32) addresses, each with data length 2 to 40 bytes. That's 16*256/255*(25640 - 256) =~ 2324.006. That's ...


3

Is there a limit to the number of Bitcoin addresses? If I understand it correctly, there can never be more than 1461501637330902918203684832716283019655932542976 of the current type of addresses. 2160. what stops someone from making all these addresses and holding the private keys for them ... Probably: There aren't enough atoms in the universe to ...


3

Bitcoin Addresses contain a check-value: extra data added on computed as a function of the rest so that mistakes are unlikely to be acceptable addresses. 1x and 3x addresses use a 32-bit cryptographic hash for their check value and as a result any given well formatted random address has roughly a 1 in 2^32 chance of being accepted. But when users make ...


3

You're hashing the string representation of things, not the actual hash itself. Hash the bytes of the hash, not the bytes of its string representation. All of the should operations are on the bytes themselves, not the hexadecimal representation of those bytes which is what you have done.


3

Most of the output addresses follow one of the following 'standard outputs': Legacy Outputs P2PK: scriptPubKey: <public_key> OP_CHECKSIG. Output pays the public key directly and hence does not have a direct address. P2PKH: scriptPubKey: OP_DUP OP_HASH160 <hash160 of pubkey> OP_EQUALVERIFY OP_CHECKSIG. For this kind of output you just need to ...


3

No, you cannot assume this. There are a number of ways in which individual inputs may belong to different wallets/owners. For example: They could come from a hosted wallet or exchange, where inputs may span coins deposited by thousands of individual users, and selected for a transaction with no particular relation to the user making that transaction ...


3

Bitcoin does not work on an account model but operates on an UTXO (unspent transaction output) model. When you send bitcoins to an address, what you are essentially doing is locking those bitcoins in a mathematical equation. Spending those coins requires that you provide the correct unlocking condition (most often signature and public key associated with ...


3

The main difference is that Bitcoin in lightning network channels are in 2of2 multisig wallets. You own a key and your channel peer owns the second key. Your funds are "safe" because you have pre-signed transactions that spend from that multisig wallet (similar to an offline signing of a transaction). As soon as you keep those pre-signed transactions, your ...


2

Listaccounts is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts. (code -32)


2

What are the advantages (and disadvantages) of using this over other specifications such as secp256r1? Secp256k1 is less widely used than secp256r1 so for some time there were faster implementations of r1 than k1. That isn't true today, and the fastest implementations of k1 are considerably faster than r1. Secp256k1's security critical parameters are ...


2

If you only generate a limited set of addresses before you delete your wallet, it is likely you will run out of fresh addresses to receive funds on, meaning multiple spendable transactions will be linked together via the receiving address. This is a privacy disadvantage. Secondly, your mnemonic key phrase back-up follows an off-chain deterministic key ...


2

A Bitcoin address is not necessarily a single-use token. Addresses can absolutely be reused. However, it's good practice to use a new address for each transaction, for reasons of privacy and security. The privacy element was outlined in the Bitcoin whitepaper (section 10): As an additional firewall, a new key pair should be used for each transaction to ...


2

With option 2, most analyses will conclude that Alice owned A1, A2 and A3, because the transactions which spent them have no change address. Typically, you assume that the amount you have held in a TXO never exactly matches the amount you're making as a payment, so transactions usually have change outputs too. I think you have a little misunderstanding ...


2

I don't think you can make that assumption with any certainty. You can fairly easily invent other explanations that are equally valid (though probably much less likely) For example, this transaction might be created by a 23292 member club with an annual subscription of 1 BTC that sends prizes of 0.5 BTC to ten winners of their monthly competition. There ...


2

If by seed you are referring to a mnemonic phrase (12 or 24 words is common) then the process goes something like this: The phrase is hashed (or some other process) to produce random or pseudorandom bytes we will call the "seed" The byte array seed is passed into BIP32 HD master key algorithm to create a BIP32 master key. Following a standard like BIP44, ...


2

Creating individualized addresses for each user is the best course of action, it is what the vast majority of services do. Using a BIP 32/44/49/84 HD wallet, you can derive individualized deposit addresses for each user, in a way that is easy to manage through your backend. Making a single deposit address not only makes it difficult to differentiate ...


2

Is it safe to only give them the option of receiving to a "compatibility" address? Yes. All modern wallet software understand P2SH and can create transactions that send to such addresses.


2

Your address 32feVAD9Haq1CtfT6JCLTt4L5qef3UnVpY is a P2SH mainnet address, with a 05 address prefix and represents the base58 encoding of the following data: [05][20-byte hash][4-byte checksum] So, the [05] prefix tells your wallet that your address represents a P2SH embedded script presage (20B). On the other hand, a [00] prefix tells your wallet that ...


2

A wallet.dat file will contain many, many bitcoin keypairs/addresses. So there is no reason to delete an older address, and in fact this is probably a bad idea. If you or anyone else ever mistakenly sends bitcoins to that address, it will be impossible to recover them once you've deleted those keys. If you do not have the private key for an address, you ...


2

When a Bitcoin transaction is created, unspent transaction outputs (UTXOs) are used in the inputs of the transaction. Your wallet will use as many UTXOs (and therefore create as many inputs) as necessary to achieve the value you're trying to send in your transaction. UTXOs have to be spent completely, so most likely the total value achieved by the sum of ...


2

This is gossip protocol. When you are connected to the bitcoin network, you are usually connected to some random nodes. When you want to send transaction, ultimately your goal is for the transaction to appear in a block. The blocks are created by miners who operate few network nodes. Usually you don't even know which nodes belong to such miners. Therefore ...


2

These are not public keys. Not everything that is 33 bytes is a public key. In this case, it is a 32 byte hash. The first byte indicates that the next 32 bytes are to be pushed to the stack. So the result is that the actual data in this scriptPubKey is a 32 byte string. In this case, this particular transaction is a coinbase transaction in a block mined by ...


2

What you can spend, and what you can send to depends on the wallet software and nothing else. There are no inherent restrictions on any combination. In case someone uses old software, they may not be able to send to bech32 addresses. But they'll get an error that the software doesn't recognize the address; no funds will be lost.


2

Perhaps you're confused by the phrasing "the wallet", as it's only the receiver's wallet who needs to know the public key, and he has it, because he created the address in the first place. In what follows, I'm going to assume a standard 1... address (pay to pubkey hash). That's not the only type of address, but similar ressonings apply to every type of ...


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