2015-06-12 04:23:27 +02:00
|
|
|
#ifndef LIGHTNING_BITCOIN_BASE58_H
|
|
|
|
#define LIGHTNING_BITCOIN_BASE58_H
|
2016-01-21 21:08:08 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2019-05-06 23:17:15 +02:00
|
|
|
#include <bitcoin/chainparams.h>
|
2015-07-09 08:13:36 +02:00
|
|
|
#include <ccan/crypto/ripemd160/ripemd160.h>
|
2015-06-02 04:23:59 +02:00
|
|
|
|
|
|
|
struct pubkey;
|
2015-06-26 04:24:07 +02:00
|
|
|
struct privkey;
|
2015-06-02 04:23:59 +02:00
|
|
|
struct bitcoin_address;
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
/* Bitcoin address encoded in base58, with version and checksum */
|
2019-05-06 23:17:15 +02:00
|
|
|
char *bitcoin_to_base58(const tal_t *ctx, const struct chainparams *chainparams,
|
2015-05-26 06:38:12 +02:00
|
|
|
const struct bitcoin_address *addr);
|
|
|
|
|
2016-01-21 21:11:46 +01:00
|
|
|
/* P2SH address encoded as base58, with version and checksum */
|
2019-05-06 23:17:15 +02:00
|
|
|
char *p2sh_to_base58(const tal_t *ctx, const struct chainparams *chainparams,
|
2016-01-21 21:11:46 +01:00
|
|
|
const struct ripemd160 *p2sh);
|
2015-05-26 06:38:12 +02:00
|
|
|
|
2019-04-30 20:43:18 +02:00
|
|
|
/* Decode a p2pkh or p2sh into the ripemd160 hash */
|
|
|
|
bool ripemd160_from_base58(u8 *version, struct ripemd160 *rmd,
|
|
|
|
const char *base58, size_t base58_len);
|
|
|
|
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_BITCOIN_BASE58_H */
|