should be refactored _Originally posted by @mmagician in https://github.com/0xMiden/protocol/pull/2639#discussion_r2960032109_