I am trying to originate a contract using bls12_381_fr types and am running into an error. The same contract originated successfully on the edo branch of the Metastate repository.

Now I am running the latest-release branch on the Tezos repo but get this error when I try to originate the same contract.

  Invalid primitive.
  Primitive bls12_381_fr has invalid case.

EDIT: I am running it on sandbox mode and I ran tezos-activate-alpha.

EDIT: I am on hash 6102c808a21b32e732ab9bb1825761cd056f3e86 with latest-release. Also, here is the exact contract I am trying to originate. Note that it has no storage arguments.

  • Can you please give more information on your setup? Which network is your node connecting to if any? Commented Feb 23, 2021 at 11:43
  • In tezos-client you can force a protocol version using the --protocol argument. Commented Feb 23, 2021 at 11:44
  • i just edited the question to include that it's in sandbox mode with alpha activated. Okay, I thought edo was active on the main release though and so I would be able to use the default protocol?
    – Darius
    Commented Feb 23, 2021 at 11:48

2 Answers 2


Edo2net is not the default protocol in sandbox.

You will need to provide the --protocol-hash arg:

tezos-sandbox mini \
   --size 1 \
   --number-of-boot 2 \
   --protocol-hash PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA \
   --no-baking \
   --until-level 2_000_000 \
   --timestamp-delay=-3600 \


Can you give more information on your setup? Like which hash do you use?

In the latest versions of BLS12-381 (used by Edo), it has been decided to pad the bytes for Fr elements. Some users requested it because it was a bit annoying to push 32 bytes if the elements should represent 5 for instance (which can be encoded with 0x05). Previous versions of BLS12-381 used in Tezos were not padding (up to November 2020 I think), and PUSH bls12_381_fr 0x05 was not valid. Now, PUSH bls12_381_fr 0x05 is equivalent to PUSH bls12_381_fr 0x05000000000000000000000000000000) The current version of latest-release (6102c808a21b32e732ab9bb1825761cd056f3e86) does include the padding.

  • Also a good example by SmartPy: smartpy.io/ide/?template=bls12_381.py The test environment supports all Michelson operations. Commented Feb 23, 2021 at 13:42
  • Thanks, I added the hash and also the contract I'm trying to originate. I don't think the padding is an issue since the contract has no storage, and all I am trying to do is originate it. As Rodrigo pointed out above though, I am running sandbox using ./src/bin_node/tezos-sandboxed-node.sh 1 --connections 1, and not specifically selecting Edo2net, so i think that might be the issue.
    – Darius
    Commented Feb 23, 2021 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.