The official line in Germany is actually that Ukraine most probably did it:
https://www.tagesschau.de/investigativ/ndr-wdr/nordstream-17...
https://www.br.de/nachrichten/deutschland-welt/nord-stream-s...
https://www.wsj.com/world/europe/nord-stream-pipeline-explos...Knowledge or agreement by Selensky is unclear, but there seem to be hints. Poland might have been complicit or at least turned a blind eye and seems to have let a wanted suspect escape to Ukraine.