Base-32 error correction coding #3713

pull maaku wants to merge 6 commits into bitcoin:master from maaku:ecc32 changing 8 files +1664 −25
  1. maaku commented at 2:39 AM on February 21, 2014: contributor

    Implement error correction codes for base32 strings, using the CRC-5-USB polynomial. The encoder transforms 26-digit rfc-3548 strings into 31-digit z-base-32 strings, which are capable of recovering from any single-digit mutation, are visually distinctive, and protected against a wide variety of human-factor errors in the coding alphabet. Format is described in the following draft BIP:

    https://gist.github.com/maaku/8996338#file-bip-ecc32-mediawiki

  2. Pull out base32 coding tables so that they can be used by other functions. b42a003e77
  3. Add z-base-32 encoding tables and inline helper methods, in addition to the already supported rfc-3548. 69c59f8d32
  4. maaku commented at 3:50 AM on February 21, 2014: contributor

    I'm trying to diagnose why this isn't working on the pull tester - it compiles & runs just fine on Ubuntu 12.04 and Mac OS X 10.9. The function in question is a POSIX standard API.

  5. cozz commented at 12:47 PM on February 21, 2014: contributor
    uint256.h:19:39: error: boost/heap/detail/ilog2.hpp: No such file or directory
    

    Seems like pulltester uses an older version of boost and so doesnt know the heap directory.

  6. Implement error correction codes for base32 strings, using the CRC-5-USB polynomial. The encoder transforms 26-digit rfc-3548 strings into 31-digit z-base-32 strings, which are capable of recovering from any single-digit mutation, are visually distinctive, and protected against a wide variety of human-factor errors in the coding alphabet. 7a0317f352
  7. Add unit tests for base32 error correction codes. f3ac563ce0
  8. Add unit tests demonstrating recovery from transcription errors. 33f9532ec5
  9. Add unit tests for converting to/from base_uint<BITS> and ecc32 values. 865264f3d7
  10. BitcoinPullTester commented at 12:28 AM on February 22, 2014: none

    Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/865264f3d785fb954261e5453707cf706f3de5e8 for binaries and test log.

    This could happen for one of several reasons:

    1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester)
    2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
    3. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
    4. The test suite fails on either Linux i386 or Win32
    5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

    If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.

    This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  11. maaku commented at 12:43 AM on February 22, 2014: contributor

    @TheBlueMatt I'm not sure why this failed. It looks like the unit tests compiled and ran just fine...

  12. laanwj commented at 7:27 AM on February 22, 2014: member

    Looks like it failed on a timeout. Probably a fluke in the pull tester environment.

  13. gavinandresen commented at 8:30 PM on February 28, 2014: contributor

    NACK from me-- 1,600 new lines of code for a "don't care" feature. Users should not be typing in or copying and pasting base32 strings anytime, anywhere-- if they are, then we have failed to design a usable system.

  14. rebroad commented at 11:06 PM on February 28, 2014: contributor

    @maaku When/where is it you envisage that users will be manually typing in base32 strings?

  15. maaku commented at 11:09 PM on February 28, 2014: contributor

    When do people deal with long data strings in bitcoin already? Addresses, private keys/wallet backups, transaction identifiers.

    EDIT: In some cases we can legitimately get rid of the need to manually input information. E.g. the payment protocol should reduce the need to input addresses most of the time. But it can't be turtles all the way down - at some point you have to save/restore a few hundred bits of binary data.

  16. sipa commented at 1:46 AM on March 1, 2014: member

    I agree with gavin here. Much as I prefer base32 over base58, and appreciate actual error correction code over hacky truncated double-SHA256, I believe we shouldn't encourage or develop features to make these cryptographic strings more human-usable, and we should focus on protocols that don't require humans even seeing these.

    If I'd design Bitcoin today, and there was a need for some encoding for cryptographic material, I'd certainly vote for something like this, though.

  17. int03h commented at 2:53 AM on March 1, 2014: none

    have you tried to import a priv key into the various services ? ( I am not fighting with anyone here ) especially not SIPA.

    It is random .. honestly some of them are base 58 with spaces some are hex and others are WHO KNOWS ..

    I am not going to point out the variations and who do does what but it annoying.

    I use blockchain, coinbase and armory .. and none of them seem to have a standard for privkey import export. ( paper wallets aside - I believe that is HEX encodes and compressed - but I havent looked at the code to see why they work always and others dont.

  18. laanwj commented at 8:40 AM on March 1, 2014: member

    @int03h There is a standard wallet import/output format, implemented in master as importwallet and dumpwallet. Not sure where it's documented, but it's too late to switch the private key representations now. In my experience all software supports at least the base58-based bitcoind importprivkey/dumpprivkey format for individual keys.

    Agreed that if bitcoin was designed today I'd vote for anything but Base58. However that ship has sailed.

  19. int03h commented at 5:18 PM on March 1, 2014: none

    venting more than anything ;) .. It's gotten my heart racing more than once. OMG OMG I lost my coins .. OMG ! :) There are always paper wallets so its not tragic.

  20. laanwj commented at 12:15 PM on April 4, 2014: member

    Closing this, I think the implementation is solid but this functionality should only be added if there is an immediate application.

  21. laanwj closed this on Apr 4, 2014

  22. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me