Title: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: nullius on December 29, 2017, 09:54:59 PM I have released an initial version of the bech32(1) utility (https://github.com/nym-zone/bech32) for encoding and decoding of BIP 173 (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) Bech32 strings and Bitcoin “Bravo Charlie Addresses” (https://bitcointalk.org/index.php?topic=2646007.0) (“bc1”). As any worthwhile software, it comes replete with a manpage (https://github.com/nym-zone/bech32/blob/master/bech32.1.md) (text (https://raw.githubusercontent.com/nym-zone/bech32/master/bech32.1.txt)), q.v.
As part of its initial feature set, bech32(1) has special handling for RFC 7686 (https://tools.ietf.org/html/rfc7686) .onion special-use domain names; it detects such a name, and transcodes the RFC 4648 (https://tools.ietf.org/html/rfc4648) Base32 to and from Bech32 with an HRP of “onion”. For Bitcoin “Bravo Charlie” addresses, bech32(1) takes and gives the witness version and the hexadecimal-coded octets of the witness program. Otherwise, for the most part, it encodes and decodes hexadecimal data with user-provided HRPs. I intend to add special interpretation of “pgp1” with a concept I call “PGP Descriptors”; but I need to spec that out first. Some usage examples from the manpage: Code: Extract the witness version and Hash160 from the bech32 utility author's Licensing includes a Bitcoin Consensus Clause (https://bitcointalk.org/index.php?topic=2664669.0), to prevent use by scamcoin pretenders. This is an alpha-quality initial release. The code is still a bit messy; it needs test vectors, which seem insufficiently specified; features and the finer details of behaviour may be a bit in flux. However, the basic user interface should be considered stable. I am here opening a Bitcoin Forum thread for discussion of this utility; over time, I will edit and update this post as appropriate. Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: Andre_Goldman on December 30, 2017, 10:17:09 PM I have released an initial version of the bech32(1) utility (https://github.com/nym-zone/bech32) for encoding and decoding of BIP 173 (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) Bech32 strings and Bitcoin “Bravo Charlie Addresses” (https://bitcointalk.org/index.php?topic=2646007.0) (“bc1”). As any worthwhile software, it comes replete with a manpage (https://github.com/nym-zone/bech32/blob/master/bech32.1.md) (text (https://raw.githubusercontent.com/nym-zone/bech32/master/bech32.1.txt)), q.v. As part of its initial feature set, bech32(1) has special handling for RFC 7686 (https://tools.ietf.org/html/rfc7686) .onion special-use domain names; it detects such a name, and transcodes the RFC 4648 (https://tools.ietf.org/html/rfc4648) Base32 to and from Bech32 with an HRP of “onion”. For Bitcoin “Bravo Charlie” addresses, bech32(1) takes and gives the witness version and the hexadecimal-coded octets of the witness program. Otherwise, for the most part, it encodes and decodes hexadecimal data with user-provided HRPs. I intend to add special interpretation of “pgp1” with a concept I call “PGP Descriptors”; but I need to spec that out first. Some usage examples from the manpage: Code: Extract the witness version and Hash160 from the bech32 utility author's Licensing includes a Bitcoin Consensus Clause (https://bitcointalk.org/index.php?topic=2664669.0), to prevent use by scamcoin pretenders. This is an alpha-quality initial release. The code is still a bit messy; it needs test vectors, which seem insufficiently specified; features and the finer details of behaviour may be a bit in flux. However, the basic user interface should be considered stable. I am here opening a Bitcoin Forum thread for discussion of this utility; over time, I will edit and update this post as appropriate. Quote MODE_ONION_ENCODE Thanks for that. 8) btw I notice that others well-known web sites (such as uj3wazyk5u4hnvtk.onion ) already get updated :P Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: nullius on December 31, 2017, 01:07:25 AM Quote MODE_ONION_ENCODE Thanks for that. 8) btw I notice that others well-known web sites (such as uj3wazyk5u4hnvtk.onion ) already get updated :P Well, thanks for looking at my source code! At least at the top of the main .c file. And yes, all strings with a suffix of “.onion” are automagically detected. The bech32(1) tool does not know about any specific .onion sites, although I had to pick one for a manpage example. If you like this particular feature, then you will be pleased to see the proposal I just made on tor-dev: https://lists.torproject.org/pipermail/tor-dev/2017-December/012743.html Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: nullius on January 02, 2018, 06:18:25 AM Edit: 404 from Github apparently resolved by support. It appears that you can access my repositories now; please tell me if you have any problems.
Quote from: Jimmy (GitHub Staff) Sorry about that. Sometimes our spam-detecting systems miss the mark and you were accidentally flagged in the process. I've gone ahead and removed the flag and you shouldn't see that message again. I’ve requested further info, in hope that I could avoid this happening ever again. I will edit or post with further info, if and as appropriate. Regardless—if things are indeed working now, I apologize to the forum for the noise. You may well understand how I reacted when I saw my public source code repositories suddenly go 404. Aside, n.b. that I habitually PGP-sign my commits using the ECC key with fingerprint 0xC2E91CD74A4C57A105F6C21B5A00591B2F307E0C. Notice: The Github repositories for easyseed(1) (https://bitcointalk.org/index.php?topic=2664861.0) and bech32(1) (https://bitcointalk.org/index.php?topic=2664728.0) have suddenly gone 404. Little remains of me on Github but for my open pull request to the BIP repository (https://github.com/bitcoin/bips/pull/622) (archive.org (https://web.archive.org/web/20180102060935/https://github.com/bitcoin/bips/pull/622), archive.is (https://archive.is/heUvJ)). https://user-images.githubusercontent.com/33915087/34474820-6539127c-ef7c-11e7-96dc-b8478b475314.png I saw that, before I saw this: https://user-images.githubusercontent.com/33915087/34474941-ffa49fc4-ef7d-11e7-8c9c-e87fa7c498ae.png Here is the message I sent to Github support via their web form after I saw the latter: Code: -----BEGIN PGP SIGNED MESSAGE----- The text of my prior message, which I had saved before sending (that’s my habit on the forum, too!): Quote Subject: 404 on my profile and projects! In a non-logged-in browser, I am receiving a 404 “Page not found” error for my own profile and projects! In a logged-in browser, I can see my profile and projects; but a project with 10 total open/closed issues shows 0 issues, total. ![github_404ed_nym-zone](https://user-images.githubusercontent.com/33915087/34474820-6539127c-ef7c-11e7-96dc-b8478b475314.png) - 404: https://github.com/nym-zone - 404: My projects pages, under that URL I checked status.github.com “All systems reporting at 100%”) and the @githubstatus Twitter feed (last update 2017-11-27, “Everything operating normally.”). Please fix this. Thanks. nullius@nym.zone And just when I’d been contemplating my next improvements and little projects.... Persons interested in my code are invited to contact me directly, via e-mail (preferred) or PM. However this resolves, I will also must needs seek more reliable means of publishing my source code. Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: nullius on January 04, 2018, 01:00:19 PM <2> Regards to Bech32 I am trying to compile it on Visual Studio 2017 community edition using c +1+(https://i.imgur.com/yo5J4Q6.jpg (https://i.imgur.com/yo5J4Q6.jpg) jargon ... hang on (I am running out time) going to ed; this post again ... So I am not sure if it going to compile or not ...since there are some barvarian char set and maybe I only will see the out put at Oktoberfest. (pls relax this is a joke, when we'serious we ARE serious) I think that this should probably work, mostly. For its “user interface”, the utility uses POSIX getopt(3) functionality, and also the BSD-style <err.h> (also available on Linux). I don’t know to deal with that on Windows. Otherwise, it is just STDC. I myself can’t test MSVC compilation; for I have no Windows in my house. Please let me know what results you get. Should there be indicators of demand, I may try to produce Windows binaries with mingw. If you need to replace anything with code from WIN32, I strongly suggest that you #define WIN32_LEAN_AND_MEAN. I seem to vaguely also remember some define for Unicode, but I don’t remember what it is. If somebody comes up with Windows/MSVC compat code, I may try to abstract that into a separate file. I will not clutter main files with #ifdefed Windows code, or Windows “decorations”; I was recently trying to audit a simple cross-platform library where every function is “decorated” with DLLEXPORT, and that junk makes code unreadable. Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: Andre_Goldman on January 05, 2018, 02:29:56 AM <2> Regards to Bech32 I am trying to compile it on Visual Studio 2017 community edition using c +1+(https://i.imgur.com/yo5J4Q6.jpg (https://i.imgur.com/yo5J4Q6.jpg) jargon ... hang on (I am running out time) going to ed; this post again ... So I am not sure if it going to compile or not ...since there are some barvarian char set and maybe I only will see the out put at Oktoberfest. (pls relax this is a joke, when we'serious we ARE serious) I think that this should probably work, mostly. For its “user interface”, the utility uses POSIX getopt(3) functionality, and also the BSD-style <err.h> (also available on Linux). I don’t know to deal with that on Windows. Otherwise, it is just STDC. I myself can’t test MSVC compilation; for I have no Windows in my house. Please let me know what results you get. Should there be indicators of demand, I may try to produce Windows binaries with mingw. If you need to replace anything with code from WIN32, I strongly suggest that you #define WIN32_LEAN_AND_MEAN. I seem to vaguely also remember some define for Unicode, but I don’t remember what it is. If somebody comes up with Windows/MSVC compat code, I may try to abstract that into a separate file. I will not clutter main files with #ifdefed Windows code, or Windows “decorations”; I was recently trying to audit a simple cross-platform library where every function is “decorated” with DLLEXPORT, and that junk makes code unreadable. Thanks nullius, Definitely I will try MSVC compilation and I will let you know the results I get. But, ( as my usual academic methodology ) firstly, I need to do a research on system development history. For instance, I know that Microsoft POSIX subsystem (https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem) is old as Windows NT Kernel ( ). ( I don't know, in my memory Microsoft's Unix reminds me Xenix (https://en.wikipedia.org/wiki/Xenix). Also regards to cryptology and Redmond campus... in general I find a pleasure reading Niels Ferguson, Bruce, and Kohno book ISBN: 978-0470474242 ps-> Nice to see that your *nix flavour is BSD Group ;-) Most of the time I have really nice experience on SDF Public Access UNIX System .. Est. 1987 ... https://i.imgur.com/nsKb5h9.png Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: Andre_Goldman on January 06, 2018, 09:53:27 PM Today ( 1515275048210391 ) I moved some steps ahead ...
I cloned the source and as usual I started read the .txt file ( https://raw.githubusercontent.com/nym-zone/bech32/master/bech32.1.txt ) which tells me what the utility/function does) then I will read the LICENCE terms. https://i.imgur.com/gV5mNd8.png btw, Thinking about Bravo-C it came to my mind ... ;D Quote Date: Fri, 29 Dec 2017 04:24:59 GMT From: SDF Amateur Radio Club <sdfarc@sdf.org> Subject: SDF Amateur Radio Club! This message is for SDFers who are interested in Amateur Radio. The SDFARC is open to all people interested in Amateur Radio. Many club activities are for licensed operators, but new comers are welcome. Some quick notes: * Our website: http://sdfarc.org * Our weekly NET is held on ECHOLINK node 9424 (AB9FJ) Mondays at 0000 UTC * Our mailing list is sdfarc-l@sdf.org If you want to get on our mailing list, simply send "subscribe sdfarc-l" in an email to majordomo@sdf.org We currently have about 50 members scattered all over the world. Because of this, it makes for a very unique club. We're interested in discussing ideas such as HamWan, file sharing and other experiemntal digital modes. 73! Kind Regards, see you on monday Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: nullius on January 29, 2018, 11:58:40 PM Today ( 1515275048210391 ) I moved some steps ahead ... Apologies for the delayed reply. Any luck with getting it to compile on your platform? Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: pebwindkraft on January 30, 2018, 03:52:09 PM just stepped through the readme file in the code:
Quote Software is unworthy of release if it does not have a proper manpage. This proves, that you are not only from FreeBSD world, you are probably more from the OpenBSD world! Looking at the code of bitcoin, there are too many people, which say "code is doc". Well, I can even remember a thread here, were Greg M is challenging others in reading code and asking to explain. This might prove him be a genius, but in companies you need team capabilities, not single point of failure knowledge. Reliability, combined with fall back scenarios is required. This is why good code is not only readable, but also documented. Otherwise the world would still be in (Z80 ?) assembler. Appreciating your code distribution, looking at it, and trying to find out, what to do with it. Thanx for posting. Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: nullius on January 30, 2018, 07:33:26 PM just stepped through the readme file in the code: Quote Software is unworthy of release if it does not have a proper manpage. This proves, that you are not only from FreeBSD world, you are probably more from the OpenBSD world! Looking at the code of bitcoin, there are too many people, which say "code is doc". Well, I can even remember a thread here, were Greg M is challenging others in reading code and asking to explain. This might prove him be a genius, but in companies you need team capabilities, not single point of failure knowledge. Reliability, combined with fall back scenarios is required. This is why good code is not only readable, but also documented. Otherwise the world would still be in (Z80 ?) assembler. Thanks, pebwindkraft. Why yes, I think all the major BSDs have a strong manpage culture. I myself have much benefitted from that, and I have been inculcuated with it along the way. I was there speaking to my annoyance at code only “documented” by wikis, webpages, or (for libraries) the output of Doxygen. If software lacks reasonably complete usage documentation which can be quickly referenced at the tty by typing `man xxx`, without firing up a web browser or even being online, then that severely impairs its usability. From the producer end, it sometimes occurs that when writing a manpage, I realize that I am documenting a wish for what the program should do, not what it actually does. Then, I change the code to bring it in line with the manpage. This happened repeatedly with easyseed (https://bitcointalk.org/index.php?topic=2664861.0). Different levels of thought are required respectively for writing code, and explaining its external features in natural language. Exercising both improves the code. I do believe that the code itself is a form of documentation; and I love reading well-written C code. For those who wish to modify the code, the code itself documents what it does; and code comments explain why, when that is nonobvious or based on some external specification. Written specifications are certainly needed for that teamwork you mention; and I judge specifications based on whether or not I need to refer to existing code to implement from spec. The manpage is most of all for those who wish to use the results; and ultimately, it is the results that count. Appreciating your code distribution, looking at it, and trying to find out, what to do with it. Thanx for posting. I hope that you find this utility useful for your Bech32 encoding needs. Please don’t hesitate to inquire with any questions or suggestions. Title: Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses Post by: denifednu on December 22, 2018, 11:55:15 PM Thanks very much for this!
fyi, I'm using it to generate BIP84/P2WPKH addresses from privatekeys for bitcoin, e.g.: Code: $ KEY="L2QQ7BHxpTwvi68BS9BcARM3W6UUbiJcLeUVnCcJ2wNLebGBwgHB" Code: $ echo ${KEY} | bx wif-to-public | bx bitcoin160 | bech32 -s 0 - |