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

Open
YoshihitoAso opened this issue Sep 2, 2024 · 0 comments
Open
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 registration protocol for investor's personal information, we would like to support off-chain "sealed" registration.

Describe the solution you'd like

We would like to be able to accept off-chain message transactions similar to those for issuers, such as the PersonalInfo contract.
Specifically, we would like to define a "SealedTx" API like the one below to accept execution commands from account addresses.

  • Endpoint: /sealed_tx/personal_info/register
  • Parameters: Same as input parameters to 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 strings
  • CanonicalRequestPath: Path part of 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 will be treated as an empty string.
Note: If RequestBody is empty, keccak256(RequestBody) will use keccak256("{}").

Signature and authentication procedure overview

Client Side (Create signature)

  1. Generate CanonicalRequest from the information of the request to be sent.
  2. Sign CanonicalRequest using the account's private key.

The generated signature is set in the header (called "X-SealedTx-Signature") and the request is sent.

Server Side (Verify 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. It is determined that the original request came from the recovered address and subsequent processing is carried out.
@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
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

No branches or pull requests

1 participant