Skip to content

Conversation

@DOBEN
Copy link
Member

@DOBEN DOBEN commented Dec 2, 2025

Purpose

https://linear.app/concordium/issue/RUN-75/create-mechanism-to-manage-the-account-sequence-number
https://linear.app/concordium/issue/RUN-78/implement-create-verification-request-endpoint

The full logic of the /verifiable-presentations/create-verification-request API endpoint (except the public_info field) flow has been implemented. This was done so the account nonce management tracking can be applied and tested on the /verifiable-presentations/create-verification-request flow.
The account nonce management can be applied in the same way on the other anchor flow in the future (not part of this PR).

Example command to call the endpoint:

curl -POST "http://localhost:8000/verifiable-presentations/create-verification-request" -H "Content-Type: application/json" --data '{
    "nonce": "0000000000000000000000000000000000000000000000000000000000000000",
    "connection_id": "MyWalletConnectTopic",
    "context_string": "MyGreateApp",
    "rescource_id": "MyGreateWebsite",
    "requested_claims": [
        {
            "type": "identity",
            "statements": [
                {
                    "type": "AttributeInRange",
                    "attributeTag": "registrationAuth",
                    "lower": 80,
                    "upper": 1237
                }
            ],
            "issuers": [
                "did:ccd:testnet:idp:0"
            ],
            "source": [
                "identityCredential"
            ]
        }
    ]
}'

Changes

  • Adds account nonce management tracking in service.
  • Adds flow for the /verifiable-presentations/create-verification-request api endpoint.

@DOBEN DOBEN force-pushed the account-sequence-number-management branch from 9ab8bcf to 7e07c20 Compare December 2, 2025 23:25
Copy link
Contributor

@allanbrondum allanbrondum left a comment

Choose a reason for hiding this comment

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

I think this PR is covering two issues. The nonce management and the verification request API. And which parts of the request API is done/final and can be reviewed and which are just temporary implementations? I think to implement nonce management, you can just take an empty request with no fields in the endpoint and crate and submit some dummy verificaiton request and VRA. To keep tasks separate and not mix them together. Then you don't need the VerificationRequestParams in this PR but can leave it to the PR where it naturally belongs.

Copy link
Contributor

@squirer squirer left a comment

Choose a reason for hiding this comment

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

Just added some small comments about the request timeout too but all looks good for the most part, nice stuff

// since it is possible that API requests come in parallel. The nonce is
// increased by 1 and its lock is released after the transaction is submitted to
// the blockchain.
let mut account_sequence_number = state.nonce.lock().await;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need a timeout on this async operation (locking), like we have for calling the node.

Copy link
Contributor

@allanbrondum allanbrondum left a comment

Choose a reason for hiding this comment

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

Still have some comments about the timeouts.

allanbrondum

This comment was marked as duplicate.

Copy link
Contributor

@allanbrondum allanbrondum left a comment

Choose a reason for hiding this comment

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

Still have some comments about the timeouts

@DOBEN DOBEN merged commit 486e8c2 into feature/RUN-36-credential-verification-service Dec 4, 2025
4 checks passed
@DOBEN DOBEN deleted the account-sequence-number-management branch December 4, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants