In this paper we use matrices, whose entries satisfy certain linear conditions, to obtain composition identities $f(x_i)f(y_i)=f(z_i)$, where $f(x_i)$ is an irreducible form, with integer coefficients, of degree $n$ in $n$ variables ($n$ being $3,\,4,\,6$ or $8$), and $x_i,\,y_i,\;i=1,\,2,\,\ldots,\,n$, are independent variables while the values of $z_i,\;i=1,\,2,\,\ldots,\,n$, are given by bilinear forms in the variables $x_i,\,y_i$. When $n=2,\,4$ or $8$, we also obtain composition identities $f(x_i)f(y_i)f(z_i)=f(w_i)$ where, as before, $f(x_i)$ is an irreducible form, with integer coefficients, of degree $n$ in $n$ variables while $x_i,\,y_i,z_i,\;i=1,\,2,\,\ldots,\,n$, are independent variables and the values of $w_i,\;i=1,\,2,\,\ldots,\,n$, are given by trilinear forms in the variables $x_i,\,y_i,\,z_i$, and such that the identities cannot be derived from any identities of the type $f(x_i)f(y_i)=f(z_i)$. Further, we describe a method of obtaining both these types of composition identities for forms of higher degrees. The composition identities given in this paper have not been obtained earlier. We also obtain infinitely many solutions in positive integers of certain quartic and octic diophantine equations $f(x_1,\,\ldots,\,x_n)=1$ where $f(x_1,\,\ldots,\,x_n)$ is a form that admits a composition identity and $n=4$ or $8$.