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

Require salt in Rfq privateData JSON schema #306

Merged
merged 3 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hosted/json-schemas/rfq-private.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
}
}
}
}
},
"required": ["salt"]
}
6 changes: 4 additions & 2 deletions specs/protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ Message kinds other than RFQ may NOT have property `privateData`. The [RFQ `priv
}
},
"privateData": {
"salt": "1234567890",
"claims": [<VERIFIABLE_CREDENTIAL>], <---- actual
"payinMethod": {
"paymentDetails": <OBJ> <---- actual
Expand Down Expand Up @@ -444,10 +445,10 @@ The salted hash is produced by creating a [digest](#digests) of a JSON array con

The `privateData` field is ephemeral and **MUST** only be present when the message is initially sent to the intended recipient.

This table enumerates the structure of
This table enumerates the structure of `PrivateData`
| field | data type | required | description |
| -------- | ------------------------------------------------- | -------- | ------------------------------------------------------------------------------------- |
| `salt` | string | N | |
| `salt` | string | Y | Randomly generated salt used for hashing PrivateData fields |
Copy link
Contributor

Choose a reason for hiding this comment

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

nice. the rfq json example below this table will need updating too

Copy link
Contributor

Choose a reason for hiding this comment

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

this example too actually

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch. ty

| `claims` | string[] | N | an array of claims that fulfill the requirements declared in an [Offering](#offering) |
| `payin` | [`PrivatePaymentDetails`](#privatepaymentdetails) | N | A container for the unhashed `payin.paymentDetails` |
| `payout` | [`PrivatePaymentDetails`](#privatepaymentdetails) | N | A container for the unhashed `payout.paymentDetails` |
Expand Down Expand Up @@ -483,6 +484,7 @@ This table enumerates the structure of
"claimsHash": "<HASH_PRIVATE_CLAIMS_0>"
},
"privateData": {
"salt": "1234567890",
"payin": {
"paymentDetails": {
"cardNumber": "1234567890123456",
Expand Down