public static Gen <KeyPath> KeyPath() => from raw in Gen.NonEmptyListOf(PrimitiveGenerator.RandomBytes(4)) let flattenBytes = raw.ToList().Aggregate((a, b) => a.Concat(b)) select Bitcoin3.KeyPath.FromBytes(flattenBytes);
public static Gen <uint256> Hash256() => from bytes in PrimitiveGenerator.RandomBytes(32) select new uint256(bytes);
public static Gen <uint160> Hash160() => from bytes in PrimitiveGenerator.RandomBytes(20) select new uint160(bytes);
private static Gen <Op> PushOnlyOpcode() => from bytes in PrimitiveGenerator.RandomBytes(4) select Op.GetPushOp(bytes);