  The purpose of this article is to introduce the relative $p$-capacity
$\Cap_{p,\Omega}$ with respect to an open set $\Omega$ in $\IR^N$. It is a
Choquet capacity on the closure of $\Omega$ and extends the classical
$p$-capacity $\Cap_p$ in the sense that $\Cap_{p,\Omega}=\Cap_p$ if
$\Omega=\IR^N$. The importance of the relative $p$-capacity stems from the fact
that a large class of Sobolev functions defined on a 'bad domain' admit a trace
on the boundary $\partial\Omega$ which is then unique up to
$\Cap_{p,\Omega}$-polar set. As an application we prove a characterization of
$W^{1,p}_0(\Omega)$ for open sets $\Omega\subset\IR^N$.
