2015-06-12 03:23:27 +01:00
|
|
|
#ifndef LIGHTNING_BITCOIN_BASE58_H
|
|
|
|
#define LIGHTNING_BITCOIN_BASE58_H
|
2016-01-21 20:08:08 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2019-05-06 22:17:15 +01:00
|
|
|
#include <bitcoin/chainparams.h>
|
2015-07-09 07:13:36 +01:00
|
|
|
#include <ccan/crypto/ripemd160/ripemd160.h>
|
2015-06-02 03:23:59 +01:00
|
|
|
|
|
|
|
struct pubkey;
|
2015-06-26 03:24:07 +01:00
|
|
|
struct privkey;
|
2015-06-02 03:23:59 +01:00
|
|
|
struct bitcoin_address;
|
2015-05-26 05:38:12 +01:00
|
|
|
|
|
|
|
/* Bitcoin address encoded in base58, with version and checksum */
|
2019-05-06 22:17:15 +01:00
|
|
|
char *bitcoin_to_base58(const tal_t *ctx, const struct chainparams *chainparams,
|
2015-05-26 05:38:12 +01:00
|
|
|
const struct bitcoin_address *addr);
|
|
|
|
|
2016-01-21 20:11:46 +00:00
|
|
|
/* P2SH address encoded as base58, with version and checksum */
|
2019-05-06 22:17:15 +01:00
|
|
|
char *p2sh_to_base58(const tal_t *ctx, const struct chainparams *chainparams,
|
2016-01-21 20:11:46 +00:00
|
|
|
const struct ripemd160 *p2sh);
|
2015-05-26 05:38:12 +01:00
|
|
|
|
2019-04-30 19:43:18 +01: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 17:06:01 +01:00
|
|
|
#endif /* LIGHTNING_BITCOIN_BASE58_H */
|