Skip to content

JS and Golang implementation of the core steps to generate a valid DeBank API frontend signature

Notifications You must be signed in to change notification settings

null-routed/debank-hash-sign-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Debank Hash Signature V2

Overview

This repository provides both JavaScript and Golang implementations of the signature mechanism used in DeBank's frontend API. DeBank uses this signature mechanism to secure the API calls done via their frontend. After a full reverse engineering of the DeBank frontend JavaScript code, I've reduced the signature process to its core components, eliminating unnecessary overhead.

How It Works

The core steps to generate the signature are:

  1. Initial String Creation: A string is generated by concatenating "debank-api" with a randomly generated nonce and the current UNIX timestamp. Each element is separated by a newline character.

  2. Request String Formation: A string representing the API request is created by concatenating the request method, the URL path, and URL parameters (previously alphabetically sorted). Each element is, again, separated by a newline character.

  3. SHA-256 Hashing: Both the initial and request strings are SHA-256 hashed and are then hex encoded.

  4. HMAC Authentication: The request string is authenticated using an HMAC process with SHA-256, utilizing the first string as the key.

Donations

  • EVM (Ethereum Virtual Machine): 0x1DC95fBa8c8DFEAc33367CE0561652E032c19411
  • Solana: BkAdQ6HwKKEHtQYvQhxENwwm42HNN3zNaHiej2mJ8wtH

About

JS and Golang implementation of the core steps to generate a valid DeBank API frontend signature

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published