Peel, seed and cut the pumpkin into small chunks. Finely chop the shallot.
In a pan on medium heat, cook the shallot for about 3 minutes, then add the smoked paprika, the rosemary, and the black pepper, and let toast for only 10 seconds.
To the same pan, add the chopped pumpkin and about 1.5 cups of water and cover with a lid.
Cook the pumpkin until very soft, adding water if necessary.
In a blender, add the tofu to the pumpkin by chopping it with your hands, season with salt and pepper, and blend until completely smooth. Taste for flavour and set aside.
BOIL THE PASTA
In a large pot, bring to the boil at least 3 litres of water. Then add the coarse sea salt and wait for the water to boil again.
Cook the spaghetti in the salted boiling water and without a lid. Cook them 1 minute less than instructed on the package. Stir them two or three times. When draining them, save 1 cup of the cooking water.
DRESS THE PASTA
In a large pan on medium heat, pour the pumpkin-tofu sauce, 1/2 cup of cooking pasta water, the chickpeas, and the cooked spaghetti. Toss the spaghetti until the sauce is completely wrapped around the spaghetti. Add more pasta water if necessary. Plate, sprinkle with some roasted pistachio nuts, and serve immediately.