Rusty Russell
a25e2816e9
type_to_string: add secp256k1_pubkey
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Christian Decker
9f846925b3
bitcoin: Add comparison between pubkeys
Some of the routing messages rely on a canonical ordering of pubkeys.
8 years ago
Rusty Russell
a4fdaab5b3
Use global secp256k1_ctx instead of passing it around.
If I'd known how large this patch would be (though trivial), I'd
have done it in parts.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8 years ago
Rusty Russell
364c2cd2c0
key_from_base58 / pubkey_from_privkey: don't support non-compressed keys.
It just clutters the API, and we don't support them on the wire anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
42bed80145
pubkey: don't carry around DER encoding.
We just wrap the libsecp256k1 structure, and convert to DER on demand.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
69cb158edd
base58, script, protobuf_convert: don't use temporary secp256k1 context.
We use libsecp256k1 to convert signatures to DER; we were creating a
temporary one, but we really should be handing the one we have in dstate
through. This does that, everywhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
b6943b9198
protocol: remove support for uncompressed pubkeys.
There's no good reason to support them, and this way every key is 33 bytes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
9aa0eac814
bitcoin: hand in a secp256k1_context to all routines.
We don't want to re-create them internally, ever.
The test-cli tools are patched to generate them all the time, but
they're not performance critical.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
cf547d491b
bitcoin: add len arg to pubkey conversion function.
Our json parser doesn't give nul-terminated strings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
d733e82352
header cleanup: sort include lines into alpha order, after config.h
This makes merging easier in future.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
242fa1b2dd
pubkey: pubkey_eq helper.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
442f321585
Move protobuf<->bitcoin converters out of bitcoin/
They're lightning-specific.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
612d713470
Move bitcoin stuff into bitcoin subdir.
It's not very interesting if you're looking for LN code.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
d30c470c7d
anchor: change is not an arbitrary output, but a pubkey we p2sh to.
Gets rid of the last pubkey user; they're generally deprecated.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
07c7214edb
Explicit pubkey structure.
This checks that the protobuf is the right form, also handles uncompressed
keys (though you shouldn't be using those any more, should you?)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago