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

Concept for cleaner PSBT update #4608

Merged
merged 6 commits into from
Oct 27, 2020
Merged

Conversation

nopara73
Copy link
Contributor

@nopara73 nopara73 commented Oct 22, 2020

Fixes #4460 with a clean concept. Also fixes other bugs. Need to be tested with

  • coldcard usb hardware wallet
  • coldcard PSBT workflow
  • payjoins

@nopara73 nopara73 marked this pull request as ready for review October 22, 2020 13:17
@nopara73 nopara73 added this to Backlog in v1.1.12.2 Oct 22, 2020
@lontivero
Copy link
Collaborator

This think this is not correct because I have been testing the payjoins and I didn't see this problem. Here you can see the last test that I performed with JM team member k.k:

PSBT sent to JM
{
  "tx": {
    "txid": "f6bbcc08034a7a12c0fa6ed3c7c832ea2482248aac259a9005e978c0ad76202c",
    "hash": "f6bbcc08034a7a12c0fa6ed3c7c832ea2482248aac259a9005e978c0ad76202c",
    "version": 1,
    "size": 113,
    "vsize": 113,
    "weight": 452,
    "locktime": 0,
    "vin": [
      {
        "txid": "9a084d08c5f7969756ca10c5c689e8ef0afa18ea3f44e7fa2a8caf2d1783b4c5",
        "vout": 3,
        "scriptSig": {
          "asm": "",
          "hex": ""
        },
        "sequence": 4294967295
      }
    ],
    "vout": [
      {
        "value": 0.00100000,
        "n": 0,
        "scriptPubKey": {
          "asm": "0 0637a08dd41ad5ab6cb85cbf7d44cb4d900bd495",
          "hex": "00140637a08dd41ad5ab6cb85cbf7d44cb4d900bd495",
          "reqSigs": 1,
          "type": "witness_v0_keyhash",
          "addresses": [
            "tb1qqcm6prw5rt26km9ctjlh63xtfkgqh4y4egary0"
          ]
        }
      },
      {
        "value": 0.00907416,
        "n": 1,
        "scriptPubKey": {
          "asm": "0 510176751e6c605afd765700e1388e6d5e1e456a",
          "hex": "0014510176751e6c605afd765700e1388e6d5e1e456a",
          "reqSigs": 1,
          "type": "witness_v0_keyhash",
          "addresses": [
            "tb1q2yqhvag7d3s94ltk2uqwzwywd40pu3t2kawuql"
          ]
        }
      }
    ]
  },
  "unknown": {
  },
  "inputs": [
    {
      "witness_utxo": {
        "amount": 0.01007557,
        "scriptPubKey": {
          "asm": "0 84aa062cf7c9bd2d8becad263781038f3c1ca04a",
          "hex": "001484aa062cf7c9bd2d8becad263781038f3c1ca04a",
          "type": "witness_v0_keyhash",
          "address": "tb1qsj4qvt8hex7jmzlv45nr0qgr3u7pegz2sh945m"
        }
      },
      "non_witness_utxo": {
        "txid": "9a084d08c5f7969756ca10c5c689e8ef0afa18ea3f44e7fa2a8caf2d1783b4c5",
        "hash": "7a0960274d575ec210f1b181ebeedc8b833128f39e773ae5312c7d7aeda6d354",
        "version": 1,
        "size": 727,
        "vsize": 406,
        "weight": 1621,
        "locktime": 0,
        "vin": [
          {
            "txid": "f3e6490a0731eee607aa8836c50727050b251677e2c44926f2edd6f1d653cf9c",
            "vout": 0,
            "scriptSig": {
              "asm": "",
              "hex": ""
            },
            "txinwitness": [
              "304402203e183f22a4c370b577c8537f91c003c7e10662fd8b18a66cdc98bb557e96af9802204bb797945040d24b032bfe425f1d9d2d3675890b642470d48118b64cd6eda22601",
              "02faabbf17e8e92cc3f2d288e7de5234e98b1ef8cc71271dbc06ecec087a05c5d0"
            ],
            "sequence": 4294967295
          },
          {
            "txid": "6ee117ec30210a60842907bcdc5d89689877ae304dd25480ac501102ef4d0cf5",
            "vout": 3,

Lucas Ontivero ~ Ask for PGP sig, [24.09.20 23:35]
"scriptSig": {
              "asm": "",
              "hex": ""
            },
            "txinwitness": [
              "3043022055ae654d42eef87ac4ba33895002388a73c1638669a7d830ab1f94df1ea9f943021f46b8c1e51b984b71fc937d75cc17e84b845a441e118ac8c1ceef06edd2f70401",
              "030d1691f83dafcfe79b555cab367b3dea49213d89a2b5e0631c9e0557b6e772dd"
            ],
            "sequence": 4294967295
          },
          {
            "txid": "96bdb19f88fa4a31b128c4e5f87557e9ec6129ff81e78521e8d0ac1786829f30",
            "vout": 4,
            "scriptSig": {
              "asm": "",
              "hex": ""
            },
            "txinwitness": [
              "304402204c6583da0e7c4925c81bc81e82f8878c17168596426b3db5ae8f3bfdcbebc97102201d4463ea33cadc510c37bb5e5963051ba6d76d4383b33d12cd6731e46c10ed2201",
              "03be74cec141d39e130c5f850ebb6b48bc4e177736f458b046a0f49acd663517d0"
            ],
            "sequence": 4294967295
          },
          {
            "txid": "e471ea8a41e18483a2e37e0d589946a321f5bd76345fffe06490c81d9851a79e",
            "vout": 4,
            "scriptSig": {
              "asm": "",
              "hex": ""
            },
            "txinwitness": [
              "304402200401f1dbae8ae1dfc475b1b23d8f22f09429d9e0cd7fd49718f97866f85b3e8d022003760cbda79502d5f183aeb1aa3536d26a212c46c3d4888301131a2ab80e7de001",
              "0351da5626ce9217ce5ead1c3bc8b43a8769d8948e53077911cf740f3cb6c6e34c"
            ],
            "sequence": 4294967295
          }
        ],
        "vout": [
          {
            "value": 0.00190694,
            "n": 0,
            "scriptPubKey": {
              "asm": "0 663f63c35017df99c5ea1b03e81ca18732022632",
              "hex": "0014663f63c35017df99c5ea1b03e81ca18732022632",
              "reqSigs": 1,
              "type": "witness_v0_keyhash",
              "addresses": [
                "tb1qvclk8s6szl0en302rvp7s89psueqyf3jp4a5hc"
              ]
            }
          },
          {
            "value": 0.01007557,
            "n": 1,
            "scriptPubKey": {
              "asm": "0 af8d49cba73db62cf2e8ce27c76c255c602d6137",
              "hex": "0014af8d49cba73db62cf2e8ce27c76c255c602d6137",
              "reqSigs": 1,
              "type": "witness_v0_keyhash",
              "addresses": [
                "tb1q47x5nja88kmzeuhgecnuwmp9t3sz6cfhphv6ha"
              ]
            }
          },
          {
            "value": 0.01007557,
            "n": 2,
            "scriptPubKey": {
              "asm": "0 d9eda834c6872e9c4d6bc8e226021a4a984af7ed",
              "hex": "0014d9eda834c6872e9c4d6bc8e226021a4a984af7ed",
              "reqSigs": 1,
              "type": "witness_v0_keyhash",
              "addresses": [
                "tb1qm8k6sdxxsuhfcntter3zvqs6f2vy4aldfz0dag"
              ]
            }
          },
          {
            "value": 0.01007557,
            "n": 3,
            "scriptPubKey": {
              "asm": "0 84aa062cf7c9bd2d8becad263781038f3c1ca04a",
              "hex": "001484aa062cf7c9bd2d8becad263781038f3c1ca04a",
              "reqSigs": 1,
              "type": "witness_v0_keyhash",
              "addresses": [
                "tb1qsj4qvt8hex7jmzlv45nr0qgr3u7pegz2sh945m"
              ]
            }
          }
        ]
      },
      "final_scriptwitness": [
        "30440220343b472f651c1c4556cc03561fc762b8e66f7751b0acb4928a94727e9dac0cc90220666397e51a8fc80e8062ca4386fcbded768247fee8df7e7cc8c167cfc1b8bb4a01",
        "0346c54ad935d15905d1fc4882fbb747f1073653be827b8f326ac61361863a3491"
      ]
    }
  ],
  "outputs": [
    {
    },
    {
    }
  ],
  "fee": 0.00000141
}

