core-lightning/bitcoin/address.c
Rusty Russell 242fa1b2dd pubkey: pubkey_eq helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-09-30 16:38:58 +09:30

12 lines
268 B
C

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