Tell me more ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

Are there any special tests (test data) I should run against my code if I've written a Base58Checked encoder/decoder?

share|improve this question
Hi makerofthings7, I think this question is on-topic, but you need to clarify what specifically the test data is supposed to do (validate your implementation? performance test it? etc.). Otherwise there aren't any real concrete answers (what this site is designed for), only opinions (which this site is not designed for). – eMansipater Feb 8 at 5:58

closed as off topic by cdecker, Dr.Haribo, eMansipater, Stéphane Gimenez, David Perry Mar 19 at 20:59

Questions on Bitcoin Stack Exchange are expected to relate to Bitcoin within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

up vote 1 down vote accepted

I'm using BigInteger in .NET so these tests are unique to this scenario but may be adapted to Java or other languages.

The tests I've found helpful is when translating to or from hexadecimal at any intermediate step make sure the data is correct when:

  • The first or last byte of the checksum is one or more 0's
  • The first or last byte of the address is one or more 0's

Often times this may cause two's compliment errors depending on the implementation of BigInteger that is being used.

I'll run my own version of vanity gen to generate addresses that have these errors and will post them here.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.