From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 26E67135E for ; Wed, 13 Jun 2018 02:44:50 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ot0-f178.google.com (mail-ot0-f178.google.com [74.125.82.178]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 92846326 for ; Wed, 13 Jun 2018 02:44:49 +0000 (UTC) Received: by mail-ot0-f178.google.com with SMTP id w13-v6so1232344ote.11 for ; Tue, 12 Jun 2018 19:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XwvkSgxlRUIMb69qGNmL90q1BYYjzhSVNJrhvE2l68Y=; b=JJDL7xopkiObZdkxObJQz+sFp9Xr+hcnabO7T1qa541JlQUELarpf3phoxMk/LIBVu 1ioP73342ibzwipx1iRAjcdLPesxTyWLROh8RUEgC48sd+P2cL8WKLblHtfV42jW6oGD uQUpyNjStqwJkOsw6kOhBPNc4FqP/a4d5UBF72XBHcy+vhPAR1KPmd+u3i60MJhhwpb7 pUOOefLTp/PcSECprKwXPzYtaThXJEV8RsNRe7zVPaSKmBxeSwcVumhQsyCFFo1AEhSh leyk2KWLUTCbMTW5WFpK/BRVF5ke9sQV5KoT1GzbTjHIkEgXkJkN7bIukjYGoJuGhK2z 7IGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XwvkSgxlRUIMb69qGNmL90q1BYYjzhSVNJrhvE2l68Y=; b=DrJOIg/pwKXv2HLEggZ4VjSU2KBwpWz2f1ZckJOWbm7CkeJRfiE0GMYplcStMktGvV 1+3ZnTOF5/skIqjQVMlpJblBMAsU8KKrjv9biZ6ObzwLbaemYWzqjXxjQ97mqrlOKctH F1yfmNgX6AxmkdBjhZAZpZZN5QNUjY9lOIEmtKtJ/gQRd9+5x6DeMrnh/vE7X25GAbGe jEScwqo3unF7ptXUp8m76JcSul6atE0yaIONEIyPjHT0GoHw6lGHAAYXEBJRqUjCssCw U63VYejgt0s5E1AKybJ2ubCYJ9HwxTjhMwLtX0eewKgkwTUEDVZqz9G4Z+TagVu/nnCe SXaw== X-Gm-Message-State: APt69E1EFxfntB3T3Qh4ZLnNPIn9O3m2MQxovsvNKwqbkqDNOc/WoIO5 knETUA0Ipu3YmHC96SrdI09dhi3faODTrx7RrUOPYXFO X-Google-Smtp-Source: ADUXVKKvKHTcp+XCHL4J2Vs21vvPbshFchSOPsY+4XIc8qOWsvBg5PMNr07ZAihzmBeiz5DasxwEhgx+2LkN+7sSQLs= X-Received: by 2002:a9d:73d2:: with SMTP id m18-v6mr2048002otk.332.1528857888625; Tue, 12 Jun 2018 19:44:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:6a89:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 19:44:47 -0700 (PDT) In-Reply-To: References: From: Pieter Wuille Date: Tue, 12 Jun 2018 19:44:47 -0700 Message-ID: To: Jonas Schnelli Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] New serialization/encoding format for key material X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 02:44:50 -0000 On Sun, Jun 3, 2018 at 2:30 PM, Jonas Schnelli 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