There’s a whole niche of legal scholarship around this idea (and some startups): https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5331811