# If SNARKs generally work in finite fields, how are non integer values handled - say fixed point decimal numbers?

In Vitalik Buterin's write-up on SNARKs Quadratic Arithmetic Programs: from Zero to Hero, he writes

Note that the above is a simplification; “in the real world”, the addition, multiplication, subtraction, and division will happen not with regular numbers, but rather with finite field elements

I assume SNARKs are used in blockchains to hide & also verify the transactions. However, blockchain transactions may involve non-integer amounts (the sender is sending a fractional amount), so how are the private (witness) & public inputs which involve non-integer numbers represented in finite fields?

UPDATE from one of the answers:

Since a Satoshi is 0.00000001 BTC every send/receive transaction can probably be an integer value.

Is there any other stuff on a blockchain which are shielded by zkSNARKs and can have non integer values or everything for which zkSNARKs are used on a blockchain is integer values?

• I didn't realize blockchain transaction values are floating points. I always thought financial data would use fixed-point numbers for accuracy. Commented Feb 8, 2023 at 12:00
• @DannyNiu - I have updated the question - I actually wanted to ask about any non-integer values Commented Feb 8, 2023 at 12:10
• Your question has been answered. In practice under finite precision all values are rational, and can be boosted up to integers by multiplying with the denominator. Commented Feb 9, 2023 at 23:34
• @kodlu - I also want to know if there are any kinds of SNARK shielded transactions/computations on a blockchain which need this type of boosting Commented Feb 10, 2023 at 1:10

If necessary, this can be done by sending all $$n$$ digits of the fraction (it has to be finite length to be represented digitally) and an encoding (in $$\log_2(n+1)$$ bits) of the position of the decimal point. However it may not be needed, one can simply express the transaction as an integer multiple of a minimum allowed amount in fractional satoshis.
• A UTXO (unspent transaction output) can have an arbitrary value denominated as a multiple of satoshis - Since a satoshi is 0.00000001 BTC every transaction is an integer value, right? So there is no chance a SNARK will involve non-integers on a blockchain? Commented Feb 8, 2023 at 12:53