You're running the hashes, both outer and inner on strings of hex. Thats wrong.
You haven't included enough of your sage output to see if you got the ECC parts right, ... you shouldn't need any mods at all if you're using the right object types, see the notebook on bitcoin.ninja.
please show me the right scripts to hashing the unsigned tx...!
i'm beginner about this....
