{
  "$schema": "../rpc-schema-draft.json",
  "type": "object",
  "rpc": "makesecret",
  "title": "Command for deriving pseudorandom key from HSM",
  "description": [
    "The **makesecret** RPC command derives a secret key from the HSM_secret."
  ],
  "request": {
    "required": [],
    "additionalProperties": false,
    "properties": {
      "hex": {
        "type": "hex",
        "description": [
          "One of `hex` or `string` must be specified: `hex` can be any hex data."
        ]
      },
      "string": {
        "type": "string",
        "description": [
          "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally."
        ]
      }
    }
  },
  "response": {
    "required": [
      "secret"
    ],
    "additionalProperties": false,
    "properties": {
      "secret": {
        "type": "secret",
        "description": [
          "The pseudorandom key derived from HSM_secret."
        ]
      }
    }
  },
  "errors": [
    "The following error codes may occur:",
    "",
    "- -1: Catchall nonspecific error."
  ],
  "author": [
    "Aditya [aditya.sharma20111@gmail.com](mailto:aditya.sharma20111@gmail.com) is mainly responsible."
  ],
  "resources": [
    "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
  ],
  "examples": [
    {
      "request": {
        "id": "example:makesecret#1",
        "method": "makesecret",
        "params": [
          "73636220736563726574"
        ]
      },
      "response": {
        "secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
      }
    },
    {
      "request": {
        "id": "example:makesecret#2",
        "method": "makesecret",
        "params": {
          "string": "scb secret"
        }
      },
      "response": {
        "secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
      }
    }
  ]
}
