Generate Address

This endpoint will generate a unique address for the user along with the specific transaction script, e.g. P2PKH, a private and a public key, and WIF.

Users must keep their private keys and WIFs secure and accessible to only them at all times. Losing those exposes a risk of losing their funds associated with the respective address.

We generate, but do not save or record the response in any data base, log or anywhere else on our side! In the case a user loses their private key or WIF, Crypto APIs 2.0 will not be able to retrieve it.

Single Result - This endpoint returns only one single result. POST /blockchain-tools/{blockchain}/{network}/addresses/generate

Path Parameters

  • Required
    blockchain string

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

    Example : bitcoin
    Possible Values : bitcoin bitcoin-cash litecoin dogecoin dash ethereum ethereum-classic xrp zilliqa zcash
  • Required
    network string

    Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.

    Example : testnet
    Possible Values : mainnet testnet ropsten mordor

Query parameters

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

Request body schema application/json

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

  • Required
    data object
    • Required
      item object

Response schema

201 400 401 402 403 409 415 422 429 500
HTTP Status Code: 201
Content-Type: application/json

The resource has been successfully created.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • Required
    requestId string

    Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

    Example : 601c1710034ed6d407996b30
  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : You can add any text here
  • Required
    data object
    • Required
      item object
      • Required
        addresses array
        • Required
          address string

          Represents the specific address that will be generated.

          Example : 2MzbNswGR1Y3BQP2bQfHcmkmrkAtp9gRhN1
        • Required
          format string

          Defines the form of transaction that is used. Keep in mind that we support more than one type of formats for example: p2pkh p2sh p2wpkh etc. and they are generated simultaneously in the response of the Generate Address endpoint, depending on the blockchain and network that has been chosen. For more information about supported formats - please check "What we support" section

          Example : P2SH
      • Required
        privateKey string

        Represents the privately known secret key used for authentication and encryption of the address.

        Example : 7662b19db068aa373b591b83478dc243c60d11ba812b2a678c3a2b2db20dd764
      • Required
        publicKey string

        Represents the publicly known key used for identification of the address.

        Example : 03761e771ec1505d2d349cc6362c8bd76fe2f78c759211eaf2217fe129901e0928
      • Required
        wif string

        Represents the Wallet Import Format which dictates the encoding that allows the copy of the private ECDSA key easily.

        Example : L1BqVUYPhyL71wg53Tre9a5bWq5kFLwV7mQVfrmSR5DnKqNuy8Wk

Credits Cost : 10 Credits For 1 Result(s)

Try it out

Request Example

POST
https://rest.cryptoapis.io/v2/blockchain-tools/bitcoin/testnet/addresses/generate
Headers
Host: https://rest.cryptoapis.io/v2
Content-Type: application/json
X-API-Key: my-api-key

Request Body
{
    "context": "",
    "data": {
        "item": {}
    }
}

Response Example

{
    "apiVersion": "2.0",
    "requestId": "601c1710034ed6d407996b30",
    "context": "You can add any text here",
    "data": {
        "item": {
            "addresses": [
                {
                    "address": "2MzbNswGR1Y3BQP2bQfHcmkmrkAtp9gRhN1",
                    "format": "P2SH"
                }
            ],
            "privateKey": "7662b19db068aa373b591b83478dc243c60d11ba812b2a678c3a2b2db20dd764",
            "publicKey": "03761e771ec1505d2d349cc6362c8bd76fe2f78c759211eaf2217fe129901e0928",
            "wif": "L1BqVUYPhyL71wg53Tre9a5bWq5kFLwV7mQVfrmSR5DnKqNuy8Wk"
        }
    }
}