Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [encoding]

The tag has no usage guidance.

0
votes
1answer
17 views

what type of encoding is used by the abi specification in solidity

the abi specification of solidity which provides functions like abi.encodePacked() using a certain type of encoding (eg: for functions, a 4 byte function signature hash followed by encoding of ...
0
votes
0answers
19 views

web3py encode method call parameters

I want to encode the parameters needed to call a contract method. In web3js I would use web3.eth.abi.encodeParameters(types, values); I need to do the same in python I found a function called ...
2
votes
0answers
26 views

What are function signatures in ABIv2 and how are they enhancing Ethereum?

EIP-712 talks about function signatures being bytes4. I understand that the new version of the ABI format will contain a pre-defined set of keccak256 hashes of function names, as per the work done on ...
0
votes
1answer
36 views

Is Data Stored on Ethereum encrypted or only RLP encoded?

Is Data Stored on Ethereum encrypted or only RLP encoded? If data is not encrypted, is there some way to secure and encrypt it using AES encryption algorithm in cipher block chaining (CBC) or XTS mode ...
0
votes
0answers
24 views

Deserialising bytes to a solidity struct

Say I have a struct like struct AppState { address player1; address player2; uint256 winner; uint256[100] board; uint256 move; } Now I have a function which receives a byte ...
0
votes
2answers
145 views

abi.encodePacked with lot of zeros

According this documentation types shorter than 32 bytes are neither zero padded nor sign extended and When I use abi.encodePacked(address, uint, uint, address) I am getting a result with lot of ...
2
votes
1answer
148 views

ethereumjs-abi equivalent for Golang?

ethereumjs-abi is great for easily ABI encoding and decoding in javascript. Is there an equivalently simple package for Golang? Geth's accounts/abipackage does this, but there's a lot of setup and it'...
0
votes
1answer
18 views

As of today (Solidity v0.4.22)… Is there a way to return structs from public functions?

https://medium.com/coinmonks/solidity-tutorial-returning-structs-from-public-functions-e78e48efb378 According to this article (link above), on Medium I'd have to use tuples... but this was so in ...
1
vote
1answer
414 views

How to unpack/decode parameters encoded with web3.eth.abi.encodeParameters in Solidity?

My client app (nodejs) packs some arguments to pass to a smart contracts as bytes _data (similar to ERC223 calls with fallback). I pack the arguments in my JS client like this: const packedArgs = ...
0
votes
1answer
53 views

Potential attack

I have two computers, one of them is airgapped. I had also two MEW private key, stored in the airgapped computer, I made a lot of transaction from the first private key to the second one. ...
0
votes
1answer
35 views

Apparent mismatch between Oraclize CBOR and python3 CBOR encodings

I encoded a value using the Oraclize CBOR library like so: Buffer.buffer memory cborArgs; Buffer.init(cborArgs, 64); cborArgs.startArray(); cborArgs.encodeUInt(10); cborArgs....
1
vote
1answer
96 views

No luck recovering public key after EIP 155

I'm trying to understand Ethereum transaction signing, but for some reason I'm unable to verify the signature. I have a test account, 0xb2c899884790aa9e256a2d4b2256ca3319e64e32, its public key is ...
0
votes
0answers
54 views

vyper dynamic encoding types offsets

I'm looking at dynamic types and I'm trying to understand the encoded example f(uint,uint32[],bytes10,bytes) with values (0x123, [0x456, 0x789], "1234567890", "Hello, world!") to get the offset ...
1
vote
0answers
23 views

What's the point of RLP over other encoding formats? [duplicate]

What makes Ethereum need an encoding like RLP? What's so special about this format over others? How does it fit in specifically for Ethereum's needs?
0
votes
0answers
92 views

How to send address with eth_call for a contract function?

I'm trying to use cryptokitty contract function https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code, tokensOfOwner(address) I guess i'm did a mistake with encoding address ...
1
vote
1answer
153 views

Using web3.js to do base58 (ipfs) encoding and decoding?

Is it possible to use the web3.js libary to do base58 encoding and decoding? It seems that web3.js includes the bignumber library, but I'm unsure as to whether this can handle the base58 encoding ...
3
votes
2answers
562 views

How to RLP-encode messages in Solidity

I'm trying to figure out how to interact with the current version of the Casper contract from Solidity. The vote-function in the casper contract takes an array of bytes, which represents the RLP-...
1
vote
2answers
330 views

field size and value range of chainId (EIP-155)

EIP-155 defined a list of chain IDs, e.g. main net is 1 Ropsten is 2. I don't seem to be able to find a definition about its supposed value range and data size. Quoting the yellow paper rule (287) ...
2
votes
1answer
154 views

Encode raw transaction data for inner transaction data for transfer using erc223

How do I encode data for inner transaction call of ERC223Receiver contract after transferring erc223 tokens to it? example: Contract ERC223Receiver { function foo(uint256 a) { // some ...
0
votes
1answer
588 views

How to convert decode/encode string to Base58?

How to convert decode/encode string to Base58 on solidity?
5
votes
1answer
1k views

Python and Solidity keccak256 function gives different results

I am working on implementing a smart contract application in which, on and off chain calculations will exist. I will have to calculate the Hash Function of multiple integers with Python and Solidity. ...
2
votes
1answer
655 views

How to encode dynamic types when calling a contract function?

I am trying to figure out how to calculate the offset in bytes to the start of their data area, measured from the start of the value encoding as described here in the Solidity docs for dynamic ...
7
votes
3answers
1k views

How to decode Log.Data in Go

I'm fetching the logs using client.SubscribeFilterLogs. The event parameters are encoded in types.Log.Data. How can I decode it in go?
0
votes
1answer
37 views

Where can I test programming tokens?

When I follow the instructions on ethereum.org I need to download the wallet and sync it again by downloading all the blocks. This takes hours everytime, I feel I'm missing out on something. Is there ...
1
vote
2answers
772 views

How do I do the equivalent of Solidity's bytes32(a_signed_integer) in JavaScript?

I've got an app that takes various kinds of input via an HTML form, but always ends up sending it to a contract as bytes32. The expectation is that another contract that ultimately consumes the data ...
0
votes
1answer
230 views

user api to exchange eth token and wallet address creating using code

Is there any API to help exchange ether or tokens online which will help in coding an exchange. For bitcoin one can generate a wallet address, is it possible to generate a wallet address for Ethereum ...
2
votes
1answer
190 views

Encoding multidimensional arrays in raw transaction data

Say, there is a function in a contract: function foo(uint[2][2][2] numbers) {} How the following array should be encoded in raw transaction data? [ [ [ 1, 2 ], [ 3, 4 ] ], ...
2
votes
2answers
446 views

What is the correct encoding for geth keystore files?

I'm attempting to import a transcribed geth UTC--... format keyfile into geth on ubuntu, using this guidance, and am getting the following error: Fatal: Failed to load the private key: encoding/hex: ...
2
votes
0answers
442 views

What encoding is used for Ethereum addresses? [duplicate]

Is it Base58Check, which is used for Bitcoin addresses? Or something else?
1
vote
0answers
36 views

Case - does it make sense? [duplicate]

Am I right, that 0xc1384BAFDD139a61998e1f612948da22fD878BD2 and 0xc1384bafdd139a61998e1f612948da22fd878bd2 are the same addresses? I'm asking, because, for example, in Bitcoin base64 is used, so ...
1
vote
1answer
356 views

Ethereum Contract ABI - Encoding for functions with no arguments

I am using argument encoding from this page (https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) to build data field for offline signing. I am using eth.sendRawTransaction to call a function ...
2
votes
0answers
319 views

eth_sendTransaction for function with address type parameters

I'm interacting with my local private blockchain created using geth. I'm able to use eth_call, but now I have some problems with eth_sendTransaction. The signature of the function is this: function ...
5
votes
1answer
388 views

Storing hardcoded calldata in a Solidity contract

I've been trying to store a hardcoded call in a contract, but I'm getting confused on the encoding. Let's say I have the following bytes: ...