2022 Developer Survey is open! Take survey.
10 votes
Accepted

How can I generate a wallet in python?

It looks like you're in Python 2. Py2 represents bytes in a latin-1 encoded string. Sometimes you'll see ascii characters, other times you'll see something like \x18 which means the byte 00011000, aka ...
user avatar
  • 6,041
9 votes

Whats the difference between pyethapp and pyethereum?

Pyethereum is the core blockchain related logic: transactions, blocks, contract VM, etc.... Pyethapp uses both pydevp2p for the p2p logic along with Pyethereum to create a complete Ethereum client. ...
user avatar
  • 6,003
6 votes
Accepted

Calling specific functions within a contract using pyethereum

The tutorial you reference is very old in terms of how fast this technology is moving. If you're trying to learn how to create, deploy, and call functions on a contract, I would recommend you look at ...
user avatar
  • 6,003
6 votes

Are there any implementations of smart contracts in Python?

pythereum and pythapp - your question tags - are Python implementations of Ethereum's core library and command line client respectively. They are orthogonal to the language in which smart contracts ...
user avatar
6 votes
Accepted

Verifying personal.sign signature with pyethereum

Everything in Python looks correct. The message hash in JavaScript is being generated incorrectly. Preparing the Message Hash in Javascript The message hash must be generated using the original ...
user avatar
  • 6,041
5 votes

Are there any implementations of smart contracts in Python?

Ethereum smart contracts need to compile to EVM (Ethereum Virtual Machine) bytecode. There are no Python to EVM compilers, and for some of the challenges, see What is the merit of creating new smart ...
user avatar
  • 78k
5 votes
Accepted

pyethapp dependence secp256k1 install failed on OS X

You're missing libtool. You can install it from homebrew with brew install libtool Furthermore we advice that you always run pyethapp within a virtualenv.
user avatar
5 votes
Accepted

How can I change the gas price or the gas limit when testing with pyethereum?

Use t.gas_limit and t.gas_price. For gas limit, since you usually only want to set it once: Set t.gas_limit before t.state(). Example t.gas_limit = 3000000 Otherwise can do self.s.abi_contract(...
user avatar
  • 78k
5 votes
Accepted

Fastest way to send transactions

What can I do to ensure my transactions hit the blockchain as fast as possible? Most simply, the miner who finds the next block must have your transaction in their pool, and choose to include it. ...
user avatar
  • 6,041
4 votes
Accepted

Storing data in the blockchain inside a transaction

The size of data field is dependent on the block gas limit. In the Ethereum public blockchain, the limit for the data field was 89kb as of Feb 7, 2016. Source. You can use a similar methodology to ...
user avatar
  • 3,795
4 votes

How can I change the gas price or the gas limit when testing with pyethereum?

You can change the start gas here: self.mycontract = self.s.abi_contract(code, gas=3000000, language='solidity', sender=t.k0) But I'm not sure if that's the actual problem
user avatar
  • 6,003
4 votes
Accepted

RLP encoding of 0

It appears that encoding the integer 0 no longer equates to \x00 (as the documentation would imply). This can be seen both in your example, and in the fact that it can't be decoded: >>> ...
user avatar
4 votes

pyethapp ImportError: cannot import name blocks

To get a working version in a virtualenv on Ubuntu 17 I first did (as per @audiomason suggestion above - I haven't tried without this step): pip install ethereum==1.6.0 pyethapp==1.2.0 then (fixes ...
user avatar
  • 7,814
3 votes

TestRPC - Pythereum - No handlers could be found for logger "jsonrpc.manager"

Adding below two lines to bin/testrpc file worked for me. import logging logging.basicConfig()
user avatar
  • 95
3 votes
Accepted

How to sync pyethapp (python ethereum client) with the mainnet?

The answer is patience. pyethapp is rather a proof of concept implementation than a production ready node. I had to wait several hours until I noticed the client started to synchronize the main ...
user avatar
  • 31.3k
3 votes

Calling specific functions within a contract using pyethereum

As @dbryson said that tutorial is ancient[1]. To add to some Python references, see pyethapp and its documentation including Getting Started. web3.py may also help. As you might be using Serpent, ...
user avatar
  • 78k
3 votes
Accepted

Generating accounts with pyethereum is insanely slow

Account generation is slow by design. Part of the account generation process involves scrypt or pbkdf2, password hashing algorithms that are designed to be slow in order to mitigate brute force ...
user avatar
3 votes

How to apply pyethrecover.py on v3 .json/transfor v3 .json to .v1

I had the same problem. I had created a wallet using geth and somehow I wrote down the wrong password. I used the simple python code below to solve the issue. I know it's not pretty, but I just needed ...
user avatar
  • 41
3 votes
Accepted

(Python) eth_getFilterChanges --> data --> how to decode?

Solved the decode_abi function expects binary data filterChanges=[{u'address': u'0x3673d5b436089c9aa3f59df5062c7431c86c21d7', u'blockHash': u'...
user avatar
  • 356
3 votes
Accepted

How to generate a raw transaction with data using Pyethereum

0x3078616263646566 is the hex representation of the UTF-8 encoding of the string "0xabcdef". "0" is hex 30, "x" is hex 78, and so on. Try passing in b'\xab\xcd\xef' as the data, instead. You can ...
user avatar
  • 6,041
3 votes

How open local ethereum chain (leveldb) using PyEthereum package?

(This isn't a full answer - as I'm not familiar with how Pythereum does things - but might be a potential starting point.) Have a look at the State() class in state.py. This appears to have some ...
user avatar
3 votes
Accepted

How open local ethereum chain (leveldb) using PyEthereum package?

I had the same issue. It looks like the database layer in pyethereum has been abstracted out such that databases other than leveldb can be used. The challenge is that even if you pass a leveldb object ...
user avatar
  • 146
3 votes

How to send a transaction to myetherapi.com with Web3.py

eth_sendTransaction is not on the list of Allowed Methods shown at http://www.myetherapi.com/ eth_sendTransaction assumes that the node has access to the private key of the account that you're ...
user avatar
  • 6,041
3 votes

What Sequence Occurs 'Under the Hood' When an Ethereum Contract Function is Called?

There will be differences between EVM implementations as to how they get the job done, but they all should produce the same results if they conform to the yellowpaper. I took a look at the VM code for ...
user avatar
  • 428
3 votes
Accepted

What is pyethereum?

So what is it's use? pyethereum - the core library, featuring the blockchain, the ethereum virtual machine, mining. To develop dapps using python on the ethereum network? No.
user avatar
  • 875
3 votes
Accepted

Different Values for v, r, s? What am I doing wrong?

The values that you present for the result of the signature are not correct. I did this using the same transaction you show and the privatekey provided by you. When you sign the transaction using the ...
user avatar
  • 7,735
2 votes

(Python) eth_getFilterChanges --> data --> how to decode?

The JSONRPC returns the data field hex-encoded and the decode_abi function expects binary data, so you need to decoded the data field before calling decode_abi. import ethereum.abi logdata_hex = ...
user avatar
2 votes
Accepted

any detailed documents about ethjsonrpc

The current Ethereum JSON-RPC spec is at: https://github.com/ethereum/wiki/wiki/JSON-RPC Some parts of the spec may need to be defined more such as errors.
user avatar
  • 78k
2 votes
Accepted

Scraping ethereum blockchain in human readable format (csv)

If i'm not misstaken, this is stated in EIP 155: If block.number >= FORK_BLKNUM and v = CHAIN_ID * 2 + 35 or v = CHAIN_ID * 2 + 36, then when computing the hash of a transaction for purposes of ...
user avatar
  • 300
2 votes
Accepted

How to connect an Android App user to ethereum network?

Is the above architecture safe? (What happens if server is compromised of the server is biased) Provided the users keys are stored only locally on the users device, this is a pretty safe ...
user avatar
  • 300

Only top scored, non community-wiki answers of a minimum length are eligible