You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.5 KiB
1.5 KiB
Lock an HD Account Type
To avoid errors related to POST xpub
and SegWit derivation type, this endpoint allows locking of the type of an xpub in the database.
POST /xpub/:xpub/lock
Parameters must be passed in the body of the request as url encoded arguments.
Parameters
- address -
string
- The first address of the internal chain for thisxpub
, derivation pathM/1/0
. Use compressed P2PHK address regardless of HD derivation scheme. - message -
string
- Either"lock"
or"unlock"
- signature -
string
- The base64-encoded signature of the double SHA256 hash of[varuint length of message string, message string]
. Signature scheme follows bitcoinjs-message with a message prefix matching the coin type. Use the ECPair associated with theM/1/0
address to sign. - at -
string
(optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through theAuthorization
HTTP header (with theBearer
scheme).
Example
POST /xpub/xpub0123456789/lock
address=1address&message=lock&signature=Base64X==
Success
Status code 200 with JSON response:
{
"status": "ok",
"data": {
"derivation": "LOCKED BIP49, etc"
}
}
Failure
Status code 400 with JSON response:
{
"status": "error",
"error": "<error message>"
}