GDK JSON
This section describes the various JSON formats used by the library.
Initialization config JSON
Passed to GA_init when initializing the library.
{
"datadir": "/path/to/store/data",
"tordir": "/path/to/store/tor/data",
"registrydir": "/path/to/store/registry/data",
"log_level": "info",
"with_shutdown": true
}
- datadir:
Mandatory. A directory which gdk will use to store encrypted data relating to sessions.
- tordir:
Optional. The directory for tor state data, used when the internal tor implementation is enabled in Connection parameters JSON. Note that each process using the library at the same time requires its own distinct directory. If not given, a sub-directory
"tor"inside"datadir"is used.- registrydir:
Optional. The directory for the registry data, used when the network is liquid based. Note that each process using the library at the same time requires its own distinct directory. If not given, a sub-directory
"registry"inside"datadir"is used.- log_level:
Optional. The library logging level, one of
"debug","info","warn","error", or"none". Default:"none".- with_shutdown:
Optional. If
true, the caller will callGA_shutdownbefore the application exits. This enables sessions that use tor to be closed and re-opened repeatedly. Iffalse,GA_shutdownhas no effect and does not need to be called. Default:false.
Connection parameters JSON
{
"name": "testnet",
"proxy": "localhost:9150",
"use_tor": true,
"user_agent": "green_android v2.33",
"spv_enabled": false,
"min_fee_rate": 1000,
"cert_expiry_threshold": 1
"gap_limit": 20,
"electrum_url": "blockstream.info:993",
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:143",
"electrum_tls": true,
}
- name:
The name of the network to connect to. Must match a key from Network list JSON.
- proxy:
The proxy connection to pass network traffic through, if any.
- use_tor:
trueto enable Tor connections,falseotherwise. If enabled and a proxy is not given, a Tor connection will be started internally. If a proxy is given and Tor is enabled, the proxy must support resolving".onion"domains.- user_agent:
The user agent string to pass to the server for multisig connections.
- spv_enabled:
trueto enable SPV verification for the session,falseotherwise.- min_fee_rate:
nullto use the default minimum fee (which can change according to the network conditions), or an integer giving the fee rate in satoshis per 1000 bytes. Note that overriding the default fee rate only affects transaction construction; the rates returned by fee notifications remain those of the underlying network.- cert_expiry_threshold:
Ignore certificates expiring within this many days from today. Used to pre-empt problems with expiring embedded certificates.
- gap_limit:
Optional, singlesig only. Number of consecutive empty scripts/addresses to monitor. Defaults to 20.
- electrum_url:
Optional. For singlesig the Electrum server used to fetch blockchain data. For multisig the Electrum server used for SPV verification. Default value depends on the network.
- electrum_onion_url:
Optional. If
"use_tor"istrue, this value is used instead of"electrum_url". Default value depends on the network.- electrum_tls:
Optional. Use TLS to connect to the Electrum server. Default value depends on the network (
falsefor local networks,trueotherwise).
Note
- When
"use_tor"istrue, the caller should pass"with_shutdown"astruein the Initialization config JSON passed to
GA_init, and callGA_shutdownon application exit if more than one session will be created, or if sessions may be created/destroyed repeatedly.
Proxy Settings JSON
Contains the proxy settings in use by a session.
{
"proxy": "localhost:9150",
"use_tor": true
}
- proxy:
The proxy connection being used to pass network traffic through, or an empty string.
- use_tor:
trueif Tor is enabled,falseotherwise.
Login credentials JSON
Contains the authentication details used to create and login to a wallet
via GA_register_user or GA_login_user. Also returned from GA_get_credentials
where it contains the credentials used to login, and for Liquid sessions, the
element "master_blinding_key" will be present and hold the
wallets SLIP 77
master blinding key if it is available.
To authenticate with a hardware wallet, pass empty JSON and provide HW device JSON.
To authenticate with a mnemonic and optional password:
{
"mnemonic": "moral lonely ability sail balance simple kid girl inhale master dismiss round about aerobic purpose shiver silly happy kitten track kind pattern nose noise",
"password": ""
}
Or, with a mnemonic and optional BIP39 passphrase:
{
"mnemonic": "moral lonely ability sail balance simple kid girl inhale master dismiss round about aerobic purpose shiver silly happy kitten track kind pattern nose noise",
"bip39_passphrase": ""
}
To authenticate with a PIN:
{
"pin": "123456",
"pin_data": {
"encrypted_data": "0b39c1e90ca6adce9ff35d1780de74b91d46261a7cbf2b8d2fdc21528c068c8e2b26e3bf3f6a2a992e0e1ecfad0220343b9659495e7f4b21ff95c32cee1b2dd6b0f44b3828ccdc73d68d9e4142a25437b0c6b53a056e2415ca23442dd18d11fb5f62ef9155703c36a5b3e10b2d93973602cebb2369559612cb4267f4826028cea7b067d6ec3658cc72155a4b17b4ba277c143d40ce49c407102c62ca759d04e74dd0778ac514292be09f66449993c36b0bc0cb78f41368bc394d0cf444d452bea0e7df5766b92a3c3a3c57169c2529e9aa36e89b3f6dfcfddc6027f3aabd47dedbd9851729a3f6fba899842b1f5e949117c62e94f558da5ebd37feb4927209e2ead2d492c1d647049e8a1347c46c75411a14c5420ef6896cd0d0c6145af76668d9313f3e71e1970de58f674f3b387e4c74d24214fbc1ad7d30b3d2db3d6fb7d9e92dd1a9f836dad7c2713dc6ebfec62f",
"pin_identifier": "38e2f188-b3a8-4d98-a7f9-6c348cb54cfe",
"salt": "a99/9Qy6P7ON4Umk2FafVQ=="
}
}
- pin:
The PIN entered by the user to unlock the wallet.
- pin_data:
See PIN data JSON.
To authenticate a watch-only user:
{
"username": "my_watch_only_username",
"password": "my_watch_only_password"
}
To authenticate a descriptor watch-only wallet (singlesig only):
{
"core_descriptors": ["pkh([00000000/44'/1'/0']tpubDC2Q4xK4XH72J7Lkp6kAvY2Q5x4cxrKgrevkZKC2FwWZ9A9qA5eY6kvv6QDHb6iJtByzoC5J8KZZ29T45CxFz2Gh6m6PQoFF3DqukrRGtj5/0/*"],
}
Or alternatively:
{
"slip132_extended_pubkeys": ["tpubDC2Q4xK4XH72J7Lkp6kAvY2Q5x4cxrKgrevkZKC2FwWZ9A9qA5eY6kvv6QDHb6iJtByzoC5J8KZZ29T45CxFz2Gh6m6PQoFF3DqukrRGtj5"],
}
The values to use for "core_descriptors" and "slip132_extended_pubkeys" can be
obtained by calling GA_get_subaccount from a non-descriptor watch-only session.
Register/Login result JSON
Contains wallet identifiers and any warnings resulting from registering or
logging in to a wallet with GA_register_user/GA_login_user. Also returned
by GA_get_wallet_identifier to get identifiers without logging in.
Example
{
"wallet_hash_id": "3cc371810dfa275a8654d4d70986c2d92ce229d611c9ab2da0ab40ea9a0da1bb",
"warnings": [],
"xpub_hash_id": "cd2474f9b6bffbbbac45179c6bce45436370264a1607880f5a56e70a016ba08a"
}
- wallet_hash_id:
A 32 byte, per-network unique identifier for the wallet, as a hex string.
- xpub_hash_id:
A 32 byte, cross-network unique identifier for the wallet, as a hex string.
- warnings:
An array of warning strings for the wallet/GDK version, or empty if there are no warnings. Only returned when registering or logging in.
HW device JSON
Describes the capabilities of an external signing device.
{
"device": {
"name": "Ledger",
"supports_ae_protocol": 0,
"supports_arbitrary_scripts": true,
"supports_host_unblinding": false,
"supports_external_blinding": false,
"supports_liquid": 1,
"supports_low_r": false,
}
}
- name:
The unique name of the hardware device.
- supports_arbitrary_scripts:
True if the device can sign non-standard scripts such as CSV.
- supports_low_r:
True if the device can produce low-R ECDSA signatures. Note that all signing devices must produce low-S signatures to comply with network standardness rules.
- supports_liquid:
0 if the device does not support Liquid, 1 otherwise.
- supports_host_unblinding:
True if the device supports returning the Liquid master blinding key.
- supports_external_blinding:
True if the device supports blinding and signing Liquid transactions with outputs that are already blinded from another wallet (e.g. 2-step swaps).
- supports_ae_protocol:
See “ae_protocol_support_level” enum in the gdk source for details.
The default for any value not provided is false or 0.
PIN data JSON
Contains the data returned by GA_encrypt_with_pin. The caller must persist this
data and pass it to GA_login_user along with the users PIN in order to
allow a PIN login.
{
"encrypted_data": "0b39c1e90ca6adce9ff35d1780de74b91d46261a7cbf2b8d2fdc21528c068c8e2b26e3bf3f6a2a992e0e1ecfad0220343b9659495e7f4b21ff95c32cee1b2dd6b0f44b3828ccdc73d68d9e4142a25437b0c6b53a056e2415ca23442dd18d11fb5f62ef9155703c36a5b3e10b2d93973602cebb2369559612cb4267f4826028cea7b067d6ec3658cc72155a4b17b4ba277c143d40ce49c407102c62ca759d04e74dd0778ac514292be09f66449993c36b0bc0cb78f41368bc394d0cf444d452bea0e7df5766b92a3c3a3c57169c2529e9aa36e89b3f6dfcfddc6027f3aabd47dedbd9851729a3f6fba899842b1f5e949117c62e94f558da5ebd37feb4927209e2ead2d492c1d647049e8a1347c46c75411a14c5420ef6896cd0d0c6145af76668d9313f3e71e1970de58f674f3b387e4c74d24214fbc1ad7d30b3d2db3d6fb7d9e92dd1a9f836dad7c2713dc6ebfec62f",
"pin_identifier": "38e2f188-b3a8-4d98-a7f9-6c348cb54cfe",
"salt": "a99/9Qy6P7ON4Umk2FafVQ=="
}
Encrypt with PIN JSON
{
"pin": "...",
"plaintext": {}
}
- pin:
The PIN to protect the server provided key.
- plaintext:
The json to encrypt. For instance it can be the Login credentials JSON with the mnemonic.
Encrypt with PIN Result JSON
{
"pin_data": "...",
}
- pin_data:
See PIN data JSON.
Decrypt with PIN JSON
{
"pin": "...",
"pin_data": "...",
}
- pin:
The PIN that protects the server provided key.
- pin_data:
See PIN data JSON.
RSA Verify JSON
Contains the details required to perform RSA challenge verification by GA_rsa_verify.
{
"pem": "...",
"challenge": "...",
"signature": "..."
}
- pem:
The PEM containing the public key that
"signature"should sign for.- challenge:
The challenge that
"signature"should be a valid signature for, hex encoded.- signature:
The signature that signs
"challenge"with the private key corresponding to the public key in"pem", hex encoded.
RSA Verify Result JSON
Contains the result of an RSA challenge verification by GA_rsa_verify.
{
"result": true,
"error": ""
}
- result:
trueif the verification succeeded,falseotherwise.- error:
A text description of the error that occurred, if any. When empty, the
"result"value alone determines whether verification succeeded.
Wallet identifier request JSON
Describes the wallet to compute an identifier for using GA_get_wallet_identifier.
You may pass Login credentials JSON to compute an identifier from a mnemonic
and optional password, note that PIN or watch-only credentials cannot be used.
otherwise, pass the wallets master xpub as follows:
{
"master_xpub": "tpubD8G8MPH9RK9uk4EV97RxhzaY8SJPUWXnViHUwji92i8B7vYdht797PPDrJveeathnKxonJe8SbaScAC1YJ8xAzZbH9UvywrzpQTQh5pekkk",
}
- master_xpub:
The base58-encoded BIP32 extended master public key of the wallet.
Get credentials JSON
Accepts an optional password to encrypt the mnemonic.
{
"password": ""
}
Subaccount JSON
Describes a subaccount within the users wallet. Returned by GA_get_subaccount and
as the array elements of GA_get_subaccounts.
Multisig example
{
"hidden": false,
"name": "Example subaccount name",
"pointer": 0,
"receiving_id": "GA2d1AMZojZ3TtoTsYw1JjFUeZQrfT",
"recovery_xpub": "",
"required_ca": 0,
"type": "2of2",
"user_path": []
}
Singlesig example
{
"bip44_discovered": false,
"core_descriptors": [
"sh(wpkh([386e8558/49'/1'/0']tpubDC2Q4xK4XH72GCMj4pLC95ZyDaset6YG6wtEpo6avjWg3uP25RskxXYt9WeNbCEWrd183N6hb5dGhsrsg9y8f9JFXx3VKTtxBmEpgLWMcHh/0/*))#fl5guxrs",
"sh(wpkh([386e8558/49'/1'/0']tpubDC2Q4xK4XH72GCMj4pLC95ZyDaset6YG6wtEpo6avjWg3uP25RskxXYt9WeNbCEWrd183N6hb5dGhsrsg9y8f9JFXx3VKTtxBmEpgLWMcHh/1/*))#u767yek0"
],
"hidden": false,
"name": "Example subaccount name",
"pointer": 0,
"receiving_id": "",
"required_ca": 0,
"slip132_extended_pubkey": "upub5D9ydiUdMxX8SWbX7YzEJtx6NZLf4r4hoyjH84MnSod99KGdFEXywtudqrgq4yKWqo7oBMo9fzjaMqXa8CsrNzo9sLCutCnFndTUkZddR3v",
"type": "p2sh-p2wpkh",
"user_path": [
2147483697,
2147483649,
2147483648
]
}
Multisig Liquid example
{
"hidden": false,
"name": "Example subaccount name",
"pointer": 0,
"receiving_id": "GA2G8fjDNWvZiJP8Y5iV2ywTAQeZeo",
"recovery_xpub": "",
"required_ca": 0,
"type": "2of2",
"user_path": []
}
Singlesig Liquid example
{
"bip44_discovered": false,
"core_descriptors": [
"ct(slip77(55fa38cb2b21bcbb038260c045edbdad73d733114f44e598cadbf9d21599e959),elsh(wpkh([386e8558/49'/1'/0']tpubDC2Q4xK4XH72GCMj4pLC95ZyDaset6YG6wtEpo6avjWg3uP25RskxXYt9WeNbCEWrd183N6hb5dGhsrsg9y8f9JFXx3VKTtxBmEpgLWMcHh/0/*)))#kqd9xf5d",
"ct(slip77(55fa38cb2b21bcbb038260c045edbdad73d733114f44e598cadbf9d21599e959),elsh(wpkh([386e8558/49'/1'/0']tpubDC2Q4xK4XH72GCMj4pLC95ZyDaset6YG6wtEpo6avjWg3uP25RskxXYt9WeNbCEWrd183N6hb5dGhsrsg9y8f9JFXx3VKTtxBmEpgLWMcHh/1/*)))#xx85kep5"
],
"hidden": false,
"name": "Example subaccount name",
"pointer": 0,
"receiving_id": "",
"required_ca": 0,
"type": "p2sh-p2wpkh",
"user_path": [
2147483697,
2147483649,
2147483648
]
}
- hidden:
Whether the subaccount is hidden.
- name:
The name of the subaccount.
- pointer:
The subaccount number.
- receiving_id:
The Green receiving ID for the subaccount.
- recovery_xpub:
For
"2of3"subaccounts, the BIP32 xpub of the users recovery key. For all other subaccount types this value is empty.- required_ca:
For
"2of2_no_recovery"subaccounts, the number of confidential addresses that the user must upload to the server before transacting.- type:
For multisig subaccounts, one of
"2of2","2of3"or"2of2_no_recovery". For singlesig subaccounts, one of"p2pkh","p2wpkh"or"p2sh-p2wpkh".- bip44_discovered:
Singlesig only. Whether or not this subaccount contains at least one transaction.
- user_path:
The BIP32 path for this subaccount.
- core_descriptors:
Singlesig only. The Bitcoin Core compatible output descriptors. One for the external chain and one for internal chain (change), for instance
"sh(wpkh(tpubDC2Q4xK4XH72H18SiEV2A6HUwUPLhXiTEQXU35r4a41ZVrUv2cgKUMm2fsKTapi8DH4Y8ZVjy8TQtmyWMuH37kjw8fQGJahjWbuQoPm6qRF/0/*))""sh(wpkh(tpubDC2Q4xK4XH72H18SiEV2A6HUwUPLhXiTEQXU35r4a41ZVrUv2cgKUMm2fsKTapi8DH4Y8ZVjy8TQtmyWMuH37kjw8fQGJahjWbuQoPm6qRF/1/*))"for ap2sh-p2wpkhsubaccount.- slip132_extended_pubkey:
Singlesig and Bitcoin only. The extended public key with modified version as specified in SLIP-0132 (xpub, ypub, zpub, tpub, upub, vpub). Use of this value is discouraged and this field might be removed in the future. Callers should use descriptors instead.
Note
Ledger sets some xpub fields incorrectly (e.g. always sets child number "0").
Thus if you’re using a Ledger device the returned "core_descriptors" and "slip132_extended_pubkey"
are “incorrect”, meaning that the xpub is different from xpubs returned by other signers
using the same secret (but the generated addresses are the same).
Subaccount update JSON
Describes updates to be made to a subaccount via GA_update_subaccount.
{
"hidden": true,
"name": "New name",
"subaccount": 1
}
- hidden:
If present, updates whether the subaccount will be marked hidden.
- name:
If present, updates the name of the subaccount.
- subaccount:
The subaccount to update.
Subaccounts list JSON
{
"subaccounts": [
{ },
{ }
]
}
- subaccounts:
An array of Subaccount JSON elements for each of the users subaccounts.
Transaction list JSON
Describes a users transaction history returned by GA_get_transactions.
Multisig example
{
"transactions": [
{
"block_height": 0,
"can_cpfp": true,
"can_rbf": false,
"created_at_ts": 1686640441208984,
"fee": 1430,
"fee_rate": 10000,
"inputs": [
{
"address": "bcrt1qsjtt6hv699fulumf0ravymecm8792shd6hz4kz",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"satoshi": 5000000000,
"subaccount": 0,
"subtype": 0
}
],
"memo": "",
"outputs": [
{
"address": "2N2zyKJEcAtqgHRdYFqCQDKZozDi5GY9wi5",
"address_type": "csv",
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"pointer": 1,
"pt_idx": 0,
"satoshi": 12340,
"subaccount": 0,
"subtype": 51840
},
{
"address": "2MuhZUoJcSa2XwjejYmrBkA2x5WqM7UcZgg",
"address_type": "",
"is_internal": false,
"is_output": true,
"is_relevant": false,
"is_spent": false,
"pointer": 0,
"pt_idx": 1,
"satoshi": 4999986230,
"subaccount": 0,
"subtype": 0
}
],
"rbf_optin": true,
"satoshi": {
"btc": 12340
},
"spv_verified": "disabled",
"transaction_vsize": 143,
"transaction_weight": 572,
"txhash": "1a45e3a1140b17b45277e7e1189ff8385c7e0fd4cd88a5840b15ee600d5dbc30",
"type": "incoming"
}
]
}
Singlesig example
{
"transactions": [
{
"block_height": 0,
"can_cpfp": false,
"can_rbf": false,
"created_at_ts": 1686597244463054,
"fee": 1430,
"fee_rate": 10052,
"inputs": [
{
"address": "bcrt1qsjtt6hv699fulumf0ravymecm8792shd6hz4kz",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"satoshi": 5000000000,
"script": "00148496bd5d9a2953cff36978fac26f38d9fc5542ed",
"subaccount": 0,
"subtype": 0
}
],
"memo": "",
"outputs": [
{
"address": "2N2whnPNT4fYtntAYNTWoCshDVBphCRzyH7",
"address_type": "",
"is_internal": false,
"is_output": true,
"is_relevant": false,
"is_spent": false,
"pointer": 0,
"pt_idx": 0,
"satoshi": 4999986230,
"script": "a9146a60f8f6cd77c44582c04b8912dcba06601503e087",
"subaccount": 0,
"subtype": 0
},
{
"address": "2MsHqxhz5fHt2QyvE8TgT1MvzDY9kdMH5Rz",
"address_type": "p2sh-p2wpkh",
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"pointer": 1,
"pt_idx": 1,
"satoshi": 12340,
"script": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"subtype": 0
}
],
"rbf_optin": true,
"satoshi": {
"btc": 12340
},
"spv_verified": "disabled",
"transaction_vsize": 143,
"transaction_weight": 569,
"txhash": "8a3974692b29237cb81f545a7891be89d73aed7d0038879da437623b0fd57584",
"type": "incoming"
}
]
}
Multisig Liquid example
{
"transactions": [
{
"block_height": 0,
"can_cpfp": true,
"can_rbf": false,
"created_at_ts": 1686642370218278,
"fee": 24920,
"fee_rate": 10000,
"inputs": [
{
"address": "ert1qer759naur22vw6tnssc2ey3eqg974um62nh0cq",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"subaccount": 0,
"subtype": 0
}
],
"memo": "",
"outputs": [
{
"address": "AzpsXif2CBq9WEtyZW5JR85LUEBXjvZXi2wx5EaKqXQ1cQh8Jo35fGva7MWcfQmkNZ3D2hZbXD3U16eF",
"address_type": "csv",
"amountblinder": "337fbb7a7c554a1a11a1fd58524a650811e6a2e655966e5e8870c6aa5bc220c3",
"asset_id": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"asset_tag": "0aec3e557312bbe41d1ead85eb9e2a741965f5fb7426a398c882c8bb9b6eb0a1d9",
"assetblinder": "0ea4abfc0c7c36929a6d051d9694ac58a5c57a571af89bf34337a02e29552b7a",
"blinding_key": "033c13b87298d77941d6e4ec5c754a03a41a7c48ad4196e1e97a734d8646daa231",
"commitment": "09f9d304ce60ad52731ea60b64e069623c4df719062cc49f8d3a9e3ca06ef411b2",
"is_blinded": true,
"is_confidential": true,
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"nonce_commitment": "03b4ff371f4545ba5f1f9b58c6fea3ea99939c86f206ca594277a8d24d2d7333ed",
"pointer": 1,
"pt_idx": 0,
"satoshi": 12340,
"script": "a91469a22b9f6314c0fe6db92286592ec287ac52c03587",
"subaccount": 0,
"subtype": 65535,
"unconfidential_address": "XLyn55q1TtektRH3YrDTT8vMTMkjrcT38u"
},
{
"address": "ert1q0exrx3qfddfjgsv3un8vq0wkh7k4mvjyq48mcc",
"address_type": "",
"asset_tag": "0a633e984d81a08b8031a688ea5bea540fcdf08b0fb1a2c6ed1242b934804a40ab",
"commitment": "085aa714e5253c74d5701770d5c2e97f039c4780036c53dbb0b074659edfe18489",
"is_internal": false,
"is_output": true,
"is_relevant": false,
"is_spent": false,
"nonce_commitment": "025f28d0f5766008f1d2bbd19fcd54851d6c754bcef04ba6879649250f281fef2c",
"pointer": 0,
"pt_idx": 1,
"script": "00147e4c3344096b53244191e4cec03dd6bfad5db244",
"subaccount": 0,
"subtype": 0
},
{
"address": "",
"address_type": "",
"asset_tag": "0125b251070e29ca19043cf33ccd7324e2ddab03ecc4ae0b5e77c4fc0e5cf6c95a",
"commitment": "010000000000006158",
"is_internal": false,
"is_output": true,
"is_relevant": false,
"is_spent": false,
"nonce_commitment": "000000000000000000000000000000000000000000000000000000000000000000",
"pointer": 0,
"pt_idx": 2,
"script": "",
"subaccount": 0,
"subtype": 0
}
],
"rbf_optin": true,
"satoshi": {
"5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225": 12340
},
"spv_verified": "disabled",
"transaction_vsize": 2492,
"transaction_weight": 9968,
"txhash": "46dd2e84591e3a27c85d3ead917a1469dd09458fb1d76bce6b58885bf5d6ebbc",
"type": "incoming"
}
]
}
Singlesig Liquid example
{
"transactions": [
{
"block_height": 0,
"can_cpfp": false,
"can_rbf": false,
"created_at_ts": 1686599171553911,
"fee": 24920,
"fee_rate": 10002,
"inputs": [
{
"address": "",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"satoshi": 0,
"script": "",
"subaccount": 0,
"subtype": 0
}
],
"memo": "",
"outputs": [
{
"address": "ert1q82q9y0all6c08axd67yw9d85pea05szhh6jgzj",
"address_type": "",
"is_internal": false,
"is_output": true,
"is_relevant": false,
"is_spent": false,
"pointer": 0,
"pt_idx": 0,
"satoshi": 0,
"script": "00143a80523fbffeb0f3f4cdd788e2b4f40e7afa4057",
"subaccount": 0,
"subtype": 0
},
{
"address": "AzpjM6F3vhwPK3U5p8u79osjbhsduwdGCrbt1Cahy8nD3d7SbQJte99KiMkxWZLBrmUnWPrU3eLtUbVU",
"address_type": "p2sh-p2wpkh",
"amountblinder": "8efb0d0b21e6f14960f4c2affc166e50555f03bfc5ece3f2992b6ab4fd975caf",
"asset_id": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"assetblinder": "a986f588d8f05e337627bc780732efde594ad3cf32cb17e994dc7dcb25bc72fd",
"blinding_key": "020de79e60d9d17b22c9f803455eb2fc48becc50fe76d32508bde357bf10c28a8a",
"is_blinded": true,
"is_confidential": true,
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"pointer": 1,
"pt_idx": 1,
"satoshi": 12340,
"script": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"subtype": 0,
"unconfidential_address": "XBPrpZvDkTp1TY3kAhNtLBzo4Vycb9BsQt"
},
{
"address": "",
"address_type": "",
"is_internal": false,
"is_output": true,
"is_relevant": false,
"is_spent": false,
"pointer": 0,
"pt_idx": 2,
"satoshi": 0,
"script": "",
"subaccount": 0,
"subtype": 0
}
],
"rbf_optin": true,
"satoshi": {
"5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225": 12340
},
"spv_verified": "disabled",
"transaction_vsize": 2492,
"transaction_weight": 9966,
"txhash": "eea0ccc14f823dfcf6afcaf9f57db43aac294d675dd19bb3b563fc11ee169864",
"type": "incoming"
}
]
}
- transactions:
Top level container for the users transaction list.
- block_height:
The network block height that the transaction was confirmed in, or
0if the transaction is in the mempool.- can_cpfp:
A boolean indicating whether the user can CPFP the transaction.
- can_rbf:
A boolean indicating whether the use can RBF (bump) the transaction fee.
- created_at_ts:
The timestamp in microseconds from the Unix epoch when the transaction was seen by gdk or Green servers, or included in a block.
- fee:
The BTC or L-BTC network fee paid by the transaction in satoshi.
- fee_rate:
The fee rate in satoshi per thousand bytes.
- inputs:
- memo:
The users memo, if previously set by
GA_set_transaction_memo.- outputs:
- rbf_optin:
A boolean indicating whether the transaction is RBF-enabled.
- satoshi:
A map of asset names to the signed satoshi total for that asset in the transaction. Negative numbers represent outgoing amounts, positive incoming.
- spv_verified:
The SPV status of the transaction, one of
"in_progress","verified","not_verified","disabled","not_longest"or"unconfirmed".- transaction_vsize:
The size of the transaction in vbytes.
- transaction_weight:
The weight of the transaction.
- txhash:
The txid of the transaction.
- type:
One of
"incoming","outgoing","mixed"or"not unblindable".
Transaction list input element
Describes a transaction input in Transaction list JSON.
Multisig example
{
"address": "bcrt1qsjtt6hv699fulumf0ravymecm8792shd6hz4kz",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"satoshi": 5000000000,
"subaccount": 0,
"subtype": 0
}
Singlesig example
{
"address": "bcrt1qsjtt6hv699fulumf0ravymecm8792shd6hz4kz",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"satoshi": 5000000000,
"script": "00148496bd5d9a2953cff36978fac26f38d9fc5542ed",
"subaccount": 0,
"subtype": 0
}
Multisig Liquid example
{
"address": "ert1qer759naur22vw6tnssc2ey3eqg974um62nh0cq",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"subaccount": 0,
"subtype": 0
}
Singlesig Liquid example
{
"address": "",
"address_type": "",
"is_internal": false,
"is_output": false,
"is_relevant": false,
"is_spent": true,
"pointer": 0,
"pt_idx": 0,
"satoshi": 0,
"script": "",
"subaccount": 0,
"subtype": 0
}
- address:
For user wallet addresses, the wallet address in base58, bech32 or blech32 encoding.
- addressee:
Optional, multisig only. For historical social payments, the account name sent from.
- address_type:
For user wallet addresses, One of
"csv","p2sh","p2wsh"(multisig), or"p2pkh","p2sh-p2wpkh","p2wpkh"(singlesig), indicating the type of address.- is_internal:
Whether or not the user key belongs to the internal chain. Always false for multisig.
- is_output:
Always false. Deprecated, will be removed in a future release.
- is_relevant:
A boolean indicating whether the input relates to the subaccount the caller passed to
GA_get_transactions.- is_spent:
Always true. Deprecated, will be removed in a future release.
- pointer:
For user wallet addresses, the address number/final number in the address derivation path.
- pt_idx:
Deprecated, will be removed in a future release.
- satoshi:
The amount of the input in satoshi.
- subaccount:
For user wallet addresses, the subaccount this output belongs to, or
0.- subtype:
For
"address_type""csv", the number of CSV blocks used in the receiving scriptpubkey.
Liquid inputs have additional fields:
- amountblinder:
The hex-encoded amount blinder (value blinding factor, vbf).
- asset_id:
The hex-encoded asset id in display format.
- asset_tag:
The hex-encoded asset commitment.
- assetblinder:
The hex-encoded asset blinder (asset blinding factor, abf).
- commitment:
The hex-encoded value commitment.
- is_blinded:
A boolean indicating whether or not the input is blinded.
- nonce_commitment:
The hex-encoded nonce commitment.
- previdx:
The output index of the transaction containing the output representing this input.
- prevpointer:
Deprecated, will be removed in a future release.
- prevsubaccount:
Deprecated, will be removed in a future release.
- prevtxhash:
The txid of the transaction containing the output representing this input.
- script:
The scriptpubkey of the output representing this input.
Transaction list output element
Describes a transaction output in Transaction list JSON.
Multisig example
{
"address": "2N2zyKJEcAtqgHRdYFqCQDKZozDi5GY9wi5",
"address_type": "csv",
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"pointer": 1,
"pt_idx": 0,
"satoshi": 12340,
"subaccount": 0,
"subtype": 51840
}
Singlesig example
{
"address": "2MsHqxhz5fHt2QyvE8TgT1MvzDY9kdMH5Rz",
"address_type": "p2sh-p2wpkh",
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"pointer": 1,
"pt_idx": 1,
"satoshi": 12340,
"script": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"subtype": 0
}
Multisig Liquid example
{
"address": "AzpsXif2CBq9WEtyZW5JR85LUEBXjvZXi2wx5EaKqXQ1cQh8Jo35fGva7MWcfQmkNZ3D2hZbXD3U16eF",
"address_type": "csv",
"amountblinder": "337fbb7a7c554a1a11a1fd58524a650811e6a2e655966e5e8870c6aa5bc220c3",
"asset_id": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"asset_tag": "0aec3e557312bbe41d1ead85eb9e2a741965f5fb7426a398c882c8bb9b6eb0a1d9",
"assetblinder": "0ea4abfc0c7c36929a6d051d9694ac58a5c57a571af89bf34337a02e29552b7a",
"blinding_key": "033c13b87298d77941d6e4ec5c754a03a41a7c48ad4196e1e97a734d8646daa231",
"commitment": "09f9d304ce60ad52731ea60b64e069623c4df719062cc49f8d3a9e3ca06ef411b2",
"is_blinded": true,
"is_confidential": true,
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"nonce_commitment": "03b4ff371f4545ba5f1f9b58c6fea3ea99939c86f206ca594277a8d24d2d7333ed",
"pointer": 1,
"pt_idx": 0,
"satoshi": 12340,
"script": "a91469a22b9f6314c0fe6db92286592ec287ac52c03587",
"subaccount": 0,
"subtype": 65535,
"unconfidential_address": "XLyn55q1TtektRH3YrDTT8vMTMkjrcT38u"
}
Singlesig Liquid example
{
"address": "AzpjM6F3vhwPK3U5p8u79osjbhsduwdGCrbt1Cahy8nD3d7SbQJte99KiMkxWZLBrmUnWPrU3eLtUbVU",
"address_type": "p2sh-p2wpkh",
"amountblinder": "8efb0d0b21e6f14960f4c2affc166e50555f03bfc5ece3f2992b6ab4fd975caf",
"asset_id": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"assetblinder": "a986f588d8f05e337627bc780732efde594ad3cf32cb17e994dc7dcb25bc72fd",
"blinding_key": "020de79e60d9d17b22c9f803455eb2fc48becc50fe76d32508bde357bf10c28a8a",
"is_blinded": true,
"is_confidential": true,
"is_internal": false,
"is_output": true,
"is_relevant": true,
"is_spent": false,
"pointer": 1,
"pt_idx": 1,
"satoshi": 12340,
"script": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"subtype": 0,
"unconfidential_address": "XBPrpZvDkTp1TY3kAhNtLBzo4Vycb9BsQt"
}
- address:
For user wallet addresses, the wallet address in base58, bech32 or blech32 encoding.
- address_type:
For user wallet output addresses, One of
"csv","p2sh","p2wsh"(multisig), or"p2pkh","p2sh-p2wpkh","p2wpkh"(singlesig), indicating the type of address.- is_internal:
Whether or not the user key belongs to the internal chain. Always false for multisig.
- is_output:
Always true. Deprecated, will be removed in a future release.
- is_relevant:
A boolean indicating whether the output relates to the subaccount the caller passed to
GA_get_transactions.- is_spent:
A boolean indicating if this output has been spent.
- pointer:
For user wallet addresses, the address number/final number in the address derivation path.
- pt_idx:
Deprecated, will be removed in a future release.
- satoshi:
The amount of the output in satoshi.
- subaccount:
For user wallet addresses, the subaccount this output belongs to, or
0.- subtype:
For
"address_type""csv", the number of CSV blocks used in the receiving scriptpubkey.
Liquid outputs have the following additional fields:
- amountblinder:
The hex-encoded amount blinder (value blinding factor, vbf).
- asset_id:
The hex-encoded asset id in display format.
- asset_tag:
The hex-encoded asset commitment.
- assetblinder:
The hex-encoded asset blinder (asset blinding factor, abf).
- blinding_key:
The blinding public key for the output.
- commitment:
The hex-encoded value commitment.
- is_blinded:
For user wallet outputs, a boolean indicating whether or not the output is blinded.
- is_confidential:
Whether or not the address in
"address"is a confidential address. Note that this does not indicate whether the output was originally sent to a confidential address (which is determined by"is_blinded"), only whether the"address"field is a confidential or non-confidential address, i.e. whether it contains the blinding public key or not.- nonce_commitment:
The hex-encoded nonce commitment.
- script:
For user wallet outputs, the scriptpubkey of this output.
- unconfidential_address:
For user wallet outputs, the non-confidential address corresponding to
address. This is provided for informational purposes only and should not be used to receive.
Transaction details JSON
Contains information about a transaction that may not be associated with the
users wallet. Returned by GA_get_transaction_details.
Multisig example
{
"transaction": "020000000001019b763a75636ba2deaefc5cc5cbb7dc201f45de5d2aa1ffcda6636ecc4528f5ca0000000000feffffff02343000000000000017a9146aff2fc8f5ec359f809b3355d6bdc5d30f8e10548736bc052a0100000017a9141aeb565e55f84835c5815bee5b7b2b31b3f6029c8702473044022057c4218260f4dc944a5a25fd3113890e0dca4222f3aff5915f3383fd7c63bc4102203f4c29cf40f3ae0ac3cb5cce92713d3613df237a4dc8520ed2fc40617ff600760121022dcbac960c21f79c69e0374669b609ada9a6b38d7bd5171d064e32da4c2b0aafc8000000",
"transaction_locktime": 200,
"transaction_version": 2,
"transaction_vsize": 143,
"transaction_weight": 569,
"txhash": "1a45e3a1140b17b45277e7e1189ff8385c7e0fd4cd88a5840b15ee600d5dbc30"
}
Singlesig example
{
"transaction": "02000000000101c7fc89a3a6b1568916f64c9e9abd77bd53d16daa4de758af8d8a54d19c45b9950000000000feffffff0236bc052a0100000017a9146a60f8f6cd77c44582c04b8912dcba06601503e087343000000000000017a914007edc4b1153a320e490b5fe29a33e95af2d3c73870247304402202023cd3653263959583686168b48cc5f570f34af06a36aef625ffaf50d15b4f102203e4e0d54fa9f6d7d2aef2886adfe57d4ecc7f679b09e12ed4c085cab923fc78a0121022dcbac960c21f79c69e0374669b609ada9a6b38d7bd5171d064e32da4c2b0aafc8000000",
"transaction_locktime": 200,
"transaction_version": 2,
"transaction_vsize": 143,
"transaction_weight": 569,
"txhash": "8a3974692b29237cb81f545a7891be89d73aed7d0038879da437623b0fd57584"
}
Multisig Liquid example
{
"transaction": "Transaction Hex, abbreviated here for length",
"transaction_locktime": 200,
"transaction_version": 2,
"transaction_vsize": 2492,
"transaction_weight": 9966,
"txhash": "46dd2e84591e3a27c85d3ead917a1469dd09458fb1d76bce6b58885bf5d6ebbc"
}
Singlesig Liquid example
{
"transaction": "Transaction Hex, abbreviated here for length",
"transaction_locktime": 200,
"transaction_version": 2,
"transaction_vsize": 2492,
"transaction_weight": 9966,
"txhash": "eea0ccc14f823dfcf6afcaf9f57db43aac294d675dd19bb3b563fc11ee169864"
}
Sign transaction JSON
Contains the details of a caller-generated transaction to sign.
To sign with a specific sighash, set "user_sighash" for the elements of
"transaction_inputs" you wish to sign with a certain sighash, otherwise
SIGHASH_ALL (1) will be used.
Set "skip_signing" to true for any input in "transaction_inputs"
you do not wish to have signed.
All other fields are not user-editable and should be passed unchanged.
Send transaction JSON
Contains the details of a caller-generated and signed transaction
from GA_sign_transaction to send to the network.
For multisig session, this will send via the Green backend service, signing any inputs that require service signatures before broadcasting.
All fields are not user-editable and should be passed unchanged.
Broadcast transaction JSON
Contains the details of a caller-generated and fully signed transaction
to send to the network via GA_broadcast_transaction.
Unlike GA_send_transaction, this call does not sign the server side of
Green multisig inputs before broadcasting. The caller must ensure the
transaction/PSBT is fully signed before calling.
This call can be used to broadcast transactions that are not related to the
users wallet. The "memo" element should be ommitted or blank in this case.
{
"transaction": "<transaction hex>",
"psbt": "<base64 PSBT>",
"memo": "sample memo",
"simulate_only": false
}
- transaction:
Optional. The fully signed transaction to broadcast, hex encoded. If not given, the
"psbt"element must be present.- psbt:
Optional. The fully signed PSBT or PSET representing the transaction to broadcast. If not given, the
"transaction"element must be present.- memo:
Optional. A transaction memo to store with the transaction. Should only be provided for transactions which include at least one wallet input or output.
- simulate_only:
Optional, defaults to
false. If set totrue, any PSBT given is finalized and extracted to populate the resulting"transaction"element. The"transaction"element is then parsed, and if valid, is returned (along with the finalized PSBT in the resulting"psbt"element if one was provided).
Broadcast transaction result JSON
Contains the result of calling GA_broadcast_transaction.
The returned data is a copy of the Broadcast transaction JSON given
when calling GA_broadcast_transaction, modified as follows:
The
"txhash"element is populated with the txid of the transaction.If a
"psbt"element was given, the value is updated to contain the given PSBT after finalization, and a"transaction"element is added containing the extracted final transaction hex.
Create Swap Transaction JSON
Describes the swap to be created when calling GA_create_swap_transaction.
{
"swap_type": "liquidex",
"input_type": "liquidex_v1",
"liquidex_v1": {},
"output_type": "liquidex_v1"
}
- swap_type:
Pass
"liquidex"to create the maker’s side of a LiquiDEX 2-step swap.- input_type:
Pass
"liquidex_v1"to pass LiquiDEX version 1 details.- liquidex_v1:
The LiquiDEX v1 specific parameters, see LiquiDEX Create Swap transaction JSON. This field must included only if
"input_type"is"liquidex_v1".- output_type:
Pass
"liquidex_v1"to return LiquiDEX proposal JSON version 1.
Create Swap Transaction Result JSON
If the "output_type" was "liquidex_v1" this field is LiquiDEX Create Swap Transaction Result JSON.
Complete Swap Transaction JSON
Describes the swap to be completed when calling GA_complete_swap_transaction.
{
"swap_type": "liquidex",
"input_type": "liquidex_v1",
"liquidex_v1": {},
"output_type": "transaction",
"utxos": {},
}
- swap_type:
Pass
"liquidex"to complete the taker’s side of a LiquiDEX 2-step swap.- input_type:
Pass
"liquidex_v1"to pass a LiquiDEX proposal JSON version 1.- liquidex_v1:
The LiquiDEX v1 specific parameters, see LiquiDEX Complete Swap transaction JSON. This field must included only if
"input_type"is"liquidex_v1".- output_type:
Pass
"transaction"to return a transaction JSON that can be passed toGA_sign_transaction.- utxos:
Mandatory. The UTXOs to fund the transaction with, Unspent outputs JSON as returned by
GA_get_unspent_outputs. Note that coin selection is not performed on the passed UTXOs. All passed UTXOs of the same asset as the receiving asset id will be included in the transaction.
Complete Swap Transaction Result JSON
If the "output_type" was "transaction" this field is Sign transaction JSON.
Create Redeposit Transaction JSON
Passed to GA_create_redeposit_transaction to create a transaction that
re-deposits expired UTXOs in order to maintain two factor protection.
{
"utxos": [],
"expired_at": 99999,
"expires_in": 144,
"fee_rate": 1000,
"fee_subaccount": 0
}
- utxos:
Mandatory. The UTXOs that should be re-deposited, Unspent outputs JSON as returned by
GA_get_unspent_outputs. Non-expired UTXOs will be ignored, except for L-BTC UTXOs that may be required for fees when re-depositing assets. For Liquid, all assets except L-BTC must come from the same subaccount.- expired_at:
Optional. If given, only re-deposit UTXOs where two factor authentication expires by the given block. Defaults to the current block height if ommitted.
- expires_in:
Optional, may only be given if
"expired_at"is excluded. If present, the number of blocks given is added to the current block height to determine the expiry height to check as"expired_at".- fee_rate:
Optional. The fee rate in satoshi per thousand bytes.
- fee_subaccount:
Optional. If given, change from fees will be sent to this suabaccount. Otherwise, fee change is sent to the subaccount of the first fee UTXO used.
Create Redeposit Transaction Result JSON
The result JSON is a complete transaction ready to be signed with GA_sign_transaction,
(after blinding with GA_blind_transaction if creating a Liquid transaction).
Sign PSBT JSON
{
"psbt": "...",
"utxos": [],
"blinding_nonces": [],
}
- psbt:
The PSBT or PSET encoded in base64 format.
- utxos:
Mandatory. The UTXOs that should be signed, Unspent outputs JSON as returned by
GA_get_unspent_outputs. UTXOs that are not inputs of the PSBT/PSET can be included. Caller can avoid signing an input by not passing in its UTXO.- blinding_nonces:
For
"2of2_no_recovery"subaccounts only, the blinding nonces in hex format for all outputs.
Sign PSBT Result JSON
{
"psbt": "...",
"utxos": [],
}
- psbt:
The input PSBT or PSET in base64 format, with signatures added for all inputs signed.
- utxos:
The UTXOs corresponding to each signed input, in the order they appear in the PSBT transaction.
PSBT Get Details JSON
{
"psbt": "...",
"utxos": [],
}
- psbt:
The PSBT or PSET encoded in base64 format.
- utxos:
Mandatory. The UTXOs owned by the wallet, Unspent outputs JSON as returned by
GA_get_unspent_outputs. UTXOs that are not inputs of the PSBT/PSET can be included.
PSBT Get Details Result JSON
{
"inputs": [
{
"asset_id": "...",
"satoshi": 0,
"subaccount": 0,
},
],
"outputs": [
{
"asset_id": "...",
"satoshi": 0,
"subaccount": 0,
},
],
}
Note
Inputs and outputs might have additional fields that might be removed or changed in following releases.
Sign Message JSON
Describes a request for the wallet to sign a given message via GA_sign_message.
{
"address": "...",
"message": "..."
}
- address:
The address to use for the private key. Must be a singlesig address, and the address must belong to the wallet.
- message:
The message to sign.
Sign Message Result JSON
Returned by GA_sign_message.
{
"signature": "..."
}
- message:
The recoverable signature of the message encoded in base 64.
Fee estimates JSON
{"fees":[1000,10070,10070,10070,3014,3014,3014,2543,2543,2543,2543,2543,2543,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499]}
Two Factor Config JSON
Describes the wallets enabled two factor methods, current spending limits, and two factor reset status.
Multisig example (no two-factor methods enabled)
{
"all_methods": [
"email",
"sms",
"phone",
"gauth",
"telegram"
],
"any_enabled": false,
"email": {
"confirmed": false,
"data": "",
"enabled": false
},
"enabled_methods": [],
"gauth": {
"confirmed": false,
"data": "otpauth://totp/Green%20Testnet%20Dev?secret=MKPZQAYYAPZ6UGMIZSISDCPZK2ML6MNS",
"enabled": false
},
"limits": {
"bits": "0.00",
"btc": "0.00000000",
"fiat": "0.00",
"fiat_currency": "USD",
"fiat_rate": "1.10000000",
"is_current": true,
"is_fiat": false,
"mbtc": "0.00000",
"satoshi": 0,
"sats": "0",
"ubtc": "0.00"
},
"phone": {
"confirmed": false,
"data": "",
"enabled": false
},
"sms": {
"confirmed": false,
"data": "",
"enabled": false
},
"telegram": {
"confirmed": false,
"data": "",
"enabled": false
},
"twofactor_reset": {
"days_remaining": -1,
"is_active": false,
"is_disputed": false
}
}
Multisig example (all two-factor methods enabled)
{
"all_methods": [
"email",
"sms",
"phone",
"gauth"
],
"any_enabled": true,
"email": {
"confirmed": true,
"data": "sa***@my***",
"enabled": true
},
"enabled_methods": [
"email",
"sms",
"phone",
"gauth",
"telegram"
],
"gauth": {
"confirmed": true,
"data": "***",
"enabled": true
},
"limits": {
"bits": "0.00",
"btc": "0.00000000",
"fiat": "0.00",
"fiat_currency": "USD",
"fiat_rate": "1.10000000",
"is_current": true,
"is_fiat": false,
"mbtc": "0.00000",
"satoshi": 0,
"sats": "0",
"ubtc": "0.00"
},
"phone": {
"confirmed": true,
"data": "*** *** *89",
"enabled": true
},
"sms": {
"confirmed": true,
"data": "*** *** *89",
"enabled": true
},
"twofactor_reset": {
"days_remaining": -1,
"is_active": false,
"is_disputed": false
}
}
Singlesig example (two-factor and limits not available)
{
"all_methods": [],
"any_enabled": false,
"enabled_methods": [],
"limits": {
"bits": "0.00",
"btc": "0.00000000",
"fiat": "0.00",
"fiat_currency": "USD",
"fiat_rate": "1.10000000",
"is_current": true,
"is_fiat": false,
"mbtc": "0.00000",
"satoshi": 0,
"sats": "0",
"ubtc": "0.00"
},
"twofactor_reset": {
"days_remaining": -1,
"is_active": false,
"is_disputed": false
}
}
- all_methods:
An array containing all two factor methods available. For each available method in
"all_methods", a Two Factor Detail JSON element is returned with the current state of the method for the wallet.- any_enabled:
trueif any two factor method is enabled,falseotherwise.- enabled_methods:
An array containing all enabled two factor methods.
- limits:
Transaction limits JSON describing the users current limit.
- twofactor_reset/days_remaining:
The number of days remaining before the wallets two factor authentication is reset, or -1 if no reset procedure is underway.
- twofactor_reset/is_active:
Whether or not the wallet is currently undergoing the two factor reset procedure.
- twofactor_reset/is_disputed:
Whether or not the wallet two factor reset procedure is disputed.
Cache Control Request JSON
Describes the operation to perform on cached wallet data using GA_cache_control.
{
"action": "fetch",
"data_source": "client_blob"
}
- action:
The cache action to perform. Currently only
"fetch"is accepted.- data_source:
The data source to operate on as described below.
data_source |
Description |
|---|---|
|
Private user data stored encrypted in the users client blob. |
Cache Control Result JSON
Describes the result of a cache control operation requested via GA_cache_control.
for the action "fetch" with a data source of "client_blob", the following
data is returned:
{
"bip329": []
}
- bip329:
An array of BIP329 (https://github.com/bitcoin/bips/blob/master/bip-0329.mediawiki) compatible elements representing the users metadata. Note that in order to comply with BIP329 (e.g. for exporting the data), the caller must convert the array into JSON Lines format. See https://jsonlines.org for more details.
BCUR Encode JSON
Contains CBOR data to encode into UR format using GA_bcur_encode.
{
"ur_type": "crypto-seed",
"data": "A20150C7098580125E2AB0981253468B2DBC5202D8641947DA",
"max_fragment_len": 100
}
- ur_type:
The type of the CBOR-encoded data.
- data:
CBOR-encoded data in hex format.
- max_fragment_len:
The maximum size of each UR-encoded fragment to return.
Where data is longer than max_fragment_len, the result is a multi-part
encoding using approximately 3 times the minimum number of fragments needed to
decode the data, split into parts of size max_fragment_len or less.
In this case, the caller must provide all returned parts to any decoder, e.g. by generating an animated QR code from them.
Special case is for ur_type equal to crypto-psbt: data field is expected to be in base64 format.
BCUR Encoded fragments JSON
Contains UR format data encoded using GA_bcur_encode.
{
"parts": ["ur:crypto-seed/oeadgdstaslplabghydrpfmkbggufgludprfgmaotpiecffltnlpqdenos"]
}
- parts:
The resulting array of UR-encoded fragments representing the input CBOR.
BCUR Decode JSON
Contains UR encoded data to decode into CBOR using GA_bcur_decode.
{
"part": "ur:crypto-seed/oeadgdstaslplabghydrpfmkbggufgludprfgmaotpiecffltnlpqdenos",
"return_raw_data": true
}
- part:
Mandatory. The UR-encoded string for an individual part. For multi-part decoding, the parts can be provided in any order.
- return_raw_data:
Optional, default
false. Iftrue, return the raw CBOR byte data as a hex string in addition to any decoded data.
BCUR Decoding Auth Handler JSON
When further multi-part data is required to decode UR encoded data, the auth handler will request it from the caller using Auth handler status JSON as below:
"request_code" example:
{
"status": "resolve_code",
"action": "data",
"method": "data",
"name": "bcur_decode",
"auth_data": {
"estimated_progress": 35,
"received_indices": [0, 1, 2]
}
}
The caller should provide the requested data using GA_auth_handler_resolve_code as
follows:
"resolve_code" example:
"ur:jade-pin/1-4/lpadaacswecylb[...]"
BCUR Decoded data JSON
Contains CBOR data decoded from UR format using GA_bcur_decode.
The returned JSON depends on the type of the input as returned in
the ur_type element. If the type is not one of those listed below,
it is returned as if it were "bytes".
if "return_raw_data" was given as true when calling GA_bcur_decode,
decoded data will additionally contain a "data" element as detailed
in the "bytes" ur_type section below.
Example
{
"psbt": "cHNidP8BAJoCAAAAAljoeiG1ba8MI74=",
"ur_type": "crypto-psbt"
}
- ur_type:
“crypto-psbt”.
- psbt:
The psbt in base-64 format.
Example
{
"descriptor": "pkh(02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5)",
"ur_type": "crypto-output"
}
- ur_type:
“crypto-output”.
- descriptor:
The bitcoin output descriptor.
Example
{
"descriptors": [
"pkh([37b5eed4/44'/0'/0']xpub6CnQkivUEH9bSbWVWfDLCtigKKgnSWGaVSRyCbN2QNBJzuvHT1vUQpgSpY1NiVvoeNEuVwk748Cn9G3NtbQB1aGGsEL7aYEnjVWgjj9tefu/0/*)",
"sh(wpkh([37b5eed4/49'/0'/0']xpub6CtR1iF4dZPkEyXDwVf3HE74tSwXNMcHtBzX4gwz2UnPhJ54Jz5unHx2syYCCDkvVUmsmoYTmcaHXe1wJppvct4GMMaN5XAbRk7yGScRSte/0/*))"
],
"master_fingerprint": "37b5eed4",
"ur_type": "crypto-account"
}
- ur_type:
“crypto-account”.
- descriptors:
The list of all available descriptors for the account.
- master_fingerprint:
The BIP32 key fingerprint of the master key of the account.
Example
{
"data": "581770736274ff01009a020000000258e87a21b56daf0c23be",
"ur_type": "bytes"
}
- ur_type:
“bytes”.
- data:
The decoded bytes in hex format.
Example
{
"data": "581770736274ff01009a020000000258e87a21b56daf0c23be",
"ur_type": "custom"
}
- ur_type:
“custom”.
- data:
The decoded data in hex format.
Settings JSON
Contains the users settings returned from GA_get_settings, or passed
to GA_change_settings to update the users settings.
If a given key is ommitted when changing settings, that setting will remain unchanged. Settings that are not applicable to the session type are ignored.
Multisig example
{
"altimeout": 5,
"csvtime": 51840,
"nlocktime": 12960,
"notifications": {
"email_incoming": false,
"email_login": false,
"email_outgoing": false
},
"pricing": {
"currency": "USD",
"exchange": "BITSTAMP"
},
"required_num_blocks": 12,
"sound": true,
"unit": "BTC"
}
Singlesig example
{
"altimeout": 5,
"pricing": {
"currency": "USD",
"exchange": "BITFINEX"
},
"required_num_blocks": 12,
"sound": true,
"unit": "BTC"
}
Multisig Liquid example
{
"altimeout": 5,
"csvtime": 65535,
"nlocktime": 12960,
"notifications": {
"email_incoming": false,
"email_login": false,
"email_outgoing": false
},
"pricing": {
"currency": "USD",
"exchange": "BITSTAMP"
},
"required_num_blocks": 12,
"sound": true,
"unit": "BTC"
}
Singlesig Liquid example
{
"altimeout": 5,
"pricing": {
"currency": "USD",
"exchange": "BITFINEX"
},
"required_num_blocks": 12,
"sound": true,
"unit": "BTC"
}
- altimeout:
The time in seconds before the wallet should time out and disconnect. Defaults to
5.- csvtime:
Multisig Only. The number of blocks before CSV UTXOs expire. Defaults to the highest value in the
"csv_buckets"list in the network’s Network JSON. Can only be set from a full session.- nlocktime:
Multisig Only. The number of blocks before P2SH UTXOs expire. Defaults to
12960, must be between144and200000. Can only be set from a full session.- required_num_blocks:
The number of blocks to use for the default transaction fee estimate. Defaults to
12.- sound:
Whether the wallet should enable notification sounds if supported. Defaults to
true.- unit:
The users preferred unit for displaying coin amounts. Defaults to
"BTC", must be one of"btc","mbtc","ubtc","bits"or"sats".- notifications/email_login:
Multisig Only. Whether to email the user whenever a login is made. Defaults to
false. Can only be set from a full session.- notifications/email_incoming:
Multisig Only. Whether to email notifications of incoming transactions. Defaults to
false. Can only be set from a full session.- notifications/email_outgoing:
Multisig Only. Whether to email notifications of outgoing transactions. Defaults to
false. Can only be set from a full session.- pricing/currency:
The users preferred fiat currency for displaying fiat amounts. Defaults to
"USD", must be one of the values returned in Available currencies JSON for the chosen"exchange".- pricing/exchange:
The users preferred exchange source for fiat pricing. Defaults to
"BITSTAMP", must be one of the"per_exchange"keys returned in Available currencies JSON.
Receive address request JSON
Contains the query parameters for requesting an address using GA_get_receive_address.
{
"subaccount": 0,
"is_internal": false,
"ignore_gap_limit": false,
}
- subaccount:
Mandatory. The value of “pointer” from Subaccounts list JSON or Subaccount JSON for the subaccount to fetch addresses for.
- is_internal:
Optional, singlesig only. Whether or not the user key belongs to the internal chain.
- ignore_gap_limit:
Optional, singlesig only. Whether to allow squentially generated addresses to go beyond the
"gap_limit"passed to or defaulted byGA_connect. This is potentially dangerous as funds received on such addresses are not synced until an address within the gap_limit receives funds.
Receive address details JSON
Multisig example
{
"address": "2N2zyKJEcAtqgHRdYFqCQDKZozDi5GY9wi5",
"address_type": "csv",
"branch": 1,
"pointer": 1,
"script": "2102ea2fe5fcee6e1ada9ee3f4228ac1b83554cff618c8bc6ef64d9988e2f4bb13a1ad21023cebb0d3a3434d1df033c3c41e3d02f2e0b44a64c3d58519ca656b4f5363f591ac73640380ca00b268",
"scriptpubkey": "a9146aff2fc8f5ec359f809b3355d6bdc5d30f8e105487",
"service_xpub": "tpubEAUTpVqYYmDa5DQdXdJhaMyrvycVbpuCRdUTVifuG3ML5kbwujP3CdxGT1rVoDnFnxsxEv1aiVaEtuJzDBu1bNJk9mADeeR2rZ1HcCCzdyG",
"subaccount": 0,
"subtype": 51840,
"user_path": [
1,
1
]
}
Singlesig example
{
"address": "2MsHqxhz5fHt2QyvE8TgT1MvzDY9kdMH5Rz",
"address_type": "p2sh-p2wpkh",
"is_internal": false,
"pointer": 1,
"scriptpubkey": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"user_path": [
2147483697,
2147483649,
2147483648,
0,
1
]
}
Multisig Liquid example
{
"address": "AzpsXif2CBq9WEtyZW5JR85LUEBXjvZXi2wx5EaKqXQ1cQh8Jo35fGva7MWcfQmkNZ3D2hZbXD3U16eF",
"address_type": "csv",
"blinding_key": "033c13b87298d77941d6e4ec5c754a03a41a7c48ad4196e1e97a734d8646daa231",
"branch": 1,
"is_confidential": true,
"pointer": 1,
"script": "748c6321023cebb0d3a3434d1df033c3c41e3d02f2e0b44a64c3d58519ca656b4f5363f591ad6703ffff00b275682102ea2fe5fcee6e1ada9ee3f4228ac1b83554cff618c8bc6ef64d9988e2f4bb13a1ac",
"scriptpubkey": "a91469a22b9f6314c0fe6db92286592ec287ac52c03587",
"service_xpub": "tpubEAUTpVqYYmDa5DQdXdJhaMyrvycVbpuCRdUTVifuG3ML5kbwujP3CdxGT1rVoDnFnxsxEv1aiVaEtuJzDBu1bNJk9mADeeR2rZ1HcCCzdyG",
"subaccount": 0,
"subtype": 65535,
"unconfidential_address": "XLyn55q1TtektRH3YrDTT8vMTMkjrcT38u",
"user_path": [
1,
1
]
}
Singlesig Liquid example
{
"address": "AzpjM6F3vhwPK3U5p8u79osjbhsduwdGCrbt1Cahy8nD3d7SbQJte99KiMkxWZLBrmUnWPrU3eLtUbVU",
"address_type": "p2sh-p2wpkh",
"blinding_key": "020de79e60d9d17b22c9f803455eb2fc48becc50fe76d32508bde357bf10c28a8a",
"is_confidential": true,
"is_internal": false,
"pointer": 1,
"scriptpubkey": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"unconfidential_address": "XBPrpZvDkTp1TY3kAhNtLBzo4Vycb9BsQt",
"user_path": [
2147483697,
2147483649,
2147483648,
0,
1
]
}
- address:
The wallet address in base58, bech32 or blech32 encoding.
- address_type:
One of
"csv","p2sh","p2wsh"(multisig), or"p2pkh","p2sh-p2wpkh","p2wpkh"(singlesig), indicating the type of address.- branch:
Always
1, used in the address derivation path for subaccounts.- pointer:
The address number/final number in the address derivation path.
- script:
The locking script of the address.
- scriptpubkey:
The scriptpubkey of the address.
- subaccount:
The subaccount this address belongs to. Matches
"pointer"from Subaccounts list JSON or Subaccount JSON.- subtype:
For
"address_type""csv", the number of CSV blocks referenced in"script", otherwise, 0.- user_path:
The BIP32 path for the user key.
For Liquid addresses, the following additional fields are returned:
{
"blinding_key": "02a519491b130082a1abbe17395213b46dae43c3e1c05b7a3dbd2157bd83e88a6e",
"is_blinded": true,
"unconfidential_address": "XV4PaYgbaJdPnYaJDzE41TpbBF6yBieeyd"
}
- blinding_key:
The blinding key used to blind this address.
- is_blinded:
Always
true.- unconfidential_address:
The non-confidential address corresponding to
address. This is provided for informational purposes only and should not be used to receive.
Previous addresses request JSON
Contains the query parameters for requesting previously generated addresses using GA_get_previous_addresses.
{
"subaccount": 0,
"last_pointer": 0,
}
- subaccount:
Mandatory. The value of “pointer” from Subaccounts list JSON or Subaccount JSON for the subaccount to fetch addresses for.
- last_pointer:
The address pointer from which results should be returned. If this key is not present, the newest generated addresses are returned. If present, the “last_pointer” value from the resulting Previous addresses JSON should then be given, until sufficient pages have been fetched or the “last_pointer” key is not present indicating all addresses have been fetched.
- is_internal:
Singlesig only. Whether or not the user key belongs to the internal chain.
Previous addresses JSON
Contains a page of previously generated addresses, from newest to oldest.
Multisig example
{
"list": [
{
"address": "2N5oBDdNp9i3dyYXCEfimg4YE1d9hcWYc2T",
"address_type": "csv",
"branch": 1,
"pointer": 2,
"script": "210251b4473cc52200be514994986927632cfe04b2fbe6fba1a69a0ea835dc1fe2cead210325d8aed10e04b73aab80b9e738e3f3933d49de0238a4ff0a3395cd7f3e5ba65fac73640380ca00b268",
"scriptpubkey": "a91489ac8209bdfdd8229d3123215e5eac3f859a6e4f87",
"service_xpub": "tpubEAUTpVqYYmDa5DQdXdJhaMyrvycVbpuCRdUTVifuG3ML5kbwujP3CdxGT1rVoDnFnxsxEv1aiVaEtuJzDBu1bNJk9mADeeR2rZ1HcCCzdyG",
"subaccount": 0,
"subtype": 51840,
"tx_count": 0,
"user_path": [
1,
2
]
},
{
"address": "2N2zyKJEcAtqgHRdYFqCQDKZozDi5GY9wi5",
"address_type": "csv",
"branch": 1,
"pointer": 1,
"script": "2102ea2fe5fcee6e1ada9ee3f4228ac1b83554cff618c8bc6ef64d9988e2f4bb13a1ad21023cebb0d3a3434d1df033c3c41e3d02f2e0b44a64c3d58519ca656b4f5363f591ac73640380ca00b268",
"scriptpubkey": "a9146aff2fc8f5ec359f809b3355d6bdc5d30f8e105487",
"service_xpub": "tpubEAUTpVqYYmDa5DQdXdJhaMyrvycVbpuCRdUTVifuG3ML5kbwujP3CdxGT1rVoDnFnxsxEv1aiVaEtuJzDBu1bNJk9mADeeR2rZ1HcCCzdyG",
"subaccount": 0,
"subtype": 51840,
"tx_count": 0,
"user_path": [
1,
1
]
}
]
}
Singlesig example
{
"list": [
{
"address": "2MsHqxhz5fHt2QyvE8TgT1MvzDY9kdMH5Rz",
"address_type": "p2sh-p2wpkh",
"is_internal": false,
"pointer": 1,
"script": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"scriptpubkey": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"tx_count": 0,
"user_path": [
2147483697,
2147483649,
2147483648,
0,
1
]
},
{
"address": "2N4uHLYgfrtRTPQYJe8DHT69WgsUTYe6WSo",
"address_type": "p2sh-p2wpkh",
"is_internal": false,
"pointer": 0,
"script": "a9147fdbfc6f9f1ecd1d66f43a586af08330a73e3cf487",
"scriptpubkey": "a9147fdbfc6f9f1ecd1d66f43a586af08330a73e3cf487",
"subaccount": 0,
"tx_count": 0,
"user_path": [
2147483697,
2147483649,
2147483648,
0,
0
]
}
]
}
Multisig Liquid example
{
"list": [
{
"address": "AzpxKzziQPVEFaqgoTEofLfbDoCYopCs5LisZhbr56wTmkiTxaq4Ue4K9E6wBx6L9BvNUYaW8vobchSZ",
"address_type": "csv",
"blinding_key": "03ed3ed04c8e522af02a760ca8feb42ac8c298ee25d16718efce95dd530c59161c",
"branch": 1,
"is_confidential": true,
"pointer": 2,
"script": "748c63210325d8aed10e04b73aab80b9e738e3f3933d49de0238a4ff0a3395cd7f3e5ba65fad6703ffff00b27568210251b4473cc52200be514994986927632cfe04b2fbe6fba1a69a0ea835dc1fe2ceac",
"scriptpubkey": "a914e5c73e6d8119f62b31f8c1b7069e36088c2779f387",
"service_xpub": "tpubEAUTpVqYYmDa5DQdXdJhaMyrvycVbpuCRdUTVifuG3ML5kbwujP3CdxGT1rVoDnFnxsxEv1aiVaEtuJzDBu1bNJk9mADeeR2rZ1HcCCzdyG",
"subaccount": 0,
"subtype": 65535,
"tx_count": 0,
"unconfidential_address": "XYJCGnCEYhRzPwPfFyk433jUHKzKhvwNiD",
"user_path": [
1,
2
]
},
{
"address": "AzpsXif2CBq9WEtyZW5JR85LUEBXjvZXi2wx5EaKqXQ1cQh8Jo35fGva7MWcfQmkNZ3D2hZbXD3U16eF",
"address_type": "csv",
"blinding_key": "033c13b87298d77941d6e4ec5c754a03a41a7c48ad4196e1e97a734d8646daa231",
"branch": 1,
"is_confidential": true,
"pointer": 1,
"script": "748c6321023cebb0d3a3434d1df033c3c41e3d02f2e0b44a64c3d58519ca656b4f5363f591ad6703ffff00b275682102ea2fe5fcee6e1ada9ee3f4228ac1b83554cff618c8bc6ef64d9988e2f4bb13a1ac",
"scriptpubkey": "a91469a22b9f6314c0fe6db92286592ec287ac52c03587",
"service_xpub": "tpubEAUTpVqYYmDa5DQdXdJhaMyrvycVbpuCRdUTVifuG3ML5kbwujP3CdxGT1rVoDnFnxsxEv1aiVaEtuJzDBu1bNJk9mADeeR2rZ1HcCCzdyG",
"subaccount": 0,
"subtype": 65535,
"tx_count": 0,
"unconfidential_address": "XLyn55q1TtektRH3YrDTT8vMTMkjrcT38u",
"user_path": [
1,
1
]
}
]
}
Singlesig Liquid example
{
"list": [
{
"address": "AzpjM6F3vhwPK3U5p8u79osjbhsduwdGCrbt1Cahy8nD3d7SbQJte99KiMkxWZLBrmUnWPrU3eLtUbVU",
"address_type": "p2sh-p2wpkh",
"blinding_key": "020de79e60d9d17b22c9f803455eb2fc48becc50fe76d32508bde357bf10c28a8a",
"is_confidential": true,
"is_internal": false,
"pointer": 1,
"script": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"scriptpubkey": "a914007edc4b1153a320e490b5fe29a33e95af2d3c7387",
"subaccount": 0,
"tx_count": 0,
"unconfidential_address": "XBPrpZvDkTp1TY3kAhNtLBzo4Vycb9BsQt",
"user_path": [
2147483697,
2147483649,
2147483648,
0,
1
]
},
{
"address": "AzprjS3xmCowJRJrZQtqufRjLtsHztgVAAE3Z2ChTLrDb8jWEK3RX2yWLZnFZyvDHfYJVqtaMhQYfyCE",
"address_type": "p2sh-p2wpkh",
"blinding_key": "031e9bdbe8710e94a18193f91a5bb9f22e13f84581a7b6d51db340b421907ee546",
"is_confidential": true,
"is_internal": false,
"pointer": 0,
"script": "a9147fdbfc6f9f1ecd1d66f43a586af08330a73e3cf487",
"scriptpubkey": "a9147fdbfc6f9f1ecd1d66f43a586af08330a73e3cf487",
"subaccount": 0,
"tx_count": 0,
"unconfidential_address": "XP1JCQcox4MSRxfpgMuimvDKXqJKWSxxWv",
"user_path": [
2147483697,
2147483649,
2147483648,
0,
0
]
}
]
}
- last_pointer:
If present indicates that there are more addresses to be fetched, and the caller to get the next page should call again
GA_get_previous_addressespassing this value in Previous addresses request JSON. If not present there are no more addresses to fetch.- list:
Contains the current page of addresses in Receive address details JSON format.
Unspent outputs request JSON
Describes which unspent outputs to return from GA_get_unspent_outputs,
or which unspent outputs to include in the balance returned by GA_get_balance.
{
"subaccount": 3,
"num_confs": 0,
"address_type": "csv",
"all_coins": false,
"expired_at": 99999,
"expires_in": 144,
"confidential": false,
"dust_limit": 546,
"sort_by": "newest"
}
- subaccount:
The subaccount to fetch unspent outputs for.
- num_confs:
Pass
0for unconfirmed UTXOs or1for confirmed.- address_type:
If given, one of
"csv","p2sh","p2wsh"(multisig), or"p2pkh","p2sh-p2wpkh","p2wpkh"(singlesig), indicating the type of addresses to return. Defaults to blank (no address filtering).- all_coins:
Pass
trueto include UTXOs with statusfrozen. Defaults tofalse.- expired_at:
Optional. If given, only UTXOs where two factor authentication expires by the given block are returned.
- expires_in:
Optional, may only be given if
"expired_at"is excluded. If present, the number of blocks given is added to the current block height to determine the expiry height to check as"expired_at".- confidential:
Pass
trueto include only confidential UTXOs. Defaults tofalse.- dust_limit:
If given, only UTXOs with a value greater than the limit value are returned.
- sort_by:
One of
"oldest","newest","largest","smallest". Returns the unspent outputs sorted by block height or value respectively. If not given, defaults to"oldest"for 2of2 subaccounts and"largest"for other subaccount types.
Unspent outputs for private key request JSON
Describes the private key to search for unspent outputs for
with GA_get_unspent_outputs_for_private_key.
{
"private_key": "6PRK95NQL1rJWZYegfeY1x2vPdsWFsiDDJTziatqkpVFeYi3osJDtiQiw9",
"password": "foobar"
}
- private_key:
Mandatory. The private key in WIF or BIP 38 format. If you want to sweep “p2wpkh”/”p2sh-p2wpkh” outputs, prefix the WIF key with
"p2wpkh:"/"p2wpkh-p2sh:".- password:
Optional. The password the key is encrypted with, if any.
Unspent outputs JSON
Contains unspent outputs for the wallet as requested by GA_get_unspent_outputs.
Multisig example
{
"unspent_outputs": {
"btc": [
{
"address_type": "csv",
"block_height": 0,
"is_internal": false,
"pointer": 1,
"prevout_script": "2102ea2fe5fcee6e1ada9ee3f4228ac1b83554cff618c8bc6ef64d9988e2f4bb13a1ad21023cebb0d3a3434d1df033c3c41e3d02f2e0b44a64c3d58519ca656b4f5363f591ac73640380ca00b268",
"pt_idx": 0,
"satoshi": 12340,
"subaccount": 0,
"subtype": 51840,
"txhash": "1a45e3a1140b17b45277e7e1189ff8385c7e0fd4cd88a5840b15ee600d5dbc30",
"user_status": 0
}
]
}
}
Singlesig example
{
"unspent_outputs": {
"btc": [
{
"address_type": "p2sh-p2wpkh",
"block_height": 0,
"is_internal": false,
"pointer": 1,
"prevout_script": "76a9144d2af219985cd7e523cf1be0421636fe4f38f4b788ac",
"pt_idx": 1,
"public_key": "030e18cc1d6474e092264aa44e7b81ce1068f2b12ec748c96f217d8de5cb2555dc",
"satoshi": 12340,
"subaccount": 0,
"txhash": "8a3974692b29237cb81f545a7891be89d73aed7d0038879da437623b0fd57584",
"user_path": [
2147483697,
2147483649,
2147483648,
0,
1
]
}
]
}
}
Multisig Liquid example
{
"unspent_outputs": {
"5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225": [
{
"address_type": "csv",
"amountblinder": "337fbb7a7c554a1a11a1fd58524a650811e6a2e655966e5e8870c6aa5bc220c3",
"asset_id": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"asset_tag": "0aec3e557312bbe41d1ead85eb9e2a741965f5fb7426a398c882c8bb9b6eb0a1d9",
"assetblinder": "0ea4abfc0c7c36929a6d051d9694ac58a5c57a571af89bf34337a02e29552b7a",
"block_height": 0,
"commitment": "09f9d304ce60ad52731ea60b64e069623c4df719062cc49f8d3a9e3ca06ef411b2",
"is_blinded": true,
"is_confidential": false,
"is_internal": false,
"nonce_commitment": "03b4ff371f4545ba5f1f9b58c6fea3ea99939c86f206ca594277a8d24d2d7333ed",
"pointer": 1,
"prevout_script": "748c6321023cebb0d3a3434d1df033c3c41e3d02f2e0b44a64c3d58519ca656b4f5363f591ad6703ffff00b275682102ea2fe5fcee6e1ada9ee3f4228ac1b83554cff618c8bc6ef64d9988e2f4bb13a1ac",
"pt_idx": 0,
"satoshi": 12340,
"script": "a91469a22b9f6314c0fe6db92286592ec287ac52c03587",
"subaccount": 0,
"subtype": 65535,
"txhash": "46dd2e84591e3a27c85d3ead917a1469dd09458fb1d76bce6b58885bf5d6ebbc",
"user_status": 0
}
]
}
}
Singlesig Liquid example
{
"unspent_outputs": {
"5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225": [
{
"address_type": "p2sh-p2wpkh",
"amountblinder": "8efb0d0b21e6f14960f4c2affc166e50555f03bfc5ece3f2992b6ab4fd975caf",
"asset_id": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"asset_tag": "0a552d971ca55f71e25de1f4961f0646445ec7233f060af79db1ed5d1b7944adc1",
"assetblinder": "a986f588d8f05e337627bc780732efde594ad3cf32cb17e994dc7dcb25bc72fd",
"block_height": 0,
"commitment": "091a8f5a5542d635303eaa52cf6ed0cf32d084be85fe292266427dfb7e97277111",
"is_blinded": true,
"is_confidential": false,
"is_internal": false,
"nonce_commitment": "026500ef0c14658df948d9f99d76c37724377f9f66860c2d3b67bc47be4e763a3f",
"pointer": 1,
"prevout_script": "76a9144d2af219985cd7e523cf1be0421636fe4f38f4b788ac",
"pt_idx": 1,
"public_key": "030e18cc1d6474e092264aa44e7b81ce1068f2b12ec748c96f217d8de5cb2555dc",
"satoshi": 12340,
"subaccount": 0,
"txhash": "eea0ccc14f823dfcf6afcaf9f57db43aac294d675dd19bb3b563fc11ee169864",
"user_path": [
2147483697,
2147483649,
2147483648,
0,
1
]
}
]
}
}
- txhash:
The txid of the transaction.
- pt_idx:
The index of the output, the vout.
- satoshi:
The amount of the output.
- block_height:
The height of the block where the transaction is included. Is 0 if the transaction is unconfirmed.
- address_type:
One of
"csv","p2sh","p2wsh"(multisig), or"p2pkh","p2sh-p2wpkh","p2wpkh"(singlesig), indicating the type of address.- is_internal:
Whether or not the user key belongs to the internal chain. Always false for multisig.
- pointer:
The user key number/final number in the derivation path.
- subaccount:
The subaccount this output belongs to. Matches
"pointer"from Subaccounts list JSON or Subaccount JSON.- prevout_script:
The script being signed, the script code.
- user_path:
The BIP32 path for the user key.
- public_key:
Singlesig only. The user public key.
- expiry_height:
Multisig only. The block height when two factor authentication expires.
- user_status:
Multisig only. 0 for
"default"and 1 for"frozen".- subtype:
Multisig only. For
"address_type""csv", the number of CSV blocks referenced in"script", otherwise, 0.
For Liquid instead of having the "btc" field, there are (possibly) multiple
fields, one for each asset owned, and the keys are the hex-encoded policy ids.
For Liquid the inner maps have additional fields:
- amountblinder:
The hex-encoded amount blinder (value blinding factor, vbf).
- asset_id:
The hex-encoded asset id in display format.
- asset_tag:
The hex-encoded asset commitment.
- assetblinder:
The hex-encoded asset blinder (asset blinding factor, abf).
- commitment:
The hex-encoded value commitment.
- is_blinded:
A boolean indicating whether or not the output is blinded.
- nonce_commitment:
The hex-encoded nonce commitment.
Unspent outputs set status JSON
Valid status values are "default" for normal behavior or "frozen". Frozen
outputs are hidden from the caller’s balance and unspent output requests, are
not returned in nlocktime emails, and cannot be spent. An account containing
frozen outputs can be deleted, whereas an account with unfrozen outputs can not.
Freezing an output requires two factor authentication. Outputs should only be frozen in response to e.g. a dust attack on the wallet. Once a wallet is deleted, any frozen outputs it contained will be unspendable forever.
Note
Only outputs of value less that two times the dust limit can be frozen.
{
"list": [
{
"txhash": "09933a297fde31e6477d5aab75f164e0d3864e4f23c3afd795d9121a296513c0",
"pt_idx": 1,
"user_status": "frozen"
}
]
}
Transactions details JSON
{"subaccount":0,"first":0,"count":30}
Network JSON
Contains the data describing a network the caller can connect to.
Example
{
"address_explorer_url": "https://blockstream.info/address/",
"bech32_prefix": "bc",
"bip21_prefix": "bitcoin",
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [
25920,
51840,
65535
],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:110",
"electrum_tls": true,
"electrum_url": "blockstream.info:700",
"liquid": false,
"mainnet": true,
"max_reorg_blocks": 144,
"name": "Bitcoin",
"network": "mainnet",
"p2pkh_version": 0,
"p2sh_version": 5,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"price_onion_url": "http://greenv32e5p4rax6dmfgb4zzl7kq2fbmizd7miyava2actplmipyx2qd.onion/prices",
"price_url": "https://green-bitcoin-mainnet.blockstream.com/prices",
"server_type": "green",
"service_chain_code": "e9a563d68686999af372a33157209c6860fe79197a4dafd9ec1dbaa49523351d",
"service_pubkey": "0322c5f5c9c4b9d1c3e22ca995e200d724c2d7d8b6953f7b38fddf9296053c961f",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/tx/",
"wamp_cert_pins": [
"default"
],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "ws://greenv32e5p4rax6dmfgb4zzl7kq2fbmizd7miyava2actplmipyx2qd.onion:80/v2/ws",
"wamp_url": "wss://green-bitcoin-mainnet.blockstream.com/v2/ws"
}
Network list JSON
Contains details of all available networks the API can connect to.
For each network listed, a Network JSON element is present containing the networks information.
Example
{
"all_networks": [
"mainnet",
"liquid",
"testnet",
"testnet-liquid",
"electrum-liquid",
"electrum-localtest",
"electrum-localtest-liquid",
"electrum-mainnet",
"electrum-testnet",
"electrum-testnet-liquid",
"localtest",
"localtest-liquid"
],
"electrum-liquid": {
"address_explorer_url": "https://blockstream.info/liquid/address/",
"asset_registry_onion_url": "http://lhquhzzpzg5tyymcqep24fynpzzqqg3m3rlh7ascnw5cpqsro35bfxyd.onion",
"asset_registry_url": "https://assets.blockstream.info",
"bech32_prefix": "ex",
"bip21_prefix": "liquidnetwork",
"blech32_prefix": "lq",
"blinded_prefix": 12,
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:195",
"electrum_tls": true,
"electrum_url": "blockstream.info:995",
"liquid": true,
"mainnet": true,
"max_reorg_blocks": 2,
"name": "Liquid (Electrum)",
"network": "electrum-liquid",
"p2pkh_version": 57,
"p2sh_version": 39,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"policy_asset": "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d",
"price_onion_url": "http://greenv32e5p4rax6dmfgb4zzl7kq2fbmizd7miyava2actplmipyx2qd.onion/prices",
"price_url": "https://green-bitcoin-mainnet.blockstream.com/prices",
"server_type": "electrum",
"service_chain_code": "",
"service_pubkey": "",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/liquid/tx/",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": ""
},
"electrum-localtest": {
"address_explorer_url": "http://127.0.0.1:8080/address/",
"bech32_prefix": "bcrt",
"bip21_prefix": "bitcoin",
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [],
"development": true,
"electrum_onion_url": "",
"electrum_tls": false,
"electrum_url": "localhost:19002",
"liquid": false,
"mainnet": false,
"max_reorg_blocks": 1008,
"name": "Localtest (Electrum)",
"network": "electrum-localtest",
"p2pkh_version": 111,
"p2sh_version": 196,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"price_onion_url": "",
"price_url": "http://localhost:8080/prices",
"server_type": "electrum",
"service_chain_code": "",
"service_pubkey": "",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "http://127.0.0.1:8080/tx/",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": ""
},
"electrum-localtest-liquid": {
"address_explorer_url": "",
"asset_registry_onion_url": "http://lhquhzzpzg5tyymcqep24fynpzzqqg3m3rlh7ascnw5cpqsro35bfxyd.onion",
"asset_registry_url": "https://assets.blockstream.info",
"bech32_prefix": "ert",
"bip21_prefix": "liquidnetwork",
"blech32_prefix": "el",
"blinded_prefix": 4,
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [],
"development": true,
"electrum_onion_url": "",
"electrum_tls": false,
"electrum_url": "localhost:19002",
"liquid": true,
"mainnet": false,
"max_reorg_blocks": 2,
"name": "Localtest Liquid (Electrum)",
"network": "electrum-localtest-liquid",
"p2pkh_version": 235,
"p2sh_version": 75,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"policy_asset": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"price_onion_url": "",
"price_url": "http://localhost:8080/prices",
"server_type": "electrum",
"service_chain_code": "",
"service_pubkey": "",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": ""
},
"electrum-mainnet": {
"address_explorer_url": "https://blockstream.info/address/",
"bech32_prefix": "bc",
"bip21_prefix": "bitcoin",
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:110",
"electrum_tls": true,
"electrum_url": "blockstream.info:700",
"liquid": false,
"mainnet": true,
"max_reorg_blocks": 144,
"name": "Bitcoin (Electrum)",
"network": "electrum-mainnet",
"p2pkh_version": 0,
"p2sh_version": 5,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"price_onion_url": "http://greenv32e5p4rax6dmfgb4zzl7kq2fbmizd7miyava2actplmipyx2qd.onion/prices",
"price_url": "https://green-bitcoin-mainnet.blockstream.com/prices",
"server_type": "electrum",
"service_chain_code": "",
"service_pubkey": "",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/tx/",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": ""
},
"electrum-testnet": {
"address_explorer_url": "https://blockstream.info/testnet/address/",
"bech32_prefix": "tb",
"bip21_prefix": "bitcoin",
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:143",
"electrum_tls": true,
"electrum_url": "blockstream.info:993",
"liquid": false,
"mainnet": false,
"max_reorg_blocks": 1008,
"name": "Testnet (Electrum)",
"network": "electrum-testnet",
"p2pkh_version": 111,
"p2sh_version": 196,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"price_onion_url": "http://greent5yfxruca52pkqjtgo2qdxijscqlastnv3jwzpmavvffdldm2yd.onion/prices",
"price_url": "https://green-bitcoin-testnet.blockstream.com/prices",
"server_type": "electrum",
"service_chain_code": "",
"service_pubkey": "",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/testnet/tx/",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": ""
},
"electrum-testnet-liquid": {
"address_explorer_url": "https://blockstream.info/liquidtestnet/address/",
"asset_registry_onion_url": "http://lhquhzzpzg5tyymcqep24fynpzzqqg3m3rlh7ascnw5cpqsro35bfxyd.onion/testnet/",
"asset_registry_url": "https://assets-testnet.blockstream.info/",
"bech32_prefix": "tex",
"bip21_prefix": "liquidtestnet",
"blech32_prefix": "tlq",
"blinded_prefix": 23,
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:587",
"electrum_tls": true,
"electrum_url": "blockstream.info:465",
"liquid": true,
"mainnet": false,
"max_reorg_blocks": 2,
"name": "Testnet Liquid (Electrum)",
"network": "electrum-testnet-liquid",
"p2pkh_version": 36,
"p2sh_version": 19,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"policy_asset": "144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49",
"price_onion_url": "http://greent5yfxruca52pkqjtgo2qdxijscqlastnv3jwzpmavvffdldm2yd.onion/prices",
"price_url": "https://green-bitcoin-testnet.blockstream.com/prices",
"server_type": "electrum",
"service_chain_code": "",
"service_pubkey": "",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/liquidtestnet/tx/",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": ""
},
"liquid": {
"address_explorer_url": "https://blockstream.info/liquid/address/",
"asset_registry_onion_url": "http://lhquhzzpzg5tyymcqep24fynpzzqqg3m3rlh7ascnw5cpqsro35bfxyd.onion",
"asset_registry_url": "https://assets.blockstream.info",
"bech32_prefix": "ex",
"bip21_prefix": "liquidnetwork",
"blech32_prefix": "lq",
"blinded_prefix": 12,
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [
65535
],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:195",
"electrum_tls": true,
"electrum_url": "blockstream.info:995",
"liquid": true,
"mainnet": true,
"max_reorg_blocks": 2,
"name": "Liquid",
"network": "liquid",
"p2pkh_version": 57,
"p2sh_version": 39,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"policy_asset": "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d",
"price_onion_url": "http://greenv32e5p4rax6dmfgb4zzl7kq2fbmizd7miyava2actplmipyx2qd.onion/prices",
"price_url": "https://green-bitcoin-mainnet.blockstream.com/prices",
"server_type": "green",
"service_chain_code": "02721cc509aa0c2f4a90628e9da0391b196abeabc6393ed4789dd6222c43c489",
"service_pubkey": "02c408c3bb8a3d526103fb93246f54897bdd997904d3e18295b49a26965cb41b7f",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/liquid/tx/",
"wamp_cert_pins": [
"default"
],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "ws://liquidbtcgecscpokecnr5uwg2de55shdq7dnvlpzeju7tnefbekicqd.onion/v2/ws",
"wamp_url": "wss://green-liquid-mainnet.blockstream.com/v2/ws"
},
"localtest": {
"address_explorer_url": "",
"bech32_prefix": "bcrt",
"bip21_prefix": "bitcoin",
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [
20,
144,
4320,
51840
],
"development": true,
"electrum_onion_url": "",
"electrum_tls": false,
"electrum_url": "localhost:19002",
"liquid": false,
"mainnet": false,
"max_reorg_blocks": 1008,
"name": "Localtest",
"network": "localtest",
"p2pkh_version": 111,
"p2sh_version": 196,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"price_onion_url": "",
"price_url": "http://localhost:8080/prices",
"server_type": "green",
"service_chain_code": "b60befcc619bb1c212732770fe181f2f1aa824ab89f8aab49f2e13e3a56f0f04",
"service_pubkey": "036307e560072ed6ce0aa5465534fb5c258a2ccfbc257f369e8e7a181b16d897b3",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": "ws://localhost:8080/v2/ws"
},
"localtest-liquid": {
"address_explorer_url": "",
"asset_registry_onion_url": "http://lhquhzzpzg5tyymcqep24fynpzzqqg3m3rlh7ascnw5cpqsro35bfxyd.onion",
"asset_registry_url": "https://assets.blockstream.info",
"bech32_prefix": "ert",
"bip21_prefix": "liquidnetwork",
"blech32_prefix": "el",
"blinded_prefix": 4,
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [
20,
1440,
65535
],
"development": true,
"electrum_onion_url": "",
"electrum_tls": false,
"electrum_url": "localhost:19002",
"liquid": true,
"mainnet": false,
"max_reorg_blocks": 2,
"name": "Localtest Liquid",
"network": "localtest-liquid",
"p2pkh_version": 235,
"p2sh_version": 75,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"policy_asset": "5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225",
"price_onion_url": "",
"price_url": "http://localhost:8080/prices",
"server_type": "green",
"service_chain_code": "b60befcc619bb1c212732770fe181f2f1aa824ab89f8aab49f2e13e3a56f0f04",
"service_pubkey": "036307e560072ed6ce0aa5465534fb5c258a2ccfbc257f369e8e7a181b16d897b3",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "",
"wamp_url": "ws://localhost:8080/v2/ws"
},
"mainnet": {
"address_explorer_url": "https://blockstream.info/address/",
"bech32_prefix": "bc",
"bip21_prefix": "bitcoin",
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [
25920,
51840,
65535
],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:110",
"electrum_tls": true,
"electrum_url": "blockstream.info:700",
"liquid": false,
"mainnet": true,
"max_reorg_blocks": 144,
"name": "Bitcoin",
"network": "mainnet",
"p2pkh_version": 0,
"p2sh_version": 5,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"price_onion_url": "http://greenv32e5p4rax6dmfgb4zzl7kq2fbmizd7miyava2actplmipyx2qd.onion/prices",
"price_url": "https://green-bitcoin-mainnet.blockstream.com/prices",
"server_type": "green",
"service_chain_code": "e9a563d68686999af372a33157209c6860fe79197a4dafd9ec1dbaa49523351d",
"service_pubkey": "0322c5f5c9c4b9d1c3e22ca995e200d724c2d7d8b6953f7b38fddf9296053c961f",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/tx/",
"wamp_cert_pins": [
"default"
],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "ws://greenv32e5p4rax6dmfgb4zzl7kq2fbmizd7miyava2actplmipyx2qd.onion:80/v2/ws",
"wamp_url": "wss://green-bitcoin-mainnet.blockstream.com/v2/ws"
},
"testnet": {
"address_explorer_url": "https://blockstream.info/testnet/address/",
"bech32_prefix": "tb",
"bip21_prefix": "bitcoin",
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [
144,
4320,
51840
],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:143",
"electrum_tls": true,
"electrum_url": "blockstream.info:993",
"liquid": false,
"mainnet": false,
"max_reorg_blocks": 1008,
"name": "Testnet",
"network": "testnet",
"p2pkh_version": 111,
"p2sh_version": 196,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"price_onion_url": "http://greent5yfxruca52pkqjtgo2qdxijscqlastnv3jwzpmavvffdldm2yd.onion/prices",
"price_url": "https://green-bitcoin-testnet.blockstream.com/prices",
"server_type": "green",
"service_chain_code": "b60befcc619bb1c212732770fe181f2f1aa824ab89f8aab49f2e13e3a56f0f04",
"service_pubkey": "036307e560072ed6ce0aa5465534fb5c258a2ccfbc257f369e8e7a181b16d897b3",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://blockstream.info/testnet/tx/",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "ws://greent5yfxruca52pkqjtgo2qdxijscqlastnv3jwzpmavvffdldm2yd.onion:80/v2/ws",
"wamp_url": "wss://green-bitcoin-testnet.blockstream.com/v2/ws"
},
"testnet-liquid": {
"address_explorer_url": "https://esplora.blockstream.com/liquidtestnet/address/",
"asset_registry_onion_url": "http://lhquhzzpzg5tyymcqep24fynpzzqqg3m3rlh7ascnw5cpqsro35bfxyd.onion/testnet/",
"asset_registry_url": "https://assets-testnet.blockstream.info/",
"bech32_prefix": "tex",
"bip21_prefix": "liquidtestnet",
"blech32_prefix": "tlq",
"blinded_prefix": 23,
"blob_server_onion_url": "",
"blob_server_url": "",
"csv_buckets": [
1440,
65535
],
"development": false,
"electrum_onion_url": "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion:587",
"electrum_tls": true,
"electrum_url": "blockstream.info:465",
"liquid": true,
"mainnet": false,
"max_reorg_blocks": 2,
"name": "Testnet Liquid",
"network": "testnet-liquid",
"p2pkh_version": 36,
"p2sh_version": 19,
"pin_server_onion_url": "http://mrrxtq6tjpbnbm7vh5jt6mpjctn7ggyfy5wegvbeff3x7jrznqawlmid.onion",
"pin_server_public_key": "0332b7b1348bde8ca4b46b9dcc30320e140ca26428160a27bdbfc30b34ec87c547",
"pin_server_url": "https://jadepin.blockstream.com",
"policy_asset": "144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49",
"price_onion_url": "http://greent5yfxruca52pkqjtgo2qdxijscqlastnv3jwzpmavvffdldm2yd.onion/prices",
"price_url": "https://green-bitcoin-testnet.blockstream.com/prices",
"server_type": "green",
"service_chain_code": "c660eec6d9c536f4121854146da22e02d4c91d72af004d41729b9a592f0788e5",
"service_pubkey": "02c47d84a5b256ee3c29df89642d14b6ed73d17a2b8af0aca18f6f1900f1633533",
"spv_enabled": false,
"spv_multi": false,
"spv_servers": [],
"tx_explorer_url": "https://esplora.blockstream.com/liquidtestnet/tx/",
"wamp_cert_pins": [],
"wamp_cert_roots": [
"default"
],
"wamp_onion_url": "ws://liqtestulh46kwla3mgenugrcogvjjvzr2qdto663hujwnbaewzpkoad.onion/v2/ws",
"wamp_url": "wss://green-liquid-testnet.blockstream.com/v2/ws"
}
}
Transaction limits JSON
Describes the users spending limits/desired spending limits. A spending limit of zero means the user has no limit currently set.
Warning
Fiat spending limits are deprecated and support will be removed in a future release.
When calling GA_twofactor_change_limits, the caller should pass whether or
not the limit is in fiat, and the value. For limits in BTC, the value can be given
as any unit from Convert amount JSON (e.g. "satoshi", "mbtc" etc).
Set fiat limit example
{
"fiat": "1.50",
"fiat_currency": "USD",
"is_fiat": true
}
- is_fiat:
trueto indicate a fiat limit is being set.- fiat:
A string containing the limit amount in fiat cents.
- fiat_currency:
The currency of the limit.
Set BTC limit example
{
"is_fiat": false,
"satoshi": 50000
}
- is_fiat:
falseto indicate a BTC limit is being set.- <value_key>:
A value key from Convert amount JSON giving the limit.
The returned value from GA_twofactor_change_limits, and the "limits"
section of Two Factor Config JSON is identical to the set value for
fiat. For BTC, the limit is passed through GA_convert_amount and so all
units are returned.
Multisig example (returned fiat limit)
{
"fiat": "1.50",
"fiat_currency": "USD",
"is_fiat": true
}
Multisig example (returned BTC limit)
{
"bits": "500.00",
"btc": "0.00050000",
"fiat": "0.00",
"fiat_currency": "USD",
"fiat_rate": "1.10000000",
"is_current": true,
"is_fiat": false,
"mbtc": "0.50000",
"satoshi": 50000,
"sats": "50000",
"ubtc": "500.00"
}
Two Factor Detail JSON
Describes the status/desired status of an individual two factor method for a wallet.
Describes the desired status of an individual two factor method for a wallet
when passed to GA_change_settings_twofactor. Describes the current status of
a two factor method when returned as an element of Two Factor Config JSON
by GA_get_twofactor_config.
{
"confirmed": true,
"data": "<method specific data>",
"enabled": true
}
- confirmed:
trueto confirm the method or if method is confirmed. Confirmation is performed by the Green server, which requests a two factor code using the details in"data".- enabled:
trueto enable the method or if the method is enabled. Handled by the Green server automatically as with"confirmed".- data:
Method-specific data, as described below.
Method |
Value |
Example |
|---|---|---|
|
Email address |
|
|
Phone number |
|
|
Phone number |
|
|
OTP auth URL |
|
For "gauth" (Google authenticator), the OTP auth URL is generated by the
Green server, and changes randomly until the user enables this method. The
user should set "data" to the data value returned for gauth
by GA_get_twofactor_config when enabling.
Note
When returned from GA_get_twofactor_config, the "data" values
will be partially masked for user privacy/security.
Phone as an SMS backup
If the caller only has SMS two factor enabled, but is unable to receive the
SMS messages sent by the Green server, they may enable phone two factor on
the same phone number without further authorization. This is done by passing
"is_sms_backup" as true, as follows:
{
"confirmed": true,
"data": "<existing sms phone number for the wallet>",
"enabled": true,
"is_sms_backup": true
}
Auth handler status JSON
Describes the status of a GA_auth_handler. Returned by GA_auth_handler_get_status.
All status JSON contains a "name" element with the name of the handler being invoked.
The remaining data returned depends on the current state of the handler, as follows:
"done":
{
"status": "done",
"action": "disable_2fa",
"result": {}
}
- action:
The action being processed.
- result:
The data returned from the call, if any.
"error":
{
"status": "error",
"action": "disable_2fa",
"error": "Incorrect code"
}
- action:
The action being processed.
- error:
A text description of the error that occurred.
"call":
{
"status": "call",
"action": "disable_2fa"
}
- action:
The action being processed.
"request_code":
{
"status": "request_code",
"action": "disable_2fa",
"methods": [ "email", "sms", "phone", "gauth", "telegram" ]
}
- action:
The action being processed.
- methods:
A list of available two factor methods the user has enabled, or the single element
"data"if the call requires more data to continue.
"resolve_code"(two factor):
{
"status": "resolve_code",
"action": "disable_2fa",
"method": "email",
"auth_data": {},
"attempts_remaining": "3"
}
- action:
The action being processed.
- method:
The two factor method the user should fetch the code to enter from.
- auth_data:
Method-specific ancillary data for resolving the call.
- attempts_remaining:
If present, the number of incorrect attempts that can be made before the call fails.
"resolve_code"(hardware wallet/external device):
{
"status": "resolve_code",
"action": "disable_2fa",
"required_data": {
"action": "get_xpubs",
"device": {}
}
}
- action:
The action being processed.
- required_data:
Contains the data the HWW must provide, see GDK Hardware Wallet Interface.
"resolve_code"(request for additional data):
{
"status": "resolve_code",
"action": "data",
"method": "data",
"auth_data": {}
}
- action:
Always “data”.
- method:
Always “data”.
- auth_data:
Method-specific ancillary data for processing the additional data request.
Reconnect JSON
Controls session and internal Tor instance reconnection behavior.
{
"hint": "connect",
"tor_hint": "connect"
}
- hint:
Optional, must be either
"connect"or"disconnect"if given.- tor_hint:
Optional, must be either
"connect"or"disconnect"if given.
For both hint types, "disconnect" will disconnect the underlying network
connection used by the session, while "connect" will reconnect it. if
a hint is not given, no action will be taken for that connection type.
Each session will automatically attempt to reconnect in the background when
they detect a disconnection, unless "disconnect" is passed to close the
connection first. The session will be notified using a Network notification when
the underlying network connection changes state.
For environments such as mobile devices where networking may become
unavailable to the callers application, the network must be disconnected
and reconnected using GA_reconnect_hint in order for connectivity to
be resumed successfully. In particular, when using the built-in Tor
implementation to connect, failure to do so may result in Tor failing
to connect for the remaining lifetime of the application (this is a
Tor limitation).
Convert amount JSON
Amounts to convert are passed with a single key containing the unit value to convert, returning all possible conversion values for that value. See Amount JSON for the list of unit values available.
For example, to convert satoshi into all available units:
{
"satoshi": 1120
}
If "fiat_currency" and "fiat_rate" members are provided, the fiat
conversion will fall back on these values if no fiat rates are available.
Callers can check the "is_current" member in the result Amount JSON
to determine if the fall back values were used.
For example, to convert bits into all available units, with a fiat conversion fallback:
{
"bits": "20344.69",
"fiat_currency": "USD",
"fiat_rate": "42161.22"
}
It is possible to call this method in non logged Electrum sessions by providing pricing details. For example:
{
"satoshi": 1000,
"pricing": {
"currency": "USD",
"exchange": "BITFINEX"
}
}
For Liquid it’s possible to convert asset amounts using the asset precision.
To do so, it’s necessary to specify the "asset_info" field.
It’s possible to convert from the asset base unit, "satoshi":
{
"asset_info": {
"asset_id": "aa..aa",
"precision": 2,
},
"satoshi": 12345,
}
Or from the asset string representation, using the "asset id" value
specified in "asset_info".
{
"asset_info": {
"asset_id": "aa..aa",
"precision": 2,
},
"aa..aa": 123.45,
}
Amount JSON
{
"bits": "20344.69",
"btc": "0.02034469",
"fiat": "0.02",
"fiat_currency": "EUR",
"fiat_rate": "1.10000000",
"mbtc": "20.34469",
"satoshi": 2034469,
"sats": "2034469",
"subaccount": 0,
"ubtc": "20344.69"
"is_current": true,
"aa..aa": "0.02034469",
}
- fiat_currency:
Set to the users fiat currency if available, otherwise an empty string.
- fiat_rate:
Set to the users fiat exchange rate if available, otherwise
null.- is_current:
trueif the"fiat_currency"and"fiat_rate"members are current.- aa..aa:
This field is only present if
"asset_info"was passed. The key is the"asset_id"in"asset_info", and the value is the string representation of the asset amount according to the"precision"in"asset_info".
Available currencies JSON
Lists the currencies and pricing sources (exchanges) available to the session,
returned by GA_get_available_currencies. Note that the available pricing
sources and/or currencies available at each source may differ between singlesig
multisig sessions.
Singlesig example
{
"all": [
"CZK",
"EUR",
"AUD",
"HKD",
"MXN",
"NGN",
"CAD",
"THB",
"TRY",
"IDR",
"JPY",
"VND",
"SEK",
"CHF",
"INR",
"USD",
"BRL",
"DKK",
"GBP",
"RUB",
"NZD",
"SGD",
"ZAR",
"MYR",
"CNY",
"NOK",
"PLN",
"ILS"
],
"per_exchange": {
"BITFINEX": [
"USD"
],
"BITSTAMP": [
"USD"
],
"BULLBITCOIN": [
"CAD"
],
"COINGECKO": [
"AUD",
"BRL",
"CAD",
"CHF",
"CNY",
"CZK",
"DKK",
"EUR",
"GBP",
"HKD",
"IDR",
"ILS",
"INR",
"JPY",
"MXN",
"MYR",
"NGN",
"NOK",
"NZD",
"PLN",
"RUB",
"SEK",
"SGD",
"THB",
"TRY",
"USD",
"VND",
"ZAR"
],
"KIWICOIN": [
"NZD"
],
"KRAKEN": [
"EUR",
"USD"
],
"LUNO": [
"IDR",
"MYR",
"NGN",
"ZAR"
]
}
}
Multisig example
{
"all": [
"AUD",
"BRL",
"CAD",
"CHF",
"CNY",
"CZK",
"DKK",
"EUR",
"GBP",
"HKD",
"IDR",
"ILS",
"INR",
"JPY",
"MXN",
"MYR",
"NGN",
"NOK",
"NZD",
"PLN",
"RUB",
"SEK",
"SGD",
"THB",
"TRY",
"USD",
"VND",
"ZAR"
],
"per_exchange": {
"BITFINEX": [
"USD"
],
"BITSTAMP": [
"USD"
],
"BULLBITCOIN": [
"CAD"
],
"COINGECKO": [
"AUD",
"BRL",
"CAD",
"CHF",
"CNY",
"CZK",
"DKK",
"EUR",
"GBP",
"HKD",
"IDR",
"ILS",
"INR",
"JPY",
"MXN",
"MYR",
"NGN",
"NOK",
"NZD",
"PLN",
"RUB",
"SEK",
"SGD",
"THB",
"TRY",
"USD",
"VND",
"ZAR"
],
"KIWICOIN": [
"NZD"
],
"KRAKEN": [
"EUR",
"USD"
],
"LUNO": [
"IDR",
"MYR",
"NGN",
"ZAR"
]
}
}
- all:
An array of all currecies available across all pricing sources.
- per_exchange:
An array of pricing source keys, with the currencies available for each pricing source as the keys value.
HTTP parameters JSON
{
"accept":"json"
"method":"GET"
"urls":[
"https://assets.blockstream.info/index.json"
"http://vi5flmr4z3h3luup.onion/index.json"
]
"proxy":"localhost:9150"
"headers":{"If-Modified-Since":"Mon, 02 Sep 2019 22:39:39 GMT"}
"timeout":10
}
Locktime details JSON
{
"value":65535
}
Asset parameters JSON
{
"assets": true,
"icons": true
}
Get assets parameters JSON
Information about Liquid assets can be obtained by either passing a list of asset ids to query:
{
"assets_id": ["6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d","ce091c998b83c78bb71a632313ba3760f1763d9cfcffae02258ffa9865a37bd2"]
}
or by specifying one or more of the following attributes:
- names:
a list of strings representing asset names;
- tickers:
a list of strings representing asset tickers:
- category:
must be one of: -
"with_icons": only assets that have icons associated to them will be returned; -"hard_coded": only assets bundled in the GDK release will be returned; -"all": all the locally-stored assets and icons will be returned.
Specifying multiple attributes is interpreted as a logical AND. For example,
{"category": "with_icons", "tickers": ["LCAD"]} will return all the assets
with ticker LCAD that also have an icon.
Asset details JSON
{
"assets": {
"6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d": {
"asset_id": "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d",
"contract": null,
"entity": null,
"issuance_prevout": {
"txid": "0000000000000000000000000000000000000000000000000000000000000000",
"vout": 0
},
"issuance_txin":{
"txid": "0000000000000000000000000000000000000000000000000000000000000000",
"vin": 0
},
"issuer_pubkey": "",
"name": "btc",
"precision": 8,
"ticker": "L-BTC",
"version": 0
}
},
"icons": {
"6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d": "BASE64"
}
}
Error details JSON
{
"details":"assertion failure: ga_session.cpp:2166:Unknown subaccount"
}
Get Subaccounts parameters JSON
Parameters controlling the GA_get_subaccounts call.
{
"refresh": false
}
- refresh:
If set to
true, subaccounts are re-discovered if appropriate for the session type. Note that this will take significantly more time if set. Defaults tofalse.
Validate JSON
Passed to GA_validate to check the validity of gdk input data.
To validate addressees, for example prior to calling GA_create_transaction:
{
"addressees": {},
"network": "mainnet"
}
- addressees:
Mandatory. An array of Addressee JSON elements.
- network:
Optional. The name of a network to validate the addressees against.
Validation includes that the address is correct and supported by the network,
and that the amount given is valid. The given amount in whatever denomination
will be converted into "satoshi" in the returned addressee. For Liquid, a
valid hex "asset_id" must be present.
It is also possible to validate an addressee for another network than that of
the current session. To do so, pass a network name in "network". Note that
when validating against a different network, any amount in the addressee will
not be validated or converted, as the session does not have pricing data for
other networks than its own.
To validate a LiquiDEX version 1 proposal:
{
"liquidex_v1": {
"proposal": {}
}
}
- liquidex_v1/proposal:
The LiquiDEX version 1 proposal to validate.
Validate Result JSON
Returned from GA_validate to indicate the validity of the given JSON document.
{
"is_valid": true,
"errors": [],
"addressees": {}
}
- is_valid:
trueif the JSON is valid,falseotherwise.- errors:
An array of strings describing each error found in the given document; Empty if
"is_valid"istrue.- addressees:
If validating addressees, the given Addressee JSON elements with data sanitized and converted if required. For example, BIP21 URLs are converted to addresses, plus amount/asset if applicable.