The speed of sound of regular air is 343 m/s. Blast waves move between 4-8 km/s. 50km/s is quite a bit above that. Projectiles fired from cannons can move at most the speed of sound of the propellant gas. I'm not quite sure of the speed of sound of the propellant gas resulting from a C4 or cordite explosion, but I'm pretty sure it's much closer to 8km/s than 50km/s. In short, even using high explosives like C4, it's impossible to move a projectile at 50km/s using a cannon.
However, all is not lost. Using a rocket, you can move faster than that limit, since you're not relying on a blast wave to push you.
A 4mm ball of tungsten has a mass of 5.17g. Military grade solid rocket propellant (which includes RDX, the active ingredient in C4) has a specific impulse of 268 seconds in a vacuum (lower in atmosphere), per Wikipedia.
The rocket equation is:
$$\Delta v = I_{sp}g_0 \ln\frac{m_0}{m_f}$$
Where $\Delta v$ is the desired change in velocity (which is 50 km/s), $I_{sp}$ is the specific impulse (268 seconds), $g_0$ is acceleration due to gravity (9.81), $m_f$ is the dry mass of the rocket (we shall assume it to be the minimum of 5.17g, the mass of the tungsten ball), and $m_0$ is the mass of the rocket including fuel. We're looking for the value of $m_0 - m_f$.
Solving for $m_f$:
$$5\times10^4ms^{-1} = 2.68\times10^2s\times9.81ms^{-2}\ln\left(\frac{m_0g}{5.17g}\right)$$
$$m_0=5.17\times\exp\left(\frac{5\times10^4}{2.63\times10^3}\right)$$
So $m_0 \approx 9.33 \times10^8$ (rounding to 3 significant figures). That means you'd take about 933 thousand kilograms of military grade rocket fuel to accelerate your 5.17 grams of tungsten. This is probably too much to be practical, and this is already assuming conditions extremely favourable to the launch (you're in a vacuum, there's no rocket hull, only the tungsten ball). In practice, you'll probably need a few more times rocket fuel, rendering this concept even less practical.