diff --git a/coinlib/example/coinlib_example.dart b/coinlib/example/coinlib_example.dart
index 7a3a0fd..62ede67 100644
--- a/coinlib/example/coinlib_example.dart
+++ b/coinlib/example/coinlib_example.dart
@@ -59,7 +59,7 @@ void main() async {
"32d1f1cf811456c6da4ef9e1cb7f8bb80c4c5e9f2d2c3d743f2b68a9c6857823",
);
- final tx = LegacyTransaction(
+ final tx = Transaction(
inputs: [
P2PKHInput(prevOut: OutPoint(prevHash, 1), publicKey: key1.publicKey),
],
diff --git a/coinlib/lib/src/coinlib_base.dart b/coinlib/lib/src/coinlib_base.dart
index a65cccf..54e953e 100644
--- a/coinlib/lib/src/coinlib_base.dart
+++ b/coinlib/lib/src/coinlib_base.dart
@@ -31,12 +31,13 @@ export 'package:coinlib/src/scripts/programs/p2wsh.dart';
export 'package:coinlib/src/tx/input.dart';
export 'package:coinlib/src/tx/input_signature.dart';
-export 'package:coinlib/src/tx/legacy_transaction.dart';
+export 'package:coinlib/src/tx/transaction.dart';
export 'package:coinlib/src/tx/outpoint.dart';
export 'package:coinlib/src/tx/output.dart';
export 'package:coinlib/src/tx/p2pkh_input.dart';
export 'package:coinlib/src/tx/p2sh_multisig_input.dart';
export 'package:coinlib/src/tx/p2wpkh_input.dart';
+export 'package:coinlib/src/tx/pkh_input.dart';
export 'package:coinlib/src/tx/raw_input.dart';
export 'package:coinlib/src/tx/sighash_type.dart';
export 'package:coinlib/src/tx/witness_input.dart';
diff --git a/coinlib/lib/src/tx/legacy_transaction.dart b/coinlib/lib/src/tx/legacy_transaction.dart
deleted file mode 100644
index c2af6f0..0000000
--- a/coinlib/lib/src/tx/legacy_transaction.dart
+++ /dev/null
@@ -1,337 +0,0 @@
-import 'dart:typed_data';
-import 'package:coinlib/src/common/checks.dart';
-import 'package:coinlib/src/common/hex.dart';
-import 'package:coinlib/src/common/serial.dart';
-import 'package:coinlib/src/crypto/ec_private_key.dart';
-import 'package:coinlib/src/crypto/ec_public_key.dart';
-import 'package:coinlib/src/crypto/ecdsa_signature.dart';
-import 'package:coinlib/src/crypto/hash.dart';
-import 'package:coinlib/src/scripts/operations.dart';
-import 'package:coinlib/src/scripts/programs/p2pkh.dart';
-import 'package:coinlib/src/scripts/script.dart';
-import 'p2pkh_input.dart';
-import 'p2sh_multisig_input.dart';
-import 'sighash_type.dart';
-import 'input.dart';
-import 'input_signature.dart';
-import 'output.dart';
-import 'raw_input.dart';
-
-class TransactionTooLarge implements Exception {}
-class CannotSignInput implements Exception {
- final String message;
- CannotSignInput(this.message);
- @override
- String toString() => "CannotSignInput: $message";
-}
-
-/// A legacy transaction does not include or consider witness data. Use
-/// [WitnessTransaction] to sign and build transactions with witness inputs.
-class LegacyTransaction with Writable {
-
- static const int currentVersion = 3;
- static const int maxSize = 1000000;
-
- static const int minInputSize = 41;
- static const int minOutputSize = 9;
- static const int minOtherSize = 10;
-
- static const int maxInputs
- = (maxSize - minOtherSize - minOutputSize) ~/ minInputSize;
- static const int maxOutputs
- = (maxSize - minOtherSize - minInputSize) ~/ minOutputSize;
-
- final int version;
- final List inputs;
- final List