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

[FEATURE] "SealedTx": Off-chain personal information registration #689

Closed
YoshihitoAso opened this issue Sep 2, 2024 · 0 comments · Fixed by #695
Closed

[FEATURE] "SealedTx": Off-chain personal information registration #689

YoshihitoAso opened this issue Sep 2, 2024 · 0 comments · Fixed by #695
Assignees
Labels
enhancement New feature or request

Comments

@YoshihitoAso
Copy link
Member

YoshihitoAso commented Sep 2, 2024

Is your feature request related to a problem? Please describe.

In addition to using the PersonalInfo contract as a protocol for registering investors' personal information, we would also like to support off-chain 'sealed' registration.

Describe the solution you'd like

We would like to support off-chain message transactions similar to those used for issuers, such as the PersonalInfo contract. Specifically, we plan to define a 'SealedTx' API like the example below to accept execution commands from account addresses.

  • Endpoint: /sealed_tx/personal_info/register
  • Parameters: Same as the input parameters of the contract.
  • Header: The signature of the account performing the transaction (X-SealedTx-Signature)

📔 "X-SealedTx-Signature" Specifications

CanonicalRequest =
HTTPMethod + '\n' +
CanonicalRequestPath + '\n' +
CanonicalQueryString + '\n' +
keccak256(RequestBody)
  • HTTPMethod: GET, POST, or other HTTP methods as strings.
  • CanonicalRequestPath: The path part of the URI (e.g., /sealed_tx/personal_info/register).
  • CanonicalQueryString: Query string sorted by key (e.g., ?amount=123&card=hoge).

Note: If there is no CanonicalQueryString, it is treated as an empty string.
Note: If the RequestBody is empty, keccak256(RequestBody) uses keccak256("{}").

Signature and Authentication Process Overview

Client-Side (Creating the Signature)

  1. Generate a CanonicalRequest using the details of the request to be sent.
  2. Sign the CanonicalRequest using the account's private key.
  3. Set the generated signature in the header (as "X-SealedTx-Signature") and send the request.

Server-Side (Verifying the Signature)

  1. Generate a CanonicalRequest from the received request.
  2. Verify the X-SealedTx-Signature using the CanonicalRequest.
  3. Recover the account address from the signature. If the original request matches the recovered address, proceed with the subsequent processing.
@YoshihitoAso YoshihitoAso added the enhancement New feature or request label Sep 2, 2024
@YoshihitoAso YoshihitoAso self-assigned this Sep 2, 2024
@YoshihitoAso YoshihitoAso changed the title [FEATURE] Off-chain personal information registration [FEATURE] "Sealed Tx": Off-chain personal information registration Sep 2, 2024
@YoshihitoAso YoshihitoAso changed the title [FEATURE] "Sealed Tx": Off-chain personal information registration [FEATURE] "SealedTx": Off-chain personal information registration Sep 3, 2024
YoshihitoAso added a commit that referenced this issue Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant