Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
14 votes
Accepted

Generate private key and address using web3j

Below is my approach, verified by importing the result privatekey into MetaMask and get the same address as expected. private static JSONObject process(String seed){ JSONObject processJson ...
pyang's user avatar
  • 381
9 votes

How to experiment with Ethereum without downloading the entire blockchain?

Creating a local in-memory blockchain (Ganache) with Brownie is recommended way for development. Besides Browser Solidity (as @Rob Hitchens recommended), you could also develop smart contracts using ...
alper's user avatar
  • 8,395
8 votes
Accepted

Convert String to Bytes32 in web3j?

SOLVED!!! LONG/Detailed METHOD!!! (Shorter Version at bottom) The main problem was Bytes32(byte[]) only supports 32 length byte[]. Also keep in mind Numeric.hexStringToByteArray(strValueInHex) ...
wannamit's user avatar
  • 151
7 votes
Accepted

How to change the nonce between transactions in web3j?

Under the hood, the Web3J SmartContract Java Wrapper calculates the nonce by getting the number of transactions getTransactionCount for the account (credential). EthGetTransactionCount ...
Greg Jeanmart's user avatar
6 votes

Can I write and deploy smart contracts in Java language?

Currently, Smart Contracts can be written in three languages: Solidity - Similar to JavaScript Serpent - Python derivative LLL(Lisp Like Language) - Similar to Assembly You can find more information ...
galahad's user avatar
  • 3,920
6 votes

Can I write and deploy smart contracts in Java language?

No, the only currently supported languages for contract development are lll (dead), serpent and solidity with the later being most used.
Sebi's user avatar
  • 5,284
6 votes
Accepted

Does EthereumJ (Java implementation of Ethereum) support JSON RPC API?

Currently EthereumJ has no JSON-RPC support, however we are planning to implement this in a nearest future as a separate project which also will include Web3 JS console
Anton Nashatyrev's user avatar
6 votes

Can I write and deploy smart contracts in Java language?

To start you can use web3j. It is Java library that allow the iteration of java application with contracts in the Ethereum network. It doesn't provide the capability to write contracts in java, but ...
vaquar khan's user avatar
6 votes
Accepted

How could I send transactions continuously by Web3j generated wrapper

I found the solution, please refer, #296 Use FastRawTransactionManager to speed up your transactions. Use RawTransactionManager to shorten the polling interval. If you need both, use the following ...
Kimi Wu's user avatar
  • 243
5 votes
Accepted

Solidity ecrecover and web3j Sign.signMessage() are not compatible, is it?

The problem was actually double hashing. Looking at the Web3j's signMessage() method Sign.SignatureData sig =Sign.signMessage(messageBytes, ecKeyPair); and signedMessageToKey() method String pubKey ...
earthouser's user avatar
5 votes

How to experiment with Ethereum without downloading the entire blockchain?

You can connect to a remote ethereum node such as INFURA, using the JSON RPC API, so you won't need to worry about maintaining and synchronizing a local node. You can see this guide about using ...
Herman Junge's user avatar
  • 2,381
5 votes

Can I write and deploy smart contracts in Java language?

The ICON blockchain will support java smart contracts in ICON 2.0 due to be released August 2021 and currently running on a testnet. You can also checkout code examples -> https://github.com/icon-...
robcxyz's user avatar
  • 51
5 votes
Accepted

How can I get the TxReceipt of a transaction with web3j?

There's the Transactions page in the Web3j docs that mentions transaction receipts a few times, and I browsed through some of the autocompletes in IntelliJ. It looks like you can do the following, ...
Rosco Kalis's user avatar
  • 2,137
5 votes
Accepted

How to apply EthFilter to specific address?

OK, let's say you have a smart contract deployed on the address CONTRACT_ADDRESS which can trigger different type of events Event definitions: event GameStarted(bytes32 indexed gameId, address ...
Greg Jeanmart's user avatar
5 votes
Accepted

Offline transaction signing with web3j?

I think something like this should work // Create the Transaction RawTransaction rawTransaction = RawTransaction.createEtherTransaction(<nonce>, <gasPrice>, <gasLimit>, <...
Majd TL's user avatar
  • 3,237
4 votes

Can I write and deploy smart contracts in Java language?

It's not out yet but you might be interested in Corda, which is being developed by Mike Hearn and his team on behalf of the R3 consortium. This targets Java developers, and doesn't use a blockchain, ...
Edmund Edgar's user avatar
  • 16.9k
4 votes

Can I write and deploy smart contracts in Java language?

You can not write contracts in Java, but deploying should work with the Ethereum Contract API native in Java. The goal is to ease the integration of Ethereum in a Java project. Easy ...
q9f's user avatar
  • 32.9k
4 votes

Does EthereumJ (Java implementation of Ethereum) support JSON RPC API?

02/04/2016 I had a better look and no, there is no JSON-RPC API service. 07/04/2016 - The new changes to be merged that was referred to by @Oscar Guindzberg at https://github.com/ethereum/ethereumj/...
BokkyPooBah's user avatar
  • 40.3k
4 votes

How to experiment with Ethereum without downloading the entire blockchain?

You can work with Browser Solidity. It let's you experiment with Smart Contracts, compile them, run them and debug them using an in-memory execution environment (default), or the real thing. https://...
Rob Hitchens's user avatar
  • 55.3k
4 votes
Accepted

Using Web3j to load a smart contract, how do i specify my credentials?

To generate the Credentials if you have a plain public key and private key, you need to convert them in to the hex representation and then pass them in to the constructor for Credentials String ...
zaf187's user avatar
  • 151
4 votes

How fetch transaction history for account quickly using Web3j?

There is no workaround besides of the links you´ve posted. It will depend of your CPU power, network and database. I believe they (etherscan team) gets data from the blockchain and stores in an ...
Luiz Soares's user avatar
  • 1,054
4 votes

How estimate GAS from a contract call with Web3j

You need to encode the data by using FunctionEncoder.encode Before checking the result you need to check for errors. If an error (for example a contract error) is returned the result will be null and ...
mio's user avatar
  • 141
3 votes
Accepted

is there a java library to access or respond to an ethereum contract events?

For java there is web3j on github and its page https://web3j.io/.
Ismael's user avatar
  • 30.5k
3 votes
Accepted

Web3j: "Intrinsic gas too low" error when deploying contract in Ethereum from Java

I figured out what was wrong. My GAS_PRICE and GAS_LIMIT values were not proper. I later figured out that Web3j has default GAS_PRICE and GAS_LIMIT, see updated code below BigInteger GAS = ...
Adheep's user avatar
  • 271
3 votes

Does EthereumJ (Java implementation of Ethereum) support JSON RPC API?

There is a non-merged pull request you can try https://github.com/ethereum/ethereumj/pull/352
Oscar Guindzberg's user avatar
3 votes

Can I write and deploy smart contracts in Java language?

Yes. Jthereum supports writing contracts for the Ethereum blockchain in Java. It is a commercial product targeted at enterprise use. https://Jthereum.com The product is currently in beta testing, but ...
Shebla Tsama's user avatar
3 votes
Accepted

How to decode input data with ABI using java?

Ok! I solved it. First i created my own Contract, which is extend Contract from org.web3j.tx. Overrided two methods (i need to receive multiple values from contract): ...
Ilya Khudyakov's user avatar
3 votes
Accepted

Decoding transaction input data with web3j (Java)

I guess sort of for the first question. If you look at what a transaction is, to a node its just a big long byte string. If the bytes are convertible to ASCII, you can use use the web3.toAscii() ...
thefett's user avatar
  • 3,888
3 votes

Web3j generate new address in a wallet

You don't have to save wallet to file. You can extract the low-level code yourself. Check my answer here Generate private key and address using web3j
pyang's user avatar
  • 381
3 votes

How to make transaction using private key and address using web3j

Web3j web3j = Web3j.build(new HttpService("")); Credentials credentials = Credentials.create("privateKey"); BigInteger nonce = web3j.ethGetTransactionCount(credentials....
Sanjay Rao's user avatar

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