{"action":"created","comment":{"url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/comments/310636511","pull_request_review_id":270808215,"id":310636511,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxMDYzNjUxMQ==","diff_hunk":"@@ -269,7 +272,81 @@ The writer:\n The reader:\n   - MUST return an error if `amt_to_forward` or `outgoing_cltv_value` are not present.\n \n-The requirements for the contents of these fields are specified [above](#legacy-hop_data-payload-format).\n+The requirements for the contents of these fields are specified [above](#legacy-hop_data-payload-format)\n+and [below](#basic-multi-part-payments).\n+\n+### Basic Multi-Part Payments\n+\n+If the final node receives an onion packet with the `basic_mpp` field,\n+then the payment MAY be a \"base\" atomic multipath payment.  Such\n+\"base\" atomic multipath payments will use the same `payment_hash` for\n+all paths.\n+\n+The `amt_to_forward` value will be the amount for this partial payment\n+only.  The `basic_mpp` flag is a promise by the ultimate sender that\n+the rest of the payment will follow in succeeding HTLCs; we call these\n+HTLCs, which have the same preimage, an \"HTLC set\".\n+\n+#### Requirements\n+\n+The writer:\n+  - MUST NOT include `basic_mpp` for any non-final node.\n+  - if `basic_mpp` feature was not set in the invoice:\n+    - MUST NOT include `basic_mpp` for the final node.\n+  - otherwise:\n+    - MAY include `basic_mpp` for the final node.\n+    - if it does include `basic_mpp`:\n+      - MAY send more than one HTLC to pay the invoice.\n+      - MUST use the same `payment_preimage` on all HTLCs in the set.\n+      - MUST set `total_msat` to the amount it wishes to pay.\n+      - SHOULD send all payments at approximately the same time.\n+      - SHOULD try to use diverse paths to the recipient for each HTLC.\n+      - SHOULD retry and/or re-divide HTLCs which fail.\n+      - if the invoice specifies an `amount`:\n+          - MUST set `total_msat` to at least that `amount`, and less\n+            than or equal to twice `amount`.\n+      - MUST ensure that the total `amount_msat` of the HTLC set which arrive at the payee\n+        is greater or equal to `total_msat`.\n+      - MUST ensure that no (incomplete) non-failed subset of the HTLC set adds\n+        to a total `amount_msat` greater or equal to `total_msat`.\n+\n+The reader:\n+  - if `basic_mpp` is present:\n+    - MUST fail the HTLC if it would otherwise fail a single HTLC of value\n+      `total_msat`, `payment_hash` or `ctlv_expiry`.\n+    - otherwise:\n+      - MUST add it to the HTLC set corresponding to that `payment_hash`.\n+      - SHOULD fail the entire HTLC set if `total_msat` is not the same for\n+        all HTLCs in the set.","path":"04-onion-routing.md","position":252,"original_position":60,"commit_id":"e79f8a808d0c91aca065bc65b723f73839a40be8","original_commit_id":"e79f8a808d0c91aca065bc65b723f73839a40be8","user":{"login":"joostjager","id":4638168,"node_id":"MDQ6VXNlcjQ2MzgxNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/4638168?v=4","gravatar_id":"","url":"https://api.github.com/users/joostjager","html_url":"https://github.com/joostjager","followers_url":"https://api.github.com/users/joostjager/followers","following_url":"https://api.github.com/users/joostjager/following{/other_user}","gists_url":"https://api.github.com/users/joostjager/gists{/gist_id}","starred_url":"https://api.github.com/users/joostjager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joostjager/subscriptions","organizations_url":"https://api.github.com/users/joostjager/orgs","repos_url":"https://api.github.com/users/joostjager/repos","events_url":"https://api.github.com/users/joostjager/events{/privacy}","received_events_url":"https://api.github.com/users/joostjager/received_events","type":"User","site_admin":false},"body":"I guess those htlcs are cancelled early in the process because their `total_msat` doesn't match what is in the invoice database. How would it work in that case for zero-valued invoices? First htlc that arrives sets the amount?","created_at":"2019-08-05T14:35:10Z","updated_at":"2019-08-05T14:35:11Z","html_url":"https://github.com/lightningnetwork/lightning-rfc/pull/643#discussion_r310636511","pull_request_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/comments/310636511"},"html":{"href":"https://github.com/lightningnetwork/lightning-rfc/pull/643#discussion_r310636511"},"pull_request":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643"}},"in_reply_to_id":310633931},"pull_request":{"url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643","id":298322191,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk4MzIyMTkx","html_url":"https://github.com/lightningnetwork/lightning-rfc/pull/643","diff_url":"https://github.com/lightningnetwork/lightning-rfc/pull/643.diff","patch_url":"https://github.com/lightningnetwork/lightning-rfc/pull/643.patch","issue_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/issues/643","number":643,"state":"open","locked":false,"title":"Base AMP","user":{"login":"rustyrussell","id":775844,"node_id":"MDQ6VXNlcjc3NTg0NA==","avatar_url":"https://avatars2.githubusercontent.com/u/775844?v=4","gravatar_id":"","url":"https://api.github.com/users/rustyrussell","html_url":"https://github.com/rustyrussell","followers_url":"https://api.github.com/users/rustyrussell/followers","following_url":"https://api.github.com/users/rustyrussell/following{/other_user}","gists_url":"https://api.github.com/users/rustyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/rustyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustyrussell/subscriptions","organizations_url":"https://api.github.com/users/rustyrussell/orgs","repos_url":"https://api.github.com/users/rustyrussell/repos","events_url":"https://api.github.com/users/rustyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/rustyrussell/received_events","type":"User","site_admin":false},"body":"This is a commit-separated and TLV-enhanced version of #511 by @ZmnSCPxj \r\n\r\nWe need the total amount, due to amountless invoices.\r\n\r\nIt assumes, and is based on, #619, so only read the last 3 commits!","created_at":"2019-07-17T06:21:10Z","updated_at":"2019-08-05T14:35:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e90627a6cd669311942c5076e79bf1d8b5530692","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1277917320,"node_id":"MDU6TGFiZWwxMjc3OTE3MzIw","url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/labels/Meeting%20Discussion","name":"Meeting Discussion","color":"000000","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643/commits","review_comments_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643/comments","review_comment_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/issues/643/comments","statuses_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/statuses/e79f8a808d0c91aca065bc65b723f73839a40be8","head":{"label":"rustyrussell:guilt/base-amp","ref":"guilt/base-amp","sha":"e79f8a808d0c91aca065bc65b723f73839a40be8","user":{"login":"rustyrussell","id":775844,"node_id":"MDQ6VXNlcjc3NTg0NA==","avatar_url":"https://avatars2.githubusercontent.com/u/775844?v=4","gravatar_id":"","url":"https://api.github.com/users/rustyrussell","html_url":"https://github.com/rustyrussell","followers_url":"https://api.github.com/users/rustyrussell/followers","following_url":"https://api.github.com/users/rustyrussell/following{/other_user}","gists_url":"https://api.github.com/users/rustyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/rustyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustyrussell/subscriptions","organizations_url":"https://api.github.com/users/rustyrussell/orgs","repos_url":"https://api.github.com/users/rustyrussell/repos","events_url":"https://api.github.com/users/rustyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/rustyrussell/received_events","type":"User","site_admin":false},"repo":{"id":73757703,"node_id":"MDEwOlJlcG9zaXRvcnk3Mzc1NzcwMw==","name":"lightning-rfc","full_name":"rustyrussell/lightning-rfc","private":false,"owner":{"login":"rustyrussell","id":775844,"node_id":"MDQ6VXNlcjc3NTg0NA==","avatar_url":"https://avatars2.githubusercontent.com/u/775844?v=4","gravatar_id":"","url":"https://api.github.com/users/rustyrussell","html_url":"https://github.com/rustyrussell","followers_url":"https://api.github.com/users/rustyrussell/followers","following_url":"https://api.github.com/users/rustyrussell/following{/other_user}","gists_url":"https://api.github.com/users/rustyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/rustyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustyrussell/subscriptions","organizations_url":"https://api.github.com/users/rustyrussell/orgs","repos_url":"https://api.github.com/users/rustyrussell/repos","events_url":"https://api.github.com/users/rustyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/rustyrussell/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rustyrussell/lightning-rfc","description":"Lightning Network Specifications","fork":true,"url":"https://api.github.com/repos/rustyrussell/lightning-rfc","forks_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/forks","keys_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/teams","hooks_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/hooks","issue_events_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/issues/events{/number}","events_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/events","assignees_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/assignees{/user}","branches_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/branches{/branch}","tags_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/tags","blobs_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/git/refs{/sha}","trees_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/statuses/{sha}","languages_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/languages","stargazers_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/stargazers","contributors_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/contributors","subscribers_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/subscribers","subscription_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/subscription","commits_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/commits{/sha}","git_commits_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/git/commits{/sha}","comments_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/comments{/number}","issue_comment_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/issues/comments{/number}","contents_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/contents/{+path}","compare_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/merges","archive_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/downloads","issues_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/issues{/number}","pulls_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/pulls{/number}","milestones_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/milestones{/number}","notifications_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/labels{/name}","releases_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/releases{/id}","deployments_url":"https://api.github.com/repos/rustyrussell/lightning-rfc/deployments","created_at":"2016-11-14T23:54:47Z","updated_at":"2017-02-27T23:10:08Z","pushed_at":"2019-08-05T10:43:45Z","git_url":"git://github.com/rustyrussell/lightning-rfc.git","ssh_url":"git@github.com:rustyrussell/lightning-rfc.git","clone_url":"https://github.com/rustyrussell/lightning-rfc.git","svn_url":"https://github.com/rustyrussell/lightning-rfc","homepage":null,"size":2039,"stargazers_count":2,"watchers_count":2,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"lightningnetwork:master","ref":"master","sha":"8bdfc161569b679aa48655f331bff56190326f30","user":{"login":"lightningnetwork","id":13424735,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDI0NzM1","avatar_url":"https://avatars0.githubusercontent.com/u/13424735?v=4","gravatar_id":"","url":"https://api.github.com/users/lightningnetwork","html_url":"https://github.com/lightningnetwork","followers_url":"https://api.github.com/users/lightningnetwork/followers","following_url":"https://api.github.com/users/lightningnetwork/following{/other_user}","gists_url":"https://api.github.com/users/lightningnetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/lightningnetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightningnetwork/subscriptions","organizations_url":"https://api.github.com/users/lightningnetwork/orgs","repos_url":"https://api.github.com/users/lightningnetwork/repos","events_url":"https://api.github.com/users/lightningnetwork/events{/privacy}","received_events_url":"https://api.github.com/users/lightningnetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":73738971,"node_id":"MDEwOlJlcG9zaXRvcnk3MzczODk3MQ==","name":"lightning-rfc","full_name":"lightningnetwork/lightning-rfc","private":false,"owner":{"login":"lightningnetwork","id":13424735,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDI0NzM1","avatar_url":"https://avatars0.githubusercontent.com/u/13424735?v=4","gravatar_id":"","url":"https://api.github.com/users/lightningnetwork","html_url":"https://github.com/lightningnetwork","followers_url":"https://api.github.com/users/lightningnetwork/followers","following_url":"https://api.github.com/users/lightningnetwork/following{/other_user}","gists_url":"https://api.github.com/users/lightningnetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/lightningnetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightningnetwork/subscriptions","organizations_url":"https://api.github.com/users/lightningnetwork/orgs","repos_url":"https://api.github.com/users/lightningnetwork/repos","events_url":"https://api.github.com/users/lightningnetwork/events{/privacy}","received_events_url":"https://api.github.com/users/lightningnetwork/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/lightningnetwork/lightning-rfc","description":"Lightning Network Specifications","fork":false,"url":"https://api.github.com/repos/lightningnetwork/lightning-rfc","forks_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/forks","keys_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/teams","hooks_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/hooks","issue_events_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/issues/events{/number}","events_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/events","assignees_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/assignees{/user}","branches_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/branches{/branch}","tags_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/tags","blobs_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/git/refs{/sha}","trees_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/statuses/{sha}","languages_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/languages","stargazers_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/stargazers","contributors_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/contributors","subscribers_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/subscribers","subscription_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/subscription","commits_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/commits{/sha}","git_commits_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/git/commits{/sha}","comments_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/comments{/number}","issue_comment_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/issues/comments{/number}","contents_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/contents/{+path}","compare_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/merges","archive_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/downloads","issues_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/issues{/number}","pulls_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls{/number}","milestones_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/milestones{/number}","notifications_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/labels{/name}","releases_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/releases{/id}","deployments_url":"https://api.github.com/repos/lightningnetwork/lightning-rfc/deployments","created_at":"2016-11-14T19:21:45Z","updated_at":"2019-08-03T14:42:47Z","pushed_at":"2019-08-05T13:57:17Z","git_url":"git://github.com/lightningnetwork/lightning-rfc.git","ssh_url":"git@github.com:lightningnetwork/lightning-rfc.git","clone_url":"https://github.com/lightningnetwork/lightning-rfc.git","svn_url":"https://github.com/lightningnetwork/lightning-rfc","homepage":null,"size":1793,"stargazers_count":1009,"watchers_count":1009,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":260,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":100,"license":null,"forks":260,"open_issues":100,"watchers":1009,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643"},"html":{"href":"https://github.com/lightningnetwork/lightning-rfc/pull/643"},"issue":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/issues/643"},"comments":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/issues/643/comments"},"review_comments":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643/comments"},"review_comment":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/pulls/643/commits"},"statuses":{"href":"https://api.github.com/repos/lightningnetwork/lightning-rfc/statuses/e79f8a808d0c91aca065bc65b723f73839a40be8"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"joostjager"}}