generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support for retention challenges #219
Merged
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3fbb90e
language on retained dids
6145410
updates
dff0360
formatting
d8af3c3
Merge branch 'main' into issue-74
decentralgabe a714581
updates
5f6f148
update
ddb608c
one more
f236b7e
Update spec/api.yaml
decentralgabe d375e5e
Apply suggestions from code review
decentralgabe 497f60b
clarity on identity key
6c5a813
hash source registry
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ paths: | |
put: | ||
tags: | ||
- DHT | ||
summary: Put DNS-encoded BEP44 records into the DHT | ||
summary: Put a DNS-encoded BEP44 record set into the DHT | ||
description: Put a DNS-encoded BEP44 record set into the DHT | ||
parameters: | ||
- name: id | ||
|
@@ -112,25 +112,28 @@ paths: | |
v: | ||
type: string | ||
description: A base64URL-encoded bencoded DNS packet containing the DID Document. | ||
retention_proof: | ||
retention_solution: | ||
type: string | ||
description: A retention proof calculated according to the spec-defined retention proof algorithm. | ||
description: A retention solution calculated according to the spec-defined retention solution algorithm. | ||
required: [ did, sig, seq, v ] | ||
responses: | ||
"202": | ||
description: Accepted. The server has accepted the request as valid and will publish it to the | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
type: object | ||
properties: | ||
expiry: | ||
type: number | ||
"400": | ||
description: Invalid request. | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
"401": | ||
description: Invalid signature. | ||
description: Invalid signature or retention solution. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why wouldn't an invalid retention solution be a 400? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, updating |
||
content: | ||
application/json: | ||
schema: | ||
|
@@ -183,6 +186,9 @@ paths: | |
items: | ||
type: integer | ||
description: "The sequence numbers available for querying for this node." | ||
expiry: | ||
type: number | ||
description: "The Unix Timestamp in seconds indicating when the DID will be evicted from the Gateway's Retained DID Set." | ||
required: [ did, dht ] | ||
"400": | ||
description: Invalid request. | ||
|
@@ -261,28 +267,33 @@ paths: | |
application/json: | ||
schema: | ||
type: string | ||
/difficulty: | ||
/challenge: | ||
decentralgabe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
get: | ||
tags: | ||
- DID | ||
summary: Get information about the current difficulty. | ||
description: Get information needed to calculate a retention proof for DID PUT operations. | ||
summary: Get information necessary for responding to retention challenges. | ||
description: Get information needed to calculate a retention solution for DID PUT operations. | ||
responses: | ||
"200": | ||
description: The current hash and difficulty to calculate a retention proof against. | ||
description: The current hash and difficulty to calculate a retention solution against, along with an estimated retention guarantee represented by the expiry property. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
hash: | ||
type: string | ||
description: "The current hash which is to be used as input for computing a retention solution." | ||
difficulty: | ||
type: integer | ||
required: [ hash, difficulty ] | ||
description: "The current difficulty of the challenge representing the number of bits of leading zeros the resulting hash must contain." | ||
expiry: | ||
type: integer | ||
description: "An approximate expiry date-time value, if a valid Retention Solution is submitted against this challenge, represented as a Unix Timestamp in seconds. The precise expiry date-time value is returned as a part of a PUT operation." | ||
required: [ hash, difficult, expiry ] | ||
"404": | ||
description: Retention proofs not supported by this gateway. | ||
description: Retention challenges are not supported by this gateway. | ||
content: | ||
application/json: | ||
schema: | ||
type: string | ||
type: string |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I think it's good to avoid conflating the usage of
proof
across the two use cases:yeah I think we'd be wise to consolidate our usage of that word for (1) and not for (2)
also sets us up if we ever introduces a spam preventing mechanism other-than PoW