1

I am attempting to verify BLS signatures using the Chainsafe BLS library. I am attempting to independently verify signatures associated with deposits to the ETH Deposit Contract. In order to test that I am using the library correctly, I used the verify function on the following deposit.

When I attempted to verify the deposit, the function returned false.

I made a couple of assumptions which may have led to this error.

  1. I inputed all arguments as strings.
  2. For the message parameter, I inserted the users withdrawal credentials

This is what my function looked like:

bls.verify('8B0F65FDDD2F4A5228114BCFB7594806BD7B1A0D08C6EC4D4E050EBEE56B9EAD36A65B8581D23EE142E81499A0CE2193',
'00A96066AC9AB401F87AD05E2ED4E6DF5AE2658E532BF2753DB8A0907EFF72A8', 
'92507CDF84A2EFDF41202492A227684DB679CE8F811C313747CD3B25CB6701D50E2A32327CF374DB82862EC482BDA7D30CF8C0823617C2252E6CB8C771EF358FDF092B30CBE2249B8D752F9521BA7653FB198C8B692734C331E21887977186F0')

How did I do?

0

You can find the canonical definition of the deposit signature in ethereum/eth2.0-specs: process_deposit. Specifically, it is this code:

# Verify the deposit signature (proof of possession) which is not checked by the deposit contract
deposit_message = DepositMessage(
    pubkey=deposit.data.pubkey,
    withdrawal_credentials=deposit.data.withdrawal_credentials,
    amount=deposit.data.amount,
)
domain = compute_domain(DOMAIN_DEPOSIT)  # Fork-agnostic domain since deposits are valid across forks
signing_root = compute_signing_root(deposit_message, domain)
if not bls.Verify(pubkey, signing_root, deposit.data.signature):
    return

The message isn't just the withdrawal_credentials, it's the signing_root (a.k.a. merkle root) of a DepositMessage obect. Due to the complexity involved I won't go into detail to describe the entire process but the specs (linked above) should be comprehensive enough to describe the process exactly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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