core-lightning/bitcoin_address.c
Rusty Russell 670670f138 open-anchor-sig, many fixes for open-channel.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-29 10:51:16 +09:30

12 lines
270 B
C

#include "bitcoin_address.h"
#include <ccan/crypto/sha256/sha256.h>
void bitcoin_address(const struct bitcoin_compressed_pubkey *key,
struct bitcoin_address *addr)
{
struct sha256 h;
sha256(&h, key, sizeof(*key));
RIPEMD160(h.u.u8, sizeof(h), addr->addr);
}