Callback Server Requirements

HTTP API

The callback server is an HTTP server that supports the following endpoints:

  • Path

    • /v1/check

  • Method

    • POST

  • Body

    • Encoded with x-www-form-urlencoded

HTTP Request Parsing

The TSS Node will follow the steps below to send the HTTP request:

  • Generate CallbackRequest

  • Serialize CallbackRequest to derive CallbackRequestJsonString

  • Use CallbackRequestJsonString as the JWT payload and sign it using its RSA private key to create a JWT

  • Submit the HTTP POST request via an HTML form with TSS_JWT_MSG as the key and JWT as the value

The callback server will follow the steps below once it receives the HTTP request:

  • Retrieve the data in the HTTP POST request using TSS_JWT_MSG as the key and the JWT as the value

  • Use the TSS Node’s RSA public key to validate the signed JWT

  • Retrieve the payload in the JWT and deserialize it using CallbackRequest

  • Deserialize the meta field to retrieve the information in the request

Risk Control

You'll need to perform a risk control for each CallbackRequest based on your organization’s business and security requirements to further validate the request.

HTTP Response

The callback server will send the HTTP response as follows:

  • Generate CallbackResponse

  • Serialize CallbackResponse to derive CallbackResponseJsonString

  • Use CallbackResponseJsonString as the JWT payload and sign it using its RSA private key to create a JWT

  • Use the JWT as the HTTP response and return it to the TSS Node

CallbackRequest Description

When request_type == TypeKeyGen, request_detail is as follows:

extra_info:

When request_type == TypeKeySign, request_detail is as follows:

extra_info:

ToAddressDetail:

extra_parameters:

Input:

TransactionTypeEnum

TransactionOperationEnum

When request_type == TypeKeyReshare, request_detail is as follows:

extra_info:

CallbackResponse Description

Note: If the TSS Node fails to receive the HTTP response, it will continue to send requests to the callback server. In such cases, when the maximum number of retries is reached, the response will be categorized as REJECT.

Last updated