It may seem that the darknet is an ideal place for criminals, and this will be almost true. Almost — because the secret services can enter the darknet just like any other people. In a sense, it’s even easier for them: knowing that all the killers live on one site and all the financial scammers live on another, they can carry out attacks based on social engineering, exploit site vulnerabilities and even TOR vulnerabilities.
If you are interested in the darknet only from the position of “see what’s there and how it works”, then this is legal.
As soon as you do something there that violates the law of your country, it already falls under the administrative or criminal code. For selling drugs, buying weapons, or distributing illegal porn on the darknet, you will be given the same number of years as if you did it offline
The main rule of the darknet is that there are no laws there, so no one can guarantee anonymity inside the network. Everything that a person does there (as well as on the regular Internet), he does at his own risk. If someone commits something illegal and unintentionally reveals some information about himself, it can be used against a person. For example, for blackmail or extortion of money.
In conclusion, a little story about anonymity in the darknet. In 2013, Ross Ulbrecht, the owner of one of the largest illegal drug—selling sites on Silk Road, was arrested. He used TOR, accessed the network through a VPN channel and knew that he was being searched for, so he tried to minimize his digital presence. They found him anyway.