> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streambird.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Begin Wallet Import

> Initiates the wallet-import process and returns the HPKE encryption public key required for encrypting wallet entropy.

This endpoint does not import or store entropy; it only returns the key needed for secure encryption before the final submission step.
## Entropy Encryption Model

- The server generates an ephemeral HPKE keypair.
- The public key is returned to the client.
- The client encrypts either:
- HD entropy for the specified `index`, or
- A private key if `entropy_type = "private_key"`
- Encrypted entropy is submitted to the wallet-import completion endpoint.
- Raw entropy never touches the server in plaintext.

## Returns

A successful response returns an `encryption_type` and `encryption_public_key` for encrypting the wallet entropy.



## OpenAPI

````yaml post /v1/wallets/import/begin
openapi: 3.1.0
info:
  title: MoonKey Auth API
  description: >-
    Explore all the details of MoonKey Auth API. All of our APIs are RESTful and
    accept and return JSON.
  version: v1
servers:
  - url: https://api.moonkey.fun
    description: Production
    variables: {}
security:
  - Authorization: []
tags:
  - name: Users
    description: User management API
  - name: Magic Links
    description: ''
  - name: OTPs
    description: >-
      Send OTP (One-time passcodes) by all the supported delivery methods such
      as SMS, email.
  - name: OAuth
    description: ''
  - name: Wallets Login
    description: ''
  - name: Managed Wallets
    description: ''
  - name: Wallet Import
    description: >-
      Import existing wallets into the platform using secure HPKE encryption.
      This flow ensures raw entropy (seed phrases or private keys) never touches
      the server in plaintext.
externalDocs:
  url: ''
  description: ''
paths:
  /v1/wallets/import/begin:
    parameters: []
    post:
      tags:
        - Wallet Import
      summary: Begin Wallet Import
      description: >-
        Initiates the wallet-import process and returns the HPKE encryption
        public key required for encrypting wallet entropy.


        This endpoint does not import or store entropy; it only returns the key
        needed for secure encryption before the final submission step.

        ## Entropy Encryption Model


        - The server generates an ephemeral HPKE keypair.

        - The public key is returned to the client.

        - The client encrypts either:

        - HD entropy for the specified `index`, or

        - A private key if `entropy_type = "private_key"`

        - Encrypted entropy is submitted to the wallet-import completion
        endpoint.

        - Raw entropy never touches the server in plaintext.


        ## Returns


        A successful response returns an `encryption_type` and
        `encryption_public_key` for encrypting the wallet entropy.
      operationId: BeginWalletImport
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                public_address:
                  type: string
                  minLength: 1
                  description: '`Required` Wallet address being imported.'
                wallet_type:
                  type: string
                  enum:
                    - solana
                    - ethereum
                  description: '`Required` Blockchain type.'
                encryption_type:
                  type: string
                  enum:
                    - HPKE
                  description: '`Required` Must be `HPKE`.'
                entropy_type:
                  type: string
                  enum:
                    - hd
                    - private_key
                  description: >-
                    `Required` One of: `hd` (HD-derived entropy) or
                    `private_key` (raw private key).
                account_index:
                  type: integer
                  minimum: 0
                  description: >-
                    `Required only when entropy_type = "hd"` Account derivation
                    index. Must be >= 0.
              required:
                - public_address
                - wallet_type
                - encryption_type
                - entropy_type
            examples:
              BeginWalletImportHDSolana:
                summary: HD Wallet Import (Solana)
                value:
                  public_address: 5dbSMv2dspnDrbPJvczMDYwKRUMmhmnjM4cNGJp6C9tc
                  wallet_type: solana
                  encryption_type: HPKE
                  entropy_type: hd
                  account_index: 0
              BeginWalletImportPrivateKeyEthereum:
                summary: Private Key Wallet Import (Ethereum)
                value:
                  public_address: 0xA1b2c3d4E5f...
                  wallet_type: ethereum
                  encryption_type: HPKE
                  entropy_type: private_key
      responses:
        '200':
          description: Begin Wallet Import response
          content:
            application/json:
              schema:
                type: object
                properties:
                  encryption_type:
                    type: string
                    enum:
                      - HPKE
                    description: The encryption type used. Always `HPKE`.
                  encryption_public_key:
                    type: string
                    description: >-
                      Base64-encoded HPKE public key used for encrypting
                      entropy.
                required:
                  - encryption_type
                  - encryption_public_key
              examples:
                BeginWalletImportResp:
                  value:
                    encryption_type: HPKE
                    encryption_public_key: +9lqNCH7Dh6ODSYWa/87oTwOLiT9lwYFV8mZr6d9siw=
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: >-
        Auth Platform API includes all the Auth related features. All Users,
        Phone Numbers, Emails, and OTPs are associated with an `App` as the
        container.


        Endpoints only accept App's `Secret API keys` other than certain
        endpoints that are used client side or via SDK that accept the
        `public_token`.


        ## Authentication using App Api Key


        ## Header:


        ```

        Authorization: Bearer {api_key}

        ```


        ## Authenticated Request


        ```curl

        curl \
          -X GET https://api.moonkey.fun/v1/auth/users/user_24wFP9pDa9YiMJLun94iKykoZs2 \
          -H "Authorization: Bearer sk_test_pRqweh3wvWmJAAVYv7Z0T5iPLzFM4ql0muoyQcjOxGeN3p1r"
        ```

````