The current pattern of using o1js' Gadgets.ForeignField is wrong: you're converting Field3 to/from bigint in every operation. This will fail in provable code -- bigint operations are not provable, and you can't read out JS values of provable types like Field3 in a circuit.
To make an operation provable, you need to build a circuit, not just do normal JS operations. We have a lot of methods for building circuits, like Gadgets.ForeignField.{add(),mul()} and of course all the lower-level methods on Field to operate on the individual limbs of a Field3.

The current pattern of using o1js'
Gadgets.ForeignFieldis wrong: you're convertingField3to/from bigint in every operation. This will fail in provable code -- bigint operations are not provable, and you can't read out JS values of provable types likeField3in a circuit.To make an operation provable, you need to build a circuit, not just do normal JS operations. We have a lot of methods for building circuits, like
Gadgets.ForeignField.{add(),mul()}and of course all the lower-level methods onFieldto operate on the individual limbs of aField3.