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

Blinded payments spec update and infrastructure for forwarding #5646

Merged

Conversation

rustyrussell
Copy link
Contributor

This does a pile of updates:

  • Remove x-only pubkeys from offers.
  • Update onion message and blinded payments to latest spec
  • Implement forwarding of blinded payments

This PR does not include:

  • Generating and actually paying invoices with blinded payments
  • All the offers changes after removing x-only pubkeys.

@rustyrussell rustyrussell added the protocol These issues are protocol level issues that should be discussed on the protocol spec repo label Oct 4, 2022
@rustyrussell rustyrussell added this to the v22.11 milestone Oct 4, 2022
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.

Only got as far as bd75295 for now, but wanted to start discussing the hsm_wire changes so we can avoid breaking last minute merges that could cause VLS and hsmd incompatibility.

common/gossmap.c Outdated Show resolved Hide resolved
hsmd/hsmd_wire.csv Show resolved Hide resolved
@cdecker
Copy link
Member

cdecker commented Oct 11, 2022

ACK df9cc4a

common/blindedpath.h Outdated Show resolved Hide resolved
common/features.c Show resolved Hide resolved
common/onion.c Outdated Show resolved Hide resolved
@cdecker
Copy link
Member

cdecker commented Oct 11, 2022

There seems to be a BOLT-quote mismatch somewhere:

2022-10-06T05:55:25.5455402Z common/blindedpay.c:20:mismatch:		/* BOLT #4:
2022-10-06T05:55:25.5470757Z Closest match: - For every node...[: - MUST include `am]
2022-10-06T05:55:25.5484524Z make: *** [Makefile:502: bolt-check/common/blindedpay.c] Error 1

With the rise of external HSMs like VLS, this is no longer an
internal-only API.  Fortunately, it doesn't change very fast so
maintenance should not be a huge burden.

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

Otherwise I know we'll miss it.  Simply check for a mention: we could well
change things multiple times within a single release.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We still use 32 bytes on the wire, but internally don't use x-only.

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

This is the one place where we hand point32 over the wire internally, so
remove it.

This is also our first hsm version change!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It was very tied to x-only keys; we could support it in a backwards
compatibility mode for a while, but getting refunds or proving old
pre-finalization invoices is not worth spending time on.

Changelog-EXPERIMENTAL: offers: old `payer_key` proofs won't work.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This removes a point32 dependency.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Most things don't want them, so don't link it into everything by default.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It's 2b7ad577d7a790b302bd1aa044b22c809c76e49d, which reverts the
point32 changes.

It also restores send_invoice in `invoice`, which we had removed
from spec and put into the recurrence patch.

I originally had implemented compatibility, but other changes
which followed this are far too widespread.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: offers: complete rework of spec from other teams (yay!) breaks previous compatibility (boo!)
…aths.

We need to print out first_node_id, and "node_id" is now called
"blinded_node_id" in the spec.

And the schema didn't include the payment fields in the blinded path
for invoices (which broke as soon as we actually tested one!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
The x-only dream is dead.  Remove all trace.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is as of commit aed5518a80aade56218da87f92e0a39963b660cf

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…g test for new vectors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It's a premature optimization, and it make modifications more complex.

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

Yep, fixed: this is actually a quote from the route-blinding branch only.

We're going to share them for onion messages as well as for blinded
payments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We don't set it, but we know how to now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We make it look like a normal payment for the caller.

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>
Don't shoehorn it into onion_nonfinal_hop() and onion_final_hop(), but
provide an explicit routine "blinded_onion_hops" and an onion helper
"onion_blinded_hop()" for it to call.

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

Gate it (where necessary) by the route-blinding feature bit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Mainly, field name changes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: Protocol: Support for forwarding blinded payments (as per latest draft)
Instead of open coding in connectd/onion_message, we move it to common
with a nice API.

This lets us process the BOLT test vectors.

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

Trivial rebase on master, those simple typo fixes, and added (as first two commits) a new API system for hsmd_wire.csv

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
And add it as a requirement to the test programs!

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

Ack 4c25d7c

Since @cdecker approved and I need to get moving on the next PR :)

@rustyrussell rustyrussell merged commit f158b52 into ElementsProject:master Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protocol These issues are protocol level issues that should be discussed on the protocol spec repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants