Skip to content

Comments

multi: add bond verifier.#6

Open
dnldd wants to merge 2 commits intobisoncraft:masterfrom
dnldd:bond_verifier
Open

multi: add bond verifier.#6
dnldd wants to merge 2 commits intobisoncraft:masterfrom
dnldd:bond_verifier

Conversation

@dnldd
Copy link
Contributor

@dnldd dnldd commented Feb 5, 2026

This adds a bond verifier. Provided transactions are fetched via block explorers and verified. The bond verifier uses the prevailing price of the asset at the time of posting to the mesh network to determine the strength of the bond. The verifier has been integrated but still uses the verifier stub for the time being. BTC and DCR bond verification have been implemented.

Updated asset ID format to use CAIP-19 standard (chain_id/slip44:code). Changed
AssetBTC and AssetDCR from numeric uint32 to standardized strings:

  • BTC: bip122:000000000019d6689c085ae165831e93/slip44:0
  • DCR: bip122:298e5cc3d985bcc8d3d8ec0a6c0d5755eb8d8374eb5aa635d37c2ab26370498a/slip44:42

Refactored asset ID handling across fetcher, verifier, and handlers from uint32
to string. Bond IDs now include full CAIP-19 asset identifiers. Database parsing
correctly handles colons in bond IDs using SplitN. All tests updated with CAIP-19
formatted identifiers.

bond/verifier.go Outdated
)

// ParseFunc is a function that parses a bond transaction and returns bond parameters.
type ParseFunc func(ver uint16, rawTx []byte, price float64) (*BondParams, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since bond strength is USD-based now, the calcs should be handled by the caller. bond.BondParams is more suitable as a DB type. Let's have this function return BTC value, expiration time, and account ID.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by BTC value you mean asset value right? if so noted, if not elaborate. I'll get that done and start working on bond storage.

Extracted bond verification into dedicated package with asset parsers, verifier,
database, and fetcher. Transactions are fetched via block explorers and verified
using prevailing asset prices to determine bond strength. BTC and DCR verification
are implemented with pluggable asset parsers. Integrated into handlers with price
fetching per bond to calculate USD strength. Verifier stub still in use for now.
@dnldd dnldd marked this pull request as ready for review February 17, 2026 00:29
Updated asset ID format to use CAIP-19 standard (chain_id/slip44:code). Changed
AssetBTC and AssetDCR from numeric uint32 to standardized strings:
- BTC: bip122:000000000019d6689c085ae165831e93/slip44:0
- DCR: bip122:298e5cc3d985bcc8d3d8ec0a6c0d5755eb8d8374eb5aa635d37c2ab26370498a/slip44:42

Refactored asset ID handling across fetcher, verifier, and handlers from uint32
to string. Bond IDs now include full CAIP-19 asset identifiers. Database parsing
correctly handles colons in bond IDs using SplitN. All tests updated with CAIP-19
formatted identifiers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants