HUSH RandomX currently has two advanced options that some may want to use:
*`ac_randomx_interval` controls how often the RandomX key block will change
* The default is 1024 blocks and is good for most use cases.
* This corresponds to ~17 hours for HSCs with the default block time of 60s
*`ac_randomx_lag` sets the number of blocks to wait before updating the key block
* The default is 64 blocks
* This corresponds to 64 mins for HSCs with the default block time of 60s
*`ac_randomx_interval` should always be larger than 2 times `ac_randomx_lag`
* Setting these to arbitrary values could affect the chain security of your coin
* It is not recommended to change these values unless you are really sure why you are doing it
# RandomX Internals
This section is not required reading if you just want to use it as a PoW algorithm for an HSC. Here we will explain how the internals of RandomX works inside of the Hush codebase.
We use the official RandomX implementation from https://github.com/tevador/RandomX with custom configuration options. If some type of hardware is created to mine the XMR RandomX algorithm, it will not be compatible with the Hush RandomX algorithm. This is by design. All Hush Arrakis Chains use the same RandomX config options, so if a hardware device is created to mine one HSC that uses RandomX, it can be used to mine any HSC using RandomX. Every HSC with unique consensus parameters will start off with it's own unique key block with at least 9 bytes of entropy.
The source code of RandomX is embedded in the Hush source code at `./src/RandomX` and the configuration options used are at `./src/RandomX/src/configuration.h` .
The changes from default RandomX configuration options are listed below.
```
//Argon2d salt
-#define RANDOMX_ARGON_SALT "RandomX\x03"
+#define RANDOMX_ARGON_SALT "RandomXHUSH\x03"
//Number of Argon2d iterations for Cache initialization.
-#define RANDOMX_ARGON_ITERATIONS 3
+#define RANDOMX_ARGON_ITERATIONS 5
//Number of parallel lanes for Cache initialization.
#define RANDOMX_ARGON_LANES 1
@@ -53,13 +53,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define RANDOMX_DATASET_EXTRA_SIZE 33554368
//Number of instructions in a RandomX program. Must be divisible by 8.
-#define RANDOMX_PROGRAM_SIZE 256
+#define RANDOMX_PROGRAM_SIZE 512
//Number of iterations during VM execution.
-#define RANDOMX_PROGRAM_ITERATIONS 2048
+#define RANDOMX_PROGRAM_ITERATIONS 4096
//Number of chained VM executions per hash.
-#define RANDOMX_PROGRAM_COUNT 8
+#define RANDOMX_PROGRAM_COUNT 16
```
RandomX opcode frequencies were not modfiied, the defaults are used.