Raft is used to Replicate write in a shard but distributed transaction is used to make transaction that span several shard atomic (ACID).
I could find the implementation at : https://github.com/pingcap/tikv/blob/master/src/storage/mvcc...
But a lot of the detail are not clear.