Chemical engineer Pavlo Lapshyn, 32, used salt, copper wire, pencil and other substances to form an ingredient which could be used to cause an explosion.
When officers at the category A prison found a plate with a white substance on it in his cell in August 2018, he told them he was trying to make a firework.
Lapshyn, a Ukrainian national, had just started a work placement in the UK when he murdered 82-year-old Mohammed Saleem in Walsall by randomly stabbing the grandfather in the back with a hunting knife in 2013.
In the following months he planted bombs near mosques in the West Midlands, later stating his aim was to start a race war.
Since he was jailed for life with a minimum term of 40 years he has been psychiatrically assessed and has an autism diagnosis and "significant mental health problems", Leeds Crown Court heard.
He pleaded guilty to making an explosive substance via a videolink from HMP Whitemoor.
The defendant was heard singing at points during the hearing and lifted up his jumper to reveal a phallic symbol drawn on his chest.
He was returned to his cell during the hearing after declined to be present when Judge Tom Bayliss QC passed a two-year jail sentence.
Peter Hampton, prosecuting, said Lapshyn admitted to officers that he had been preparing chemicals during their routine search of his cell and they informed counter-terrorism specialists in the prison.
They knew of his background as a chemical engineering PhD student, his racially-motivated murder and explosives campaign, and "a long-standing interest in pyrotechnics", Mr Hampton said.
The defendant told officers he was trying to produce potassium chloride. A smell of bleach could be detected in the cell.
A forensic expert who was called in determined Lapshyn had formed a viable explosive substance.
Attempts were made to interview the defendant about this, the court heard, but he was unable or unwilling to assist.
After moving to HMP Whitemoor, he wrote a chemical formula on his cell wall which he said was related to pyrotechnics.
Searches of his cell there found he was hiding substances including vinegar, artificial sweetener and salt.
Mr Hampton said of his offending at HMP Wakefield: "The defendant's actions clearly caused the risk of explosion or fire within a category A prison, potentially to harm officers, other prisoners or Mr Lapshyn himself, and interferes with the general running of the prison."
Judge Bayliss said it was right for the CPS to bring the prosecution but he would not pass a consecutive sentence as Lapshyn - whom he described as a "highly intelligent man" - was already serving a minimum term of 40 years.
He said: "He wouldn't even be considered for release by the Parole Board until he is 65 and he is very unlikely ever to be released given his position."