stawi_finance_sdk 0.4.0 copy "stawi_finance_sdk: ^0.4.0" to clipboard
stawi_finance_sdk: ^0.4.0 copied to clipboard

Stawi client SDK: canonical FinancialIntent encoding, intent digests, account derivation, policy hashes, manifest verification, exact money arithmetic and device signing. Pure Dart; no Flutter, no transport.

stawi_finance_sdk #

Pure-Dart client SDK for Stawi: canonical FinancialIntent encoding and digests, account derivation, policy hashes, protocol manifest verification, exact money arithmetic and device signing. No Flutter and no transport; pair it with stawi_api for the Connect clients.

Signing a prepared settlement call #

import 'package:stawi_finance_sdk/stawi_finance_sdk.dart';

// Once per device; persist key.privateKey in secure storage.
final key = DeviceKey.generate(); // Random.secure(), rejects 0 and >= n
print(bytesToHex0x(key.address)); // keccak256(X ‖ Y)[12:]

// PrepareRoomCallResponse.digest or PrepareAccountCallResponse.intent_digest:
final signature = signPreparedCall(preparedDigest, key.privateKey);
// 65 bytes r ‖ s ‖ v, v in {27, 28}: DeviceSignature.signature
// (algorithm "secp256k1") for SubmitRoomCall, or SubmitAccountCall.authorization.

accountWrappedHash(account, chainId, hash) is StawiAccount's ERC-1271 wrapping, for checking a prepared digest against the call's typed hash.

Every primitive is checked against vectors produced by the Go implementation (test/vectors/).

0
likes
0
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

Stawi client SDK: canonical FinancialIntent encoding, intent digests, account derivation, policy hashes, manifest verification, exact money arithmetic and device signing. Pure Dart; no Flutter, no transport.

Homepage
Repository (GitHub)
View/report issues

Topics

#cryptography #ethereum #fintech

License

unknown (license)

Dependencies

cryptography, pointycastle

More

Packages that depend on stawi_finance_sdk