@nopara73
Copy link
Contributor Author

@lontivero UpdatePSBTInfo adds it and it is called before payjoin negotiation.

@nopara73
Copy link
Contributor Author

Ok, I just noticed it's been cleared in the payjoin client.

@nopara73 nopara73 mentioned this pull request Oct 22, 2020
@lontivero
Copy link
Collaborator

It looks much much better. I will test it.

@NicolasDorier
Copy link
Collaborator

NicolasDorier commented Oct 23, 2020

btw, just dropping it here, but including the prevTx as best effort by default in BTCPaySErver broke our Ledger wallet integration. Somehow for some users it was just hanging forever...

If you have like 10 UTXO with previous txs that are a bit big (wasabi coinjoin), it is just too slow.

@molnard molnard self-requested a review October 27, 2020 11:09
@molnard
Copy link
Collaborator

molnard commented Oct 27, 2020

  • To CC
  • From CC
  • Self spend
  • Self spend with external change address
  • Payjoin
  • UnitTests
  • RegTests

@molnard
Copy link
Collaborator

molnard commented Oct 27, 2020

@Kukks do you still have a TestNet Payjoin demo site?

Copy link
Collaborator

@molnard molnard left a comment

Choose a reason for hiding this comment

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

Tested ACK, except that I could not test PayJoin.

@Kukks
Copy link
Contributor

Kukks commented Oct 27, 2020 via email

@lontivero
Copy link
Collaborator

Ohh sorry, I test it yesterday in mainnet and it worked okay.

@nopara73
Copy link
Contributor Author

@nopara73 nopara73 merged commit a8b0f71 into WalletWasabi:master Oct 27, 2020
@nopara73 nopara73 deleted the 1603361760 branch October 27, 2020 14:28
@nopara73 nopara73 added this to ToDo in Backport via automation Oct 27, 2020
@nopara73 nopara73 removed this from Backlog in v1.1.12.2 Oct 27, 2020
@nopara73 nopara73 moved this from ToDo to nextbackport Wasabi v1.1.12.3 in Backport Dec 7, 2020
@nopara73 nopara73 moved this from nextbackport Wasabi v1.1.12.3 to ToDo in Backport Dec 7, 2020
@nopara73 nopara73 moved this from ToDo to nextbackport Wasabi v1.1.12.3 in Backport Dec 7, 2020
@molnard molnard moved this from nextbackport Wasabi v1.1.12.3 to Added to v1.1.12.3 in Backport Dec 7, 2020
@molnard molnard mentioned this pull request Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Backport
Added to v1.1.12.3
Development

Successfully merging this pull request may close these issues.

Coldcard Signing Issue
6 participants