Преобразовать его в checksum адрес что значит
![]()
So in this session we will be discussing about checksum addresses and to convert any ethereum address to checksum address using web3 from nodejs.
To do that we need to have web3 Node module installed on our system.
We can do this by running the following code on the cmd
Then let's run our node server. Just run the following code on cmd.
Then we need web3 module in our server so run the following code
we will be needing a Blockchain network to create an account so get an rpc url from here
Just click on the link -> Login to your account ->Click on ethereum on left side bar -> create project -> settings -> keys -> endpoints
and choose your respective testnet rpc url
Then run this one
Our Ethereum address, as well as every other Ethereum address in existence, has two versions — one that includes uppercase letters and one that doesn’t. These are called the checksummed and non-checksummed version. Here’s an example of the same address as a:
- Non-checksummed version: 0x12ae66cdc592e10b60f9097a7b0d3c59fce29876
- Checksummed version: 0x12AE66CDc592e10B60f9097a7b0D3C59fce29876
Checksummed addresses contain both uppercase and lowercase letters whereas the non-checksummed addresses contain either uppercase letters or lowercase letters
To convert an upper or lowercase Ethereum address to a checksum address.
we can use the following utility function
This will return t he checksum version of the given address.
To check whether the given address is checksummed or not we can use this utility function
This will return false if the given address is non-checked address.
So that's all for today's session.
For test ethers and link tokens. Click Here
For many more exciting tutorials keep following my username @BlockTalks_Raj
Provided Address is invalid, the capitalization checksum test failed
I am trying to send a method on a contract using web3. I’m creating an account using the privateKeyToAccount method but when sending the method on the contract I get the following error:
Provided address [object Object] is invalid, the capitalization checksum test failed, or it’s an indirect IBAN address which can’t be converted.
Am I missing a step? I already created an instance of web3 and the contract interface works. I attached part of the code below. Thanks in advance for the help.
Checksum
A is a small piece of data that allows you check if another piece of data is the same as expected.
For example, in Bitcoin, addresses include checksums so they can be checked to see if they have been typed in correctly.
Try it!
How do they work?
In Bitcoin, checksums are created by hashing data through SHA256 twice, and then taking the first 4 bytes of the result:
This gives you a small, reliable, and fairly unique snippet of data. A bit like a fingerprint.
You would then keep the data and the checksum together, so that you can check that the whole thing has been typed in correctly the next time you use it.
If you make one small mistake (in any part), the data will no longer match the checksum.
So basically, a checksum is a handy little error-checking tool.
Where are checksums used in Bitcoin?
Checksums are included in:
These two keys are commonly transcribed (copied, pasted, typed, written down, etc.), so it’s useful for them to contain checksums.
The presence of a checksum enables software to validate these types of keys when they are typed in. The software won’t be able to tell you what the key should be, but at least it will be able to save you from sending money to the wrong address due to a typo.
Creating a checksum.
As mentioned, checksums in Bitcoin are created by hashing data through SHA256 twice and taking the first 4 bytes.
You could call a checksum in bitcoin a “truncated SHA256 hash”.
Example.
1 byte = 2 characters
Don’t forget to convert the data in to a byte sequence before performing sha256(sha256(data)) . In other words, you’re not hashing the string representation of the data but the bytes it represents.
This is how you might calculate a checksum in Ruby:
Checking a checksum.
You can verify a checksum by calculating the expected checksum for a piece of data, and comparing it with the one given.
Example: checking if an address is valid.
A common situation is checking that a given address is valid (all addresses come with a checksum inside).
To do this, you first of all need to decode the address from base58. Then you separate the data part from the checksum, and verify that the checksum you calculate from the data matches the one given.
A base58 decoded address contains: a prefix, the hash160 of something (e.g. public key hash), and a checksum. But all you really need to know here is that the checksum is the last 4 bytes.
This Ruby code uses the same checksum() function above.
As long as you can get to the data and the checksum, the verification part is pretty straightforward.
Why only the first 4 bytes?
It would be safer and more reliable to use the full hash result as a checksum. However, this would make addresses much longer, as the entire 32 byte hash would have to be included inside.
The taking of the first 4 bytes gives you enough “uniqueness” to be pretty sure the original data is correct, whilst also not making the final address inconveniently long. It’s just a balance between reliability and convenience really.
What are the chances you make a mistake, but still get the same checksum result?
The checksum is a random 4-byte hexadecimal number, so there is a 1 in 0xFFFFFFFF of that happening. In decimal, that’s 1 in 4,294,967,295.
Thanks
-
, for the quick computer science lesson on (and the history of) checksums.
Tools
By Greg Walker, 10 May 2017
- 10 Mar 2022: Updated WIF link.
- 09 Apr 2021: changed example to use hexadecimal data and not an ascii string
- 12 Nov 2020: checksum.md — ruby code for checking if an address is valid by verifying the checksum inside
- 21 Jul 2020: renamed /guide/ to /technical/

