Skip to content

Instantly share code, notes, and snippets.

Last active September 24, 2019 10:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Validating IOTA address
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at
# Complete description and story behind the snippet is available at:
# Requirement: PyOTA library (!pip install pyota)
import iota
import sys
from pprint import pprint
if len(InputAddr)!=90:
print("Incorrect lenght of the given address. Please, use an address including checksum.")
# address including checksum
Adr2 = iota.Address(InputAddr)
except :
print("Not valid input address given")
pprint("Input address incl checksum:")
print("Is it valid addr based on checksum? %s" % (Adr2.is_checksum_valid()))
print("\nInput address excl checksum:")
pprint(Adr2[:81]) # return only first 81 characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment