Skip to content

Conversation

@apoelstra
Copy link
Member

@apoelstra apoelstra commented Aug 5, 2021

Includes backports of bitcoin/bitcoin#20832 (1 commit) and bitcoin/bitcoin#20861 (5 commits)

@real-or-random
Copy link
Contributor

I'm late to the party but I still think "blech" is a bad name because it means "(metal) sheet" in Germany and is associated with cheap metal and often has a negative connotation (e.g., sometimes people ironically call the worthless fourth place in a competition "Blech", i.e., you missed the gold/silver/bronze medals.)

@apoelstra
Copy link
Member Author

It was something of a joke, because it also has a negative connotation in English (it's basically a gross sound you might make, e.g. see this picture of Bill the Cat from Bloom County)

src/blech32.cpp Outdated
// resulting checksum to be 1 instead.
return PolyMod(Cat(ExpandHRP(hrp), values)) == 1;
// list of values would result in a new valid list. For that reason, Bech32 requires the
// resulting checksum to be 1 instead. In Bech32m, this constant was amended.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Bech->Blech on this line and above (but it doesn't really matter.)

src/blech32.cpp Outdated
return ret;
}

/** Decode a Blech32 string. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missed comment change ("Blech32" -> "Blech32 or Blech32m")

src/blech32.h Outdated
BLECH32M, //!< Blech32m tweaked a la bech32
};

/** Encode a Bech32 string. Returns the empty string in case of failure. */
Copy link
Contributor

@gwillen gwillen Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Bech->Blech.

(Upstream has a longer comment here, but this was already true before this change -- I don't know if it's untrue for us for some reason. Converted for our use it would be:

/** Encode a Blech32 or Blech32m string. If hrp contains uppercase characters, this will cause an
 *  assertion error. Encoding must be one of BLECH32 or BLECH32M. */

)

Bezdrighin and others added 6 commits August 17, 2021 22:32
This commit addresses #20809.

We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.

bitcoin/bitcoin#20832 (1/1)

ELEMENTS: Merge conflicts resolved based on d6c85c5 (from 22.0 rebase)
This also includes updates to the Python test framework implementation,
test vectors, and release notes.

bitcoin/bitcoin#20861 (3/5)
@gwillen
Copy link
Contributor

gwillen commented Aug 18, 2021

FYI, It would hard for me to catch any blech32-specific stuff around blinding keys in DecodeDestination, the bit-fiddling is extremely fiddly and doesn't parallel anything in bech32. So maybe double-check that part.

@gwillen
Copy link
Contributor

gwillen commented Aug 18, 2021

Ok, I have checked all the bits that weren't backports, comments above.

@gwillen
Copy link
Contributor

gwillen commented Aug 18, 2021

Checked the cherry-pick of bitcoin/bitcoin#20832 using my usual trick. (Redo it myself, with merge.conflictstyle=diff3, make a temporary commit with the conflict markers, diff against your resolution.) Looks good.

@gwillen
Copy link
Contributor

gwillen commented Aug 18, 2021

Checked the other backport the same way, looks good.

I notice that we removed an anonymous namespace in bech32.h, present in the upstream version, which was hiding some private helper functions. It didn't change in this version, it was already like that, so I'm content to leave it alone; but I'm curious why we did that.

I've now looked at everything, and it's all good other than my comments above.

@apoelstra
Copy link
Member Author

Addressed Glenn's comments and changed the constant as per @roconnor-blockstream's recommendation.

@gwillen
Copy link
Contributor

gwillen commented Aug 24, 2021

utACK c72c949.

@roconnor-blockstream
Copy link
Contributor

LGTM

@apoelstra apoelstra merged commit 6419449 into ElementsProject:master Aug 30, 2021
@apoelstra apoelstra deleted the 2021-08--blech32m branch September 5, 2021 15:39
gwillen pushed a commit that referenced this pull request Jun 1, 2022
Another annoying one to deal with because it includes partial
backports. In future let's really try to stay up to date with
Core.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants