Test Cases

From BitcoinWiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

Below are listed test cases to be used for checking compliance with the Bitcoin Protocol.

Variables listed in quotation marks are string literals, encoded using the ASCII standard. Variables listed without the quotation marks are numbers or hex dumps.

More tests can be found here:

https://github.com/ThePiachu/Bitcoin-Unit-Tests

Related forum page:

https://bitcointalk.org/index.php?topic=56323

Some testing tools are also available here:

http://gobittest.appspot.com/

Hashes[edit]

SHA-256[edit]

Original First hashing Second hashing
"hello" 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 0x9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50

RIPEMD-160[edit]

Original SHA hashing RIPEMD hashing
"hello" 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 0xb6a9c8c230722b7c748331a8b450f05566dc7d0f

Merkle Trees[edit]

Variable length integer[edit]

Variable length string[edit]

Source[edit]

http://bitcoin.it/

See Also on BitcoinWiki[edit]