Published on: 2012-01-27T18:19:54+00:00
A user named Brautigam Róbert encountered an issue with BouncyCastle while verifying a signature. Dave Hook from Bouncycastle explained that one of the ASN1 encoded integers in the signature was negative, which is not valid for a point on a curve. To fix this, the integer needs to be converted to a positive value by padding it with a zero byte. Both the official C++ client and the bitcoinj implementation use BouncyCastle, but the latter fails to verify the transaction, suggesting a potential issue with BouncyCastle.Mike Hearn and Robert discuss the discrepancy between the official client and Bitcoinj's verification of a transaction. Robert clarifies that Bitcoinj is an SPV implementation and does not actually verify signatures. However, he tests the mentioned transaction's signature using hardwired code and data obtained from debugging the official client. He notes that all previous transactions work correctly, indicating that the data and test code are likely correct. Despite using an older version of bitcoinj, Robert doubts that it would affect ECC verification. He requests someone else to independently verify the transaction using BouncyCastle and openssl to see if they encounter the same issue. Robert tried both BouncyCastle 140 and the newest 1.46 versions, but both failed.In summary, the official Bitcoin client successfully verifies a transaction, while the Bitcoinj implementation fails to do so. This suggests a potential problem with BouncyCastle, which is used by both implementations. It is important to note that Bitcoinj is an SPV implementation and does not verify signatures. A developer working on a Java implementation of Bitcoin reports that the signature verification fails for a specific transaction, even though it was successful for all preceding transactions. The developer suspects that the issue may be related to BouncyCastle and requests assistance in double-checking their code.
Updated on: 2023-08-01T02:53:56.214072+00:00