Ecdsa.recover_x_if: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend as Ecdsa Lines 215-220 of bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend&start_line=215&end_line=220 import Base import bend-collections@1.0.0.0/spec/crypto/secp256k1/curve.bend as CV # R: the point of x-coordinate x = r + j n (j = id / 2, x < p) whose y has # parity id mod 2 def recover_x_if(+one: Nat, +e: Nat, +r: Nat, +s: Nat, +id: Nat, +x: Nat, ok: Bool) -> Maybe<&2, List<&2, U32>>: match ok: case True{}: recover_r(one, e, r, s, CV.decompress(p(one), x, Nat.mod(id, 2n))) case False{}: None{} Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/secp256k1/curve.bend&name=decompress https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend&name=p https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend&name=recover_r