TBD54566975 / tbdex

56 stars 26 forks source link

Fixes #151

Closed mistermoe closed 1 year ago

mistermoe commented 1 year ago

Changes

TBDiscussed

does Rfq.vcs need to be a VP? seems like a redundant signature when the RFQ Message itself is signed with the credential subject's DID. A realistic RFQ would end up looking like this

{
  "metadata": {
    "from": "did:ion:EiApkVYk4ppcUCsEQk8sDOtUdUXxkYcDUBlcaJOuBcMDnQ:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiJkd24tc2lnIiwicHVibGljS2V5SndrIjp7ImNydiI6IkVkMjU1MTkiLCJrdHkiOiJPS1AiLCJ4IjoiUlJyLW4zeHBRaTJtZjIxUmFCWGJDQUVnVnFZSThsMndpdHUtVVVLTFZaUSJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiJdLCJ0eXBlIjoiSnNvbldlYktleTIwMjAifV0sInNlcnZpY2VzIjpbXX19XSwidXBkYXRlQ29tbWl0bWVudCI6IkVpQ3pFaW0yWFpabmJEVnBHQ2FjdkNmRmJ6WHR0UmE4aFB4SGVPa0Mzc015MncifSwic3VmZml4RGF0YSI6eyJkZWx0YUhhc2giOiJFaUFSMGpJX1Y3QVdzZ3ViYmVnMlMxeGZ2Y2ZnSTNZMy0zWDUyY2ZjZi1CZ25RIiwicmVjb3ZlcnlDb21taXRtZW50IjoiRWlDV1dSdGJKU19VOUVneTFOY3poR3NqUUk1N0pfczRnSHRnR1J4dXFOQ3p6QSJ9fQ",
    "to": "did:ex:pfi",
    "kind": "rfq",
    "id": "rfq_01h9a6yg0behwaq64yqgkqsh13",
    "createdAt": "2023-09-02T05:48:11.660Z",
    "exchangeId": "rfq_01h9a6yg0behwaq64yqgkqsh13"
  },
  "data": {
    "offeringId": "abcd123",
    "payinMethod": {
      "kind": "DEBIT_CARD",
      "paymentDetails": {
        "cardNumber": "1234567890123456",
        "expiryDate": "12/22",
        "cardHolderName": "Ephraim Bartholomew Winthrop",
        "cvv": "123"
      }
    },
    "payoutMethod": {
      "kind": "BTC_ADDRESS",
      "paymentDetails": {
        "btcAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
      }
    },
    "quoteAmountSubunits": "20000",
    "vcs": {
      "presentation_submission": {
        "id": "1693633691659",
        "definition_id": "7ce4004c-3c38-4853-968b-e411bafcd945",
        "descriptor_map": [
          {
            "format": "jwt_vc",
            "id": "bbdb9b7c-5754-4f46-b63b-590bada959e0",
            "path": "$.claims[0]"
          }
        ]
      },
      "claims": [
        "eyJhbGciOiJFZERTQSIsImtpZCI6ImR3bi1zaWcifQ.eyJpc3MiOiJkaWQ6aW9uOkVpQXBrVllrNHBwY1VDc0VRazhzRE90VWRVWHhrWWNEVUJsY2FKT3VCY01EblE6ZXlKa1pXeDBZU0k2ZXlKd1lYUmphR1Z6SWpwYmV5SmhZM1JwYjI0aU9pSnlaWEJzWVdObElpd2laRzlqZFcxbGJuUWlPbnNpY0hWaWJHbGpTMlY1Y3lJNlczc2lhV1FpT2lKa2QyNHRjMmxuSWl3aWNIVmliR2xqUzJWNVNuZHJJanA3SW1OeWRpSTZJa1ZrTWpVMU1Ua2lMQ0pyZEhraU9pSlBTMUFpTENKNElqb2lVbEp5TFc0emVIQlJhVEp0WmpJeFVtRkNXR0pEUVVWblZuRlpTVGhzTW5kcGRIVXRWVlZMVEZaYVVTSjlMQ0p3ZFhKd2IzTmxjeUk2V3lKaGRYUm9aVzUwYVdOaGRHbHZiaUpkTENKMGVYQmxJam9pU25OdmJsZGxZa3RsZVRJd01qQWlmVjBzSW5ObGNuWnBZMlZ6SWpwYlhYMTlYU3dpZFhCa1lYUmxRMjl0YldsMGJXVnVkQ0k2SWtWcFEzcEZhVzB5V0ZwYWJtSkVWbkJIUTJGamRrTm1SbUo2V0hSMFVtRTRhRkI0U0dWUGEwTXpjMDE1TW5jaWZTd2ljM1ZtWm1sNFJHRjBZU0k2ZXlKa1pXe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O4IEYYRJruW-Di4GoyyjSbYnTwNLynMDrkADR23B6aV572ZpKayt9yUwLVyCviTbcGb3eIgs4aNahGte2Ag"
}

Sad realities:

p.s. tests will bork but i'm about to land ✈️ . will fix when i get home from airport

michaelneale commented 1 year ago

@mistermoe its fairly easy to anchor for one off dids so perhaps in practice the chonky did ion problem doesn’t matter

mistermoe commented 1 year ago

Good point @michaelneale