-
Notifications
You must be signed in to change notification settings - Fork 120
/
prefix.h
27 lines (20 loc) · 853 Bytes
/
prefix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef BITCOIN_INCLUDE_PREFIX_H
#define BITCOIN_INCLUDE_PREFIX_H
#include <stdio.h>
/* prefix byte for addresses, public keys and private keys, to identify network */
typedef unsigned BitcoinKeyPrefix;
struct BitcoinNetworkType
{
const char *name;
const char *hrp;
BitcoinKeyPrefix public_key_prefix,
script_prefix,
private_key_prefix;
};
const struct BitcoinNetworkType *Bitcoin_GetNetworkTypeByName(const char *name);
const struct BitcoinNetworkType *Bitcoin_GetNetworkTypeByHrp(const char *hrp);
const struct BitcoinNetworkType *Bitcoin_GetNetworkTypeByPrivateKeyPrefix(const BitcoinKeyPrefix prefix);
BitcoinKeyPrefix BitcoinNetworkType_GetPublicKeyPrefix(const struct BitcoinNetworkType *n);
BitcoinKeyPrefix BitcoinNetworkType_GetPrivateKeyPrefix(const struct BitcoinNetworkType *n);
void Bitcoin_ListNetworks(FILE *output);
#endif