CRYPTO NEWS

Why the definition of bilinearity property is different in cryptography compared to mathematics?

Background:

In Wikipedia (bilinear map definition), a condition listed as the following:

For any $lambda in F, {displaystyle B(lambda v,w)=B(v,lambda w)=lambda B(v,w)}$


In a math.stackexchange post, i saw this comment:

which defines bilinearity in the same way as the Wikipedia link. So I assume, the above definition of bilinearity is correct.


Now, the problem:

in the pairing-based cryptography setting:

the bilinearity is defined as such:
${displaystyle forall a,bin F_{q}^{*}, forall Pin G_{1},Qin G_{2}: eleft(aP,bQright)=eleft(P,Qright)^{ab}}$

The question:

in math: bilinearity is: $eleft(aP,bQright)=eleft(P,Qright)ab$ (a and b have become coefficients)

in crypto: bilinearity is: $eleft(aP,bQright)=eleft(P,Qright)^{ab}$ (a and b have become exponents)

Why is this difference? Aren’t the definitions conflicting with each other? In wicktionary I saw the following explanation:

Linear (preserving linear combinations) in each variable.

How come $eleft(aP,bQright)=eleft(P,Qright)^{ab}$ is preserving the linear combinations? Isn’t exponent and coefficients are very different and not linear with each other?

Obviously, math is correct, and crypto is also correct. So, I really appreciate if someone can point out to me where am I missing the details or misinterpreting them?

P.S: someone in crypto.stackexchange defined the bilinearity as:

Bilinear: for all g āˆˆ šŗ1 and a; b āˆˆ $Z_{q}^{*}, e(g^a, g^b) = e(g,g)^{a,b}$

I haven’t seen this notation at all. Is the definition of bilinearity loose? So there can be multiple definitions? If so, why and how?

Unpacking arguments when calling a smart contract function with web3.py

I’m trying to reproduce some code on python that is currently working on javascript. The main goal is to select a function to query from the contract abi and call it (just view functions). Let’s say that I want to call the balanceOf method of an ERC-20 contract. In javascript I do it like this:::Listen

I’m trying to reproduce some code on python that is currently working on javascript. The main goal is to select a function to query from the contract abi and call it (just view functions).

Let’s say that I want to call the balanceOf method of an ERC-20 contract. In javascript I do it like this:

const callContractFunctionWithParams = async (selection, params, block) => {   try {     console.log(`[QUERYING] Calling ${selection} method on block ${block} `);      const result = await fullNodeContract.methods[selection](...params).call(       (defaultBlock = block)     );     console.log(       `[${selection}-RESULT] Results from calling ${selection} method on block ${block}: `,       result     );   } catch (error) {     if (isArchiveQuery(error)) {       console.log("[OLD-BLOCK-QUERY] Switching to archive query");       const result = await archiveNodeContract.methods[selection](         ...params       ).call((defaultBlock = block));       console.log(         `[${selection}-RESULT] Results from calling ${selection} method on block ${block}: `,         result       );     } else {       console.error(error);     }   } }; 

Here I switch dinamically between querying a full or archive node depending on the block and the error raised. The selection variable represents the name of the function and the params are the inputs (array-like) required from each distinct function. This work like a charm with web3.js.

On the other side I have this code on python that attempts to do just the same:

def call_contract_function_with_params(selection, params, block):     print("Params: ", params)     try:         print("[QUERYING] Calling {} method on block {}".format(selection, block))          result = full_node_contract.functions[selection](*params).call(             block_identifier=block         )          print(             "[{}-RESULT] Results from calling {} method on block {}: ".format(                 selection, selection, block             ),             result,         )      except Exception as e:         if "missing trie node" in str(e):             print("[OLD-BLOCK-QUERY] Switching to archive query")              result = archive_node_contract.functions[selection](*params).call(                 block_identifier=block             )              print(                 "[{}-RESULT] Results from calling {} method on block {}: ".format(                     selection, selection, block                 ),                 result,             )          else:             print("error: ", str(e)) 

Same here, selection is just the function name to call and params are the inputs expected for the function (list type). However, if I run the code on python it prints

[QUERYING] Calling balanceOf method on block 15342721 error:   

Any thoughts on this? Thanks in advance for any help!

Why the definition of bilinearity property is different in cryptography compared to mathematics?

Shopping cart
There are no products in the cart!
Continue shopping
0