2015-06-12 03:23:27 +01:00
|
|
|
#include "address.h"
|
2015-06-02 03:23:59 +01:00
|
|
|
#include "pubkey.h"
|
2016-01-21 20:08:08 +00:00
|
|
|
#include <ccan/crypto/sha256/sha256.h>
|
2015-05-28 22:38:27 +01:00
|
|
|
|
2015-06-02 03:23:59 +01:00
|
|
|
void bitcoin_address(const struct pubkey *key, struct bitcoin_address *addr)
|
2015-05-28 22:38:27 +01:00
|
|
|
{
|
|
|
|
struct sha256 h;
|
|
|
|
|
2015-09-30 02:24:54 +01:00
|
|
|
sha256(&h, key->der, pubkey_derlen(key));
|
2015-07-09 07:13:36 +01:00
|
|
|
ripemd160(&addr->addr, h.u.u8, sizeof(h));
|
2015-05-28 22:38:27 +01:00
|
|
|
}
|