11 votes

Why does the TXID have 256 bits when Bitcoin's address security is 160-bit?

Security levels First of all, the relation between security level and the number of bits involved is non-trivial, and depends on the sort of attack we're talking about. For what follows, there are ...
Pieter Wuille's user avatar
6 votes
Accepted

Is there any known 80-bit collision attack?

is there any known instance of attack in practice ? No. In cryptography, we try to stop using constructions/protocols long before they're realistic to perform. And while no 80-bit collision attack is ...
Pieter Wuille's user avatar
3 votes
Accepted

SHA256 vs RIPEMD160 in SegWit

The P2WPKH actually uses the HASH160 hashing algorithm, which is just RIPEMD160(SHA256(pubkey)). The reason for using SHA256 is mentioned in BIP141: The increased size improves security against ...
JBaczuk's user avatar
  • 7,388
3 votes
Accepted

Baffled by endianness: How do I compute the HASH160 of the public key of a base58 address?

There should be no endianness issues here at all. Bitcoin's handing of endianness is sometimes weird in its human interfaces (e.g. transaction and block hashes are printed in reverse order, because ...
Pieter Wuille's user avatar
3 votes
Accepted

RIPEMD 160 Hashes

These are probably "proof of burn" addresses. The corresponding private key is unknown. If the private key was known, the public key hash would look much more random. By creating a non-...
user253751's user avatar
2 votes

SHA256 vs RIPEMD160 in SegWit

As the protocol is upgraded with soft-forks changing script interpreter behaviour, the script-machine is extended with additional runs. Each new upgrade brings a new script run with new rules, whilst ...
James C.'s user avatar
  • 2,511
2 votes
Accepted

Bitcoin RIPEMD160 purpose

RIPEMD160 was designed in the open academic community and not like SHA2 by a NSA competition... one may see this as security advantage. 160bit hashes do also have less space requirements (then sha256)...
Jonas Schnelli's user avatar
2 votes
Accepted

Two addresses with same hash160?

1AcJanbHGrBFwS3KJMDW8kEZMtHiJhatzE is a P2PKH (pay to pubkey hash) address. 3BJKWL5ipkVe2bjkRSt6ZNbVWQaRrEFjMs is a P2SH (pay to script hash) address. Their only difference is in the version byte that ...
Pieter Wuille's user avatar
1 vote

Do we pay cheaper fees for less security in P2TR rather than P2PKH?

No, there isn't less (weaker) cryptographic security in P2TR- than P2PKH-type of UTXO (or locking script). As a matter of fact, there are improvements and (useless) complexity removed (to some extent)....
Greg Tonoski's user avatar
1 vote
Accepted

Convert between String/Hex/Byte in Java for sha256 - wrong format?

Ok, here is the plain code for conversion from legacy to segwit: String addressToConvert = "1BGJEft81aaudqaCCcNnhsRQBA3Y96KYtx"; byte[] decoded = org.bitcoinj.core.Utils.parseAsHexOrBase58(...
Sovan's user avatar
  • 146
1 vote

Convert between String/Hex/Byte in Java for sha256 - wrong format?

Address is in Base58 format. So, if you want to fet hex representation, you should firstly convert base58-address string to byte array and then convert it to hex string. bitcoinJ library has utilities ...
Sovan's user avatar
  • 146
1 vote

Convert between String/Hex/Byte in Java for sha256 - wrong format?

I have not the Java solution, but I can indicate the error. The conversion to hex is apparently missing. When I do the hash on the text file itself, I also get the wrong result: $ printf ...
pebwindkraft's user avatar
  • 5,086
1 vote

Convert list of BTC address(base58) to Ripemd16(base16)

In Go, you can do this very easily: package main import ( "fmt" "github.com/btcsuite/btcutil/base58" ) var addresses = []string{ "1Nh7uHdvY6fNwtQtM1G5EZAFPLC33B59rB", "...
Steven Roose's user avatar
  • 11.8k

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