Skip to content
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

Offers: Part 1, Spec import and basic infrastructure #4255

Merged
merged 13 commits into from
Dec 9, 2020

Conversation

rustyrussell
Copy link
Contributor

@rustyrussell rustyrussell commented Dec 4, 2020

BOLT 12 import, and various helpers to support that (offers, invoice_request, invoice) including signing infrastructure.

Almost all is EXPERIMENTAL_FEATURES, though we'll probably move to a runtime option before release.

Changelog-None

@PapauloGamerOfc
Copy link
Contributor

The Travis CI bot is failing on every PR!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is a bridge for offers which use x-only pubkeys, and the current
code which doesn't.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
BOLT 12 introduces this as a new fundamental type, which lets us easily
validate them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…sage.

Offers don't use the checksum, as they're signed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the offers-part1 branch 2 times, most recently from 896bfa8 to 4021701 Compare December 7, 2020 03:42
Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

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

Very nice PR, just some minor clarifications :-)

ACK 4021701

@@ -348,3 +348,15 @@ void towire_bitcoin_signature(u8 **pptr, const struct bitcoin_signature *sig)
towire_secp256k1_ecdsa_signature(pptr, &sig->s);
towire_u8(pptr, sig->sighash_type);
}

void towire_bip340sig(u8 **pptr, const struct bip340sig *bip340sig)
Copy link
Member

Choose a reason for hiding this comment

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

Why not call this with something more memorable? I personally find referencing by BIP number confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the name I used in the spec. I can change both, but we called the previous type signature so I need something distinct from that.

Comment on lines +37 to +41
num_chains = tal_count(chains);
if (num_chains == 0) {
num_chains = 1;
chains = &chainparams_for_network("bitcoin")->genesis_blockhash;
}
Copy link
Member

Choose a reason for hiding this comment

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

Could this lead to a leak?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it points into a static array.

common/bolt12.c Outdated
Comment on lines 64 to 66
int badf;

badf = features_unsupported(our_features, features,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: merge these lines or move int badf to top.

…voice

Note the collapse of '+\s*' and the test cases from the spec.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
For inclusion in the onion as a reply path.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell
Copy link
Contributor Author

Trivial change to make int badf; badf = ... into int badf = ....

@rustyrussell rustyrussell merged commit 86176e8 into ElementsProject:master Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants