-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
address: Address type and encoding #55
Conversation
Looks like the issue is that this one is empty? There's also a slight quirk w/ how things are: with the family key we store the raw key, but only serialize the tweaked key. We'll likely need to make a custom comparison function. |
Seems like addresses should be including only the tweaked key? That's the only part of the FamilyKey struct i imagine would be public or relevant for receiver addresses. |
) | ||
} | ||
|
||
func NewAddressScriptKeyRecord(scriptKey *btcec.PublicKey) tlv.Record { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So FWIW, we already have some encode/decode methods for things like these in the existing asset
package. I think the only reason not to use those, is if we end up w/ some weird import cycle down the line.
Here's the fix I needed to throw in the proof PR to get the tests passing again: 74cc870#diff-0444dc75ab5f91d776dfc97ff7a8de031c33a2a5c25c0a488b4896ba617b53aaR159 The issue is we have a field in the |
Updating coming later today then JHB needs review |
Updated to address feedback, use a Taro-specific params struct for handling address HRP, and fix the PubKey encode/decode bug. Unsure if having this private schnorrPubKeyEncode/Decode is the best option; I imagine we'd want to use this elsewhere. Could adjust naming to better distinguish from the version in the asset package. |
Yeah I think ultimately we'll aggregate these into some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍬
Split from #43. Adds tests.
Currently have a test failure for the TLV encode + decode round trip, with the ScriptKey and InternalKey fields. I think it's related to those fields being pubkey values and not pointers, but not sure.
Fixes #15