Bitcoin Forum
September 29, 2024, 05:49:29 PM
Welcome,
Guest
. Please
login
or
register
.
News
: Latest Bitcoin Core release:
27.1
[
Torrent
]
Home
Help
Search
Login
Register
More
Bitcoin Forum
>
Bitcoin
>
Development & Technical Discussion
>
check sum a base58 private key
Pages: [
1
]
« previous topic
next topic »
Print
Author
Topic: check sum a base58 private key (Read 141 times)
dude1234321
(OP)
Newbie
Offline
Activity: 23
Merit: 2
check sum a base58 private key
December 28, 2021, 12:32:17 PM
#1
hi,
i want some code, preferably .net (c# or vb.net) to check sum base 58 (51 character) private keys to see if they are valid or not.
can anyone point me in the right direction?
thank you
PawGo
Legendary
Offline
Activity: 952
Merit: 1385
Re: check sum a base58 private key
December 28, 2021, 12:39:59 PM
#2
Take a look here:
https://learnmeabitcoin.com/technical/wif
Checksum is in fact double sha256. You will have to decode your private key, remove last 4 bytes (8 decoded characters), calculate double hash and compare first 4 bytes (8 characters) of result with checksum received after decoding WIF.
Maybe this is what you look for:
https://gist.github.com/CodesInChaos/3175971#file-base58encoding-cs
dude1234321
(OP)
Newbie
Offline
Activity: 23
Merit: 2
Re: check sum a base58 private key
December 28, 2021, 12:45:16 PM
#3
thank you for the information.
is there no library out there ? all i want to do is run some code that does
print IsValidKey("testkey")
i.e. prints true or false
there must be some library out there already that does that?
NeuroticFish
Legendary
Offline
Activity: 3808
Merit: 6523
Looking for campaign manager? Contact icopress!
Re: check sum a base58 private key
December 28, 2021, 12:46:47 PM
#4
Although it tells it's not optimized, you may find useful parts for your needs here:
https://gist.github.com/CodesInChaos/3175971
Another one I've found is
https://github.com/adamcaudill/Base58Check
and you can get it as NuGet package.
Both are not my code, I've just found them on the internet.
▄
███████████████████████
▄
████
▐██▄
█████████████████
████
▐████
██
▄▄▄
███████████
████
▐████▄█████▄▄
████████
████
▐█████▀▀▀▀▀███▄
██████
████
▐███▀
███████
████
█████
████
▐███
██
██
██
▄█████▌
████
████
▐██▌
█████
▀██████▌
████
████
▐███
███████
▀████▌
████
█████
▀███▄
█████
▄███▀
█████
███████
▀█████████▀
███████
██████████
▀███▀
██████████
▀
███████████████████████
▀
.
BC.GAME
│
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐
▌
░▀▄▀▀▀▀▀▄▀░
▐
▌█▄▀▄
▄▀░▀░░█░
▄███████▄
░█░░▀░▀▄
█░█░▀░█
███████████
█░▀░█░█
█░██░▀█
█
▀▀█▄
█
▄█▀▀
█
█▀░██░█
█░█▀██░█
▀▀█
█
█
█
█▀▀
█░██▀█░█
▀▄▀██░░░▀▀▄▌
█
▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
█
█
█
██
██
██▄▄▄▄▄▄▄██
██
██
█
█
█
.
..
CASINO
.
.
..
SPORTS
..
.
.
RACING
..
▄▄████▄▄
▄███▀▀███▄
███
████
███
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███
████
▄▄▀▀████▄▄▀▀
████
███
▀███▄▄███▀
░░░
▀▀████▄▄▄███▀
▀▀████▀▀
████████
▀▀████▀▀
│
200%
ON SPORTS BET
Code:
BCLCFC
PawGo
Legendary
Offline
Activity: 952
Merit: 1385
Re: check sum a base58 private key
December 28, 2021, 12:48:07 PM
#5
Please check carefully the code I sent you. There is method DecodeWithChecksum, which returns correctly decoded private key or throws exception if checksum is invalid, just like you want.
dude1234321
(OP)
Newbie
Offline
Activity: 23
Merit: 2
Re: check sum a base58 private key
December 28, 2021, 12:52:00 PM
#6
Quote from: PawGo on December 28, 2021, 12:48:07 PM
Please check carefully the code I sent you. There is method DecodeWithChecksum, which returns correctly decoded private key or throws exception if checksum is invalid, just like you want.
oh yes just saw that, will try it out, thank you
BlackHatCoiner
Legendary
Offline
Activity: 1652
Merit: 8158
Bitcoin is a royal fork
Re: check sum a base58 private key
December 28, 2021, 12:53:30 PM
Merited
by
ABCbits
(1)
#7
Since you want it to be .NET, check
Autarkysoft.Bitcoin/Encoders/Base58.cs
of Coding Enthusiast. The boolean you're searching is
IsValid(string encoded)
. Check his stuff, he has done some pretty good work.
▄▄
███████████████████
▄▄
▄
██
▀▀
███
▄
█████
▀▀
█████
▄
██
▄
██
▀
████
██████
███████
█████
██
████
██████
███████
████
██
██
███
█
█████
███████
██
█████
██
██
██████
███████
████████
██
█
██████
███████
██████
█
██
████████
███████
██████
██
██
███████
███████
██████
███
██
██████
███████
██████
████
██
█████
███████
██████
████
▄
██
▀
██
▀
█████
▄▄
█████
▀
███
▄▄
██
▀
▀▀
███████████████████
▀▀
GODEX
.IO
│
A
n
o
n
y
m
o
u
s
Crypto Exchanger
██
██
██
██
██
██
██
██
██
██
██
██
██
SIGN−UP FREE
LIMITLESS
TRUSTWORTHY
██
██
██
██
██
██
██
██
██
██
██
██
██
BTC
XMR
ETH
TON
800+
coins
██
██
██
██
██
██
██
██
██
██
██
██
██
Pages: [
1
]
Print
Bitcoin Forum
>
Bitcoin
>
Development & Technical Discussion
>
check sum a base58 private key
« previous topic
next topic »
Jump to:
Please select a destination:
-----------------------------
Bitcoin
-----------------------------
=> Bitcoin Discussion
===> Legal
===> Press
===> Meetups
===> Important Announcements
=> Development & Technical Discussion
===> Wallet software
=====> Electrum
=====> Bitcoin Wallet for Android
=====> BitcoinJ
=====> Armory
=====> Mycelium
=====> Hardware wallets
=> Mining
===> Mining support
===> Pools
===> Mining software (miners)
===> Hardware
=====> Group buys
===> Mining speculation
=> Bitcoin Technical Support
=> Project Development
-----------------------------
Economy
-----------------------------
=> Economics
===> Speculation
=> Marketplace
===> Goods
=====> Computer hardware
=====> Digital goods
=======> Invites & Accounts
=====> Collectibles
===> Services
===> Currency exchange
===> Gambling
=====> Games and rounds
=====> Investor-based games
=====> Gambling discussion
===> Lending
=====> Long-term offers
===> Securities
===> Auctions
===> Service Announcements
=====> Micro Earnings
===> Service Discussion
=====> Web Wallets
=====> Exchanges
=> Trading Discussion
===> Scam Accusations
===> Reputation
-----------------------------
Other
-----------------------------
=> Meta
===> New forum software
===> Bitcoin Wiki
=> Politics & Society
=> Beginners & Help
=> Off-topic
=> Serious discussion
===> Ivory Tower
=> Archival
===> Корзина
===> CPU/GPU Bitcoin mining hardware
===> Chinese students
===> Obsolete (buying)
===> Obsolete (selling)
===> MultiBit
-----------------------------
Alternate cryptocurrencies
-----------------------------
=> Altcoin Discussion
=> Announcements (Altcoins)
===> Tokens (Altcoins)
=> Mining (Altcoins)
===> Pools (Altcoins)
=> Marketplace (Altcoins)
===> Service Announcements (Altcoins)
===> Service Discussion (Altcoins)
===> Bounties (Altcoins)
=> Speculation (Altcoins)
-----------------------------
Local
-----------------------------
=> العربية (Arabic)
===> العملات البديلة (Altcoins)
=====> النقاشات
===> إستفسارات و أسئلة المبتدئين
===> التعدين
===> النقاشات الأخرى
===> منصات التبادل
=> Bahasa Indonesia (Indonesian)
===> Marketplace (Bahasa Indonesia)
===> Mining (Bahasa Indonesia)
===> Altcoins (Bahasa Indonesia)
===> Trading dan Spekulasi
===> Ekonomi, Politik, dan Budaya
===> Topik Lainnya
=> Español (Spanish)
===> Mercado y Economía
=====> Servicios
=====> Trading y especulación
===> Hardware y Minería
===> Esquina Libre
===> Mercadillo
=====> Mexico
=====> Argentina
=====> España
=====> Centroamerica y Caribe
===> Primeros pasos y ayuda
===> Altcoins (criptomonedas alternativas)
=====> Minería de altcoins
=====> Servicios
=====> Tokens (Español)
=> 中文 (Chinese)
===> 跳蚤市场
===> 山寨币
===> 媒体
===> 挖矿
===> 离题万里
=> Hrvatski (Croatian)
===> Trgovina
===> Altcoins (Hrvatski)
=====> Announcements (Hrvatski)
===> Off-topic (Hrvatski)
=> Deutsch (German)
===> Anfänger und Hilfe
===> Mining (Deutsch)
===> Trading und Spekulation
===> Projektentwicklung
===> Off-Topic (Deutsch)
===> Treffen
===> Presse
===> Altcoins (Deutsch)
=====> Announcements (Deutsch)
===> Marktplatz
=====> Auktionen
=====> Suche
=====> Biete
=> Ελληνικά (Greek)
===> Αγορά
===> Mining Discussion (Ελληνικά)
===> Altcoins (Ελληνικά)
=====> Altcoin Announcements (Ελληνικά)
=====> Altcoin Mining (Ελληνικά)
=> עברית (Hebrew)
=> Français
===> Actualité et News
===> Débutants
===> Discussions générales et utilisation du Bitcoin
===> Mining et Hardware
===> Économie et spéculation
===> Place de marché
=====> Échanges
=====> Produits et services
=====> Petites annonces
===> Le Bitcoin et la loi
===> Wiki, documentation et traduction
===> Développement et technique
===> Vos sites et projets
===> Hors-sujet
===> Altcoins (Français)
=====> Annonces
=> India
===> Mining (India)
===> Marketplace (India)
===> Regional Languages (India)
===> Press & News from India
===> Alt Coins (India)
===> Buyer/ Seller Reputations (India)
===> Off-Topic (India)
=> Italiano (Italian)
===> Guide (Italiano)
===> Progetti
===> Discussioni avanzate e sviluppo
===> Trading, analisi e speculazione
===> Mercato
=====> Mercato valute
=====> Beni
=====> Servizi
=====> Esercizi commerciali
=====> Hardware/Mining (Italiano)
=====> Gambling (Italiano)
===> Accuse scam/truffe
===> Mining (Italiano)
===> Alt-Currencies (Italiano)
=====> Annunci
===> Raduni/Meeting (Italiano)
===> Crittografia e decentralizzazione
===> Off-Topic (Italiano)
=> 日本語 (Japanese)
===> アルトコイン
=> Nederlands (Dutch)
===> Markt
===> Gokken/lotterijen
===> Mining (Nederlands)
===> Beurzen
===> Alt Coins (Nederlands)
===> Off-topic (Nederlands)
===> Meetings (Nederlands)
=> Nigeria (Naija)
===> Politics and society (Naija)
===> Off-topic (Naija)
=> 한국어 (Korean)
===> 대체코인 Alt Coins (한국어)
=> Pilipinas
===> Altcoins (Pilipinas)
=====> Altcoin Announcements (Pilipinas)
===> Pamilihan
===> Others (Pilipinas)
=> Polski
===> Tablica ogłoszeń
===> Alternatywne kryptowaluty
=====> Nowe kryptowaluty i tokeny
=====> Tablica ogłoszeń (altcoiny)
=> Português (Portuguese)
===> Primeiros Passos (Iniciantes)
===> Economia & Mercado
===> Mineração em Geral
===> Desenvolvimento & Discussões Técnicas
===> Criptomoedas Alternativas
===> Brasil
===> Portugal
=> Русский (Russian)
===> Новички
===> Бизнес
=====> Барахолка
=====> Обменники
===> Идеи
===> Кодеры
===> Майнеры
===> Политика
===> Трейдеры
===> Альтернативные криптовалюты
=====> Токены
=====> Бayнти и aиpдpoпы
===> Хайпы
===> Работа
===> Разное
===> Oбcyждeниe Bitcoin
=====> Новости
=====> Юристы
=> Română (Romanian)
===> Anunturi importante
===> Offtopic
===> Market
=====> Discutii Servicii
===> Minerit
===> Tutoriale
===> Bine ai venit!
===> Presa
===> Altcoins (Monede Alternative)
=====> Anunturi Monede Alternative
=> Skandinavisk
=> Türkçe (Turkish)
===> Bitcoin Haberleri
===> Pazar Alanı
===> Madencilik
===> Ekonomi
===> Servisler
=====> Fonlar
===> Proje Geliştirme
===> Alternatif Kripto-Paralar
=====> Madencilik (Alternatif Kripto-Paralar)
=====> Duyurular (Alternatif Kripto-Paralar)
===> Konu Dışı
===> Yeni Başlayanlar & Yardım
===> Buluşmalar
=> Other languages/locations
Loading...