That is called tracing. It’s also not hard - every node does it to verify blocks.
When blocks are verified it just needs to validate that sum of the outputs isn't more than the sum of the inputs. It doesn't care about tracking what went where.
When blocks are verified it just needs to validate that sum of the outputs isn't more than the sum of the inputs. It doesn't care about tracking what went where.