I’ll let you know about cool website updates, or if something seriously interesting happens in bitcoin.
Ethereum Address Checksum Explained — Checksummed vs non-Checksummed ETH Address

Ethereum addresses can be written in two ways — in a non-checksummed variety with all lower case letters and checksummed version that includes capital letters. Checksummed addresses are preferable to their non-checksummed counterparts since they ensure address validity and prevent potential typos. Ethereum addresses can be easily checksummed using any of the popular blockchain explorer services.
What is the ETH checksum function and why do capital letters matter in crypto addresses?
Ethereum address checksum validation is a cryptographic function that allows users to verify their blockchain addresses to ensure they are valid and don’t contain any typos. Your Ethereum address–as well as every other Ethereum address in existence–has two versions — one that includes uppercase letters and one that doesn’t. These are called the checksummed and non-checksummed versions.
Here’s an example of the same address as a:
- Ethereum Non-checksummed version:
0x12ae66cdc592e10b60f9097a7b0d3c59fce29876 - Ethereum Checksummed version:
0x12AE66CDc592e10B60f9097a7b0D3C59fce29876
This case sensitivity is used for checksum validation. The address is compared against the raw binary keccak-256 hash of the address bytes, and where there are letters in the same corresponding place as a “1” bit, the letter is capitalized.
In simpler terms, checksum validation is a way to tell if an address is valid and doesn’t contain any typos. While both addresses are viable and lead to the same destination, using the checksummed version is always preferable.
It might seem redundant to anyone who only copy-pastes addresses (which you should always do and never enter a hexadecimal address by hand), if even one character of an address is off, any tokens or coins sent to the wrong address will be lost forever.
This is not something to be taken lightly and soft errors in your RAM, the switch of a bit from a 0 to a 1, caused by occurrences like cosmic rays, do happen. Unbeknownst to you, the address stored in your clipboard could be different from the one you copied. Such unfortunate situations can easily be prevented with checksum.
How to perform checksum and prevent sending tokens to the wrong Ethereum address?
With the importance of Ethereum checksum addresses outlined in the paragraphs above, you are now probably wondering how to checksum your own Ethereum address. There are multiple services that convert non-checksummed Ethereum addresses to checksummed addresses, but we found the easiest way is to use etherscan.io:
1. Go to etherscan.io
Use your preferred internet browser to navigate to ethererscan.io. It is worth noting that you can use any of the other Ethereum blockchain explorer services–like Ethplorer and Etherchain, for instance–to checksum a blockchain address.
2. Insert your Ethereum address in the search field
Enter an Ethereum address you wish to convert to a checksum version in the search box located at the top of the webpage. As a side note, we’ve blurred out the last five digits of the Ethereum address used in the guide for privacy reasons.

3. You will be taken to an overview of the inputted address
After searching for the Ethereum address entered in the search field, you will be taken to an overview page showing various publicly available data–like current ETH balance, transaction history, and more–pertaining to the address you’ve searched for. In the upper left corner of the page, you can see the blockchain address (highlighted in red in the image below).

4. Your checksummed Ethereum address can be found at the top of the page
A checksummed version of the Ethereum address is listed on the address overview page. This can be verified by checking if it contains capital letters.

That’s it — you’ve successfully checksummed your Ethereum address and helped avoid losing funds by mistakenly sending coins to the incorrect address.
Why Ethereum doesn’t use checksummed blockchain addresses by default?
You might be asking yourself why don’t Ethereum addresses already come with checksum as standard, which is the case with Bitcoin wallet addresses?
Not too long ago, Ethereum addresses did not have any checksum at all, and it was only in 2016 that Ethereum co-founder and lead developer Vitalik Buterin implemented the function due to popular demand.
His reasoning as to why Ethereum addresses did not come with checksum implemented at the get-go is that users should never have to interact with the hexadecimal version of the addresses at all, as Ethereum is supposed to eventually transition to actual domain names like “BobsEtherAddress.eth” for Ethereum addresses and ICAP address versions, compatible with systems using the International Bank Account Number or IBAN conventions.
It is worth noting that in late 2021, the Ethereum Name Service, a decentralized name system built on Ethereum, started providing users the option to attach easy-to-remember domain names to their ETH addresses. ENS, which was initially developed by Ethereum Foundation programers Nick Johnson and Alex Van de Sande, is designed to work similarly to Domain Naming Service (DNS), which maps domain names (e.g. coincodex.com) to IP addresses. In principle similar to DNS, ENS allows users to use domain names (e.g. coincodex.eth) instead of a long string of numbers and letters when transferring ETH and ERC20 tokens.
Final thoughts
Due to the nature of cryptocurrencies, you are the sole owner of your address and your funds. There is no higher authority to appeal to in the event of a mistake. While some services can’t read checksum addresses, they will simply ignore the capital letters and process your address as normal, meaning there is no disadvantage to always using a checksummed address.
If you’re looking to learn about other interesting topics related to Ethereum, make sure to check out our article exploring the concept of the Ethereum triple halving and why it could make Ethereum a good investment over the long term.