I am not sure about laws where you live, but here it is legal as long as you follow common sense, and certain rules, or laws, like dealing with your waste properly, not burning circuit boards, not buying stolen gold and melting or dissolving it ...
Even using or chemicals nowadays brings attention or can raise eyebrows, because most people think they are only used for drug making or other illegal activity.
Keeping this hobby low key is a good idea, you do not need unwanted attention from somebody who thinks you have a batch of gold they can steal, or from someone who may report that they suspect you have a drug lab, or from some overzealous (chemically uninformed, environmentalist) regulatory agency employee.
Keeping MSDS sheets and using safe practices in your lab, using and storing the chemicals safely, understanding and dealing with waste properly, and being able to explain how it is done, can be helpful when you do get a visit from a government official like DEQ, or the EPA official, or law official.
Being able to explain that you are not breaking the law, before they cuff you and take you in.
If this is a business, and not a hobby, you may have a bit of different set of laws to follow, and also depending on scale, or volume of materials you work with some of the rules can change.
Not all laws or rules are the same for every city, state, county, or country, so we need to understand our laws the best we can. Example, say it could be illegal to have a 5 pound can of KNO3 at your home in one country, but in another country they may not care if you have it at all (although they may wonder why you have it and want to investigate you to see if you are up to no good.
These days it is hard to do much of anything without breaking some kind of law, with so many laws already on the books, and so many law makers who think it is their job to make many more laws every day, ignorance of the law is no excuse, and even lawyers argue what is in the law and what is not, none of us can know them all, but we can try to educate ourselves the best we can about what laws we need to follow, and use our common sense to do what is right.
What is legal today can be illegal tomorrow, take mining, or dredging for gold in my area for example.