Some smart contract application requires as a common requirements to attach a legal prose to the document that can be validated even by notary or legal services. From a technical point of view, the legal prose is a document that is not stored directly in the blockchain, only the hash of the document. Storage possibility might be different decentralized file systems, like IPFS or Swarm. The legal document must be in a well-formed format that does not contain visual elements, like an XML format similarly to CEN Metalex might work. The document should derive some of the elements from the smart-contract. One implementation might be that the contract document itself is just a template that needs parameters to be found only in the smart contract itself. Another option is to copy these parameters at each update to the contract itself and update the hash as well.
A further challenge arises at the fact of the immutability of the ledger. Even legal contracts should probably have something as a retention policy, meaning that after a certain time the information might needed to be deleted from the blockchain, which has some further challenges at the given blockchain technologies.
Last but not least, privacy of such a solution is needed to be carefully designed, that might issue some more unexpected challenges.