Commit graph

7 commits

Author SHA1 Message Date
nsa
d08f03552c psbt: define MaxPsbtKeyLength and check against it when decoding
This commit defines MaxPsbtKeyLength and checks that decoding a
key from a PSBT blob doesn't attempt to allocate too much memory.
2020-04-08 17:53:06 -04:00
Oliver Gugger
04442f8ef9
psbt: fix deserialization with zero inputs
This is a fix/workaround for a special case that's caused by
https://github.com/btcsuite/btcd/blob/master/wire/msgtx.go#L426.
When a wire format transaction with no inputs is serialized, the wire
package assumes it's a non-witness transaction (as there is indeed no
witness data present).
But when de-serializing the same transaction, the line mentioned above
assumes that for the special case of a zero input length, the
transaction must be in the witness format, which causes the
de-serialization  to fail.
The workaround in this commit fixes this special case by just trying
to deserialize the transaction in the non-witness format too.
2020-03-23 10:38:36 +01:00
Olaoluwa Osuntokun
ef5f31d2e3
psbt: rename psbt.Psbt to psbt.Packet, rename existing constructors 2020-01-15 17:56:44 -08:00
Olaoluwa Osuntokun
33335d05df
psbt: move output into new file 2020-01-15 17:56:29 -08:00
Olaoluwa Osuntokun
9411189e0e
psbt: move input into new file 2020-01-15 17:56:26 -08:00
Olaoluwa Osuntokun
7611eb65d8
psbt: move PSBT keys/type into new file 2020-01-15 17:56:23 -08:00
Adam Gibson
e17c9730c4 PSBT BIP 174 implementation (#126)
Implements: PSBT struct, roles: creator, updater, signer, extractor.
Passing test vectors.
2019-12-19 15:20:22 -03:00