> can the government enforce that the software has to be written a certain way?<p>The answer is yes, but this is not enforcing that the software is written a certain way, it is proposing to regulate proof-of-work energy use because of it’s negative environmental effects. The government already does regulate the environmental <i>outcomes</i> of many other businesses, and not necessarily the method by which they achieve this outcome. Also see export controlled software. Car exhaust, factory exhaust, chemical dumping, waste dumping, water pollution, toxic waste storage… there’s a <i>huge</i> list of regulations that are both constitutional and good for society.<p>> it sounds like code is considered free speech<p>That has no bearing, and sounds like a misconception about what Free Speech actually is. Free Speech rights in the US do not give you the right to say anything you want without consequences. They only prevent the government from jailing you over some kinds of public speech, and there is a long list of types of speech that are not protected (Google “free speech exceptions”). Generally speaking, the kinds of speech that are not protected are the kinds that do harm to society, so regardless of whether you consider code to be speech, some kinds of speech are not only not protected, there is mountains of precedent for regulation and punishment of speech that does damage.