[bitcoin-dev] New serialization/encoding format for key material
Pieter Wuille
pieter.wuille at gmail.com
Wed Jun 13 02:44:47 UTC 2018
On Sun, Jun 3, 2018 at 2:30 PM, Jonas Schnelli <dev at jonasschnelli.ch> wrote:
>> If there is interest, I can construct a code + implementation for any
>> of these in a few days probably, once the requirements are clear.
>
> Yes. Please.
Here is an example BCH code for base32 data which adds 27 checksum
characters, and can correct up to 7 errors occurring in strings up to
length 1023 (including the checksum characters themselves):
https://gist.github.com/sipa/d62f94faa1dcfd9ee4012d4c88955ba6
It can encode sequences of integers (between 0 and 31):
ref.py encode 13 7 22 23 11 29 21 15 3 26 20 26 4 7 6 11 19 1 6 8 31 13 4 19
> d8khta40r656y8xtnpxgldyne96vsfr83uch908se82g98rmnaa
Decode it again:
ref.py decode d8khta40r656y8xtnpxgldyne96vsfr83uch908se82g98rmnaa
> Decoded: 13 7 22 23 11 29 21 15 3 26 20 26 4 7 6 11 19 1 6 8 31 13 4 19
Or correct errors:
ref.py decode d8khta50r656y8xtmpxhlcyne96vsfr84udh908se82g98rmnat
> Errors found: d8khta?0r656y8xt?px?l?yne96vsfr8?u?h908se82g98rmna?
> Correction: d8khta40r656y8xtnpxgldyne96vsfr83uch908se82g98rmnaa
> Decoded: 13 7 22 23 11 29 21 15 3 26 20 26 4 7 6 11 19 1 6 8 31 13 4 19
The code above is just a randomly picked BCH code, and has no special
properties beyond the ones it is designed for.
I can easily generate similar code for BCH codes with different properties.
Cheers,
--
Pieter
More information about the bitcoin-dev
mailing list