Soak the 1 cup of lentils in water for 30 minutes or up to 60 minutes. Meanwhile, prep all the other ingredients (i.e., chop the onions and garlic, chop the walnuts, etc.)
Heat a 12-inch deep sauté pan or Dutch oven on medium-high heat. Add the olive oil, and once the olive oil shimmers, add the onions, carrots, and celery—season with a pinch of salt.
Stir occasionally, and cook the soffritto until light brown, about 5 minutes. Add a few spoonfuls of water to deglaze the pan, and stir. Keep cooking, adding more water every few minutes. Stir often to prevent burning. Cook until the soffritto is soft and golden brown, about 9 to 10 minutes.
Add the garlic, thyme, oregano, 1 ½ teaspoons kosher salt, and pepper to taste. Stir frequently and cook for 60-90 seconds.
Stir in the tomato paste and cook for 2-3 minutes to caramelize, stirring frequently until it’s darker red.
Optional: If using red wine, pour it into the pan and deglaze, scraping up any browned bits. Cook for 1-2 minutes until the smell of alcohol has burned off and the mixture is thick and jammy.
Pour in the broth, stirring the broth into the tomato paste to combine. Add the lentils and walnuts and stir to incorporate. Heat the mixture until it boils. Then, lower the heat to medium-low. Keep it at a rapid simmer for 20 minutes, stirring occasionally.
Add the crushed tomatoes and let them simmer for 15 to 20 minutes. Cook until the lentils are tender but still firm. Stir occasionally to prevent burning and sticking.
You may need to add a bit more water. (Note 3)
Meanwhile, bring a large pot of water to a boil and salt generously. Add the pasta and cook until just al dente. Reserve a ladle of pasta water (you may not need it). Drain the pasta, but do not rinse it. ( Note 4)
Taste the bolognese for seasonings, adding more salt and pepper to taste.
Transfer 2 cups of the sauce to the base of a blender, let cool briefly, and blend until nearly smooth. Return the sauce to the pot and stir to combine. You can also use an immersion blender to blend the sauce in the pot. Blend it until you reach your desired consistency, but keep some texture.
Finish with the balsamic vinegar (or sugar, see note 5), and stir to combine.
Add the hot-cooked pasta to the bolognese sauce. Toss it until the pasta is well-coated. Add a little pasta water to help the sauce stick to the noodles if needed.
Divide the cooked pasta between bowls and top with the bolognese.
Top with shaved parmesan; garnish with chopped parsley or basil, and serve. (Note 6)