Scan your whole stack
From OX Research Newsroom
Are you using @ukeyfe/nfc-signing-sdk?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.5
@ukeyfe/nfc-signing-sdk was last scanned on 1 Dec 2026 at version 1.0.5. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.0.5 LATEST | 1 Dec 2026 | No rules fired |
| 1.0.4 | 26 Nov 2026 | No rules fired |
| 1.0.3 | 20 Nov 2026 | No rules fired |
| 1.0.2 | 26 Oct 2026 | Not shown |
| 1.0.1 | 22 Oct 2026 | Not shown |
Findings for v1.0.5. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.0.5; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
TypeScript SDK for integrating THD89 NFC smart cards into wallet applications. The package provides card session management, encrypted APDU communication, key derivation, hardware signing, mnemonic backup, and chain-specific transaction utilities.
Hardware operations use a pluggable transport. The included NFC adapter targets React Native; Node.js applications and other hosts can use the encoding utilities, mock transport, or a custom transport implementation.
npm install @ukeyfe/nfc-signing-sdk
Runtime dependencies are installed automatically. The published package contains CommonJS JavaScript and TypeScript declarations. Node.js consumers require Node.js 20.x from 20.19, or Node.js 22.12 and later (^20.19.0 || >=22.12.0), which can load the SDK's ESM cryptography dependencies from CommonJS.
For the built-in React Native NFC transport, install the NFC module and random-values polyfill:
npm install react-native-nfc-manager react-native-get-random-values
Load the random-values polyfill before importing the SDK in your application entry point:
import 'react-native-get-random-values';
Configure NFC permissions and native capabilities, then rebuild the application. Use a physical NFC-capable device with compatible THD89 firmware. Expo applications require a native development build; Expo Go does not include the NFC module. The demo guide describes the repository's native setup.
@react-native-async-storage/async-storage is optional. Install it if you want the SDK to use AsyncStorage for device credentials:
npm install @react-native-async-storage/async-storage
When available, the SDK selects it automatically; otherwise it falls back to in-memory storage. Applications can supply their own IStorageAdapter with NfcSigningSdk.setStorage(). Node.js consumers and applications using custom transports do not need the React Native packages above.
Native bundlers may resolve optional imports at build time. If you omit an optional integration in a Metro application, configure the bundler to allow optional dependencies as needed; npm's optional-peer metadata does not control Metro resolution.
NEO helpers that use neon-js require a separate optional dependency:
npm install @cityofzion/neon-js@^5.9.0
Metro may also require this package when resolving the SDK's root exports, even if your application does not call the NEO helpers.
The host prepares the transaction hash. The card derives the requested key and signs the hash inside a managed NFC session. This example requires an initialized card with wallet assets and its PIN; it does not initialize the wallet or broadcast a transaction.
import {
eip1559TxHash,
hexToBytes,
thd89DeriveKey,
thd89GetPubkey,
thd89Sign,
withTHD89Card,
} from '@ukeyfe/nfc-signing-sdk';
export async function signEvmTransactionHash(pin: string) {
// Replace these example values with the transaction approved by your user.
const { hash } = eip1559TxHash({
chainId: 1,
nonce: 0,
maxPriorityFeePerGas: 1_000_000_000n,
maxFeePerGas: 20_000_000_000n,
gasLimit: 21_000,
to: '0x0000000000000000000000000000000000000001',
value: 100_000_000_000_000_000n,
data: '0x',
});
return withTHD89Card(async (transceive, channel) => {
await thd89DeriveKey(transceive, channel, pin, '00', "m/44'/60'/0'/0/0");
const publicKey = await thd89GetPubkey(transceive, channel, pin, '00');
const signature = await thd89Sign(
transceive, channel, pin, '00', 0x00, hexToBytes(hash),
);
return { hash, publicKey, signature };
}, { alertMessage: 'Hold your card near the NFC reader.' });
}
withTHD89Card() connects, selects the card application, performs the configured application/channel setup, invokes the callback, and disconnects in a finally block. Keep related card operations inside the same callback.
thd89GetPubkey() and thd89Sign() return { hex, bytes }. For algorithm '00', the public key is 64 bytes (X || Y, without the 04 prefix), and the signature is 64 bytes (r || s). To assemble an EVM transaction, normalize the signature with toLowS(), determine the recovery ID with findRecoveryId() and the public key, then call buildEip1559SignedTx() or buildLegacySignedTx(). Broadcasting is a separate operation.
Mnemonic backup uses the Oscar 83 01 / 83 02 commands. It is separate from creating or importing the card's cold-wallet assets. A backup can contain 1–460 bytes and requires a 6–32 byte password.
import {
readMnemonicWithCard,
writeMnemonicWithCard,
} from '@ukeyfe/nfc-signing-sdk';
export async function storeMnemonic(pin: string, mnemonic: string | string[]) {
return writeMnemonicWithCard(pin, mnemonic, {
overwrite: false,
onProgress: (written, total) => {
console.log(`Backup progress: ${written}/${total} bytes`);
},
});
}
export async function restoreMnemonic(pin: string) {
return readMnemonicWithCard(pin);
}
The SDK normalizes whitespace, encodes UTF-8, and handles chunked transfer. No manual hexadecimal conversion is required. The write result contains cleanMnemonic, wordCount, bytesWritten, and overwritten.
Behavior to account for in your application:
overwrite defaults to true. Set it to false to reject an existing backup, as above, or provide onConfirmOverwrite to ask the user before replacement. No confirmation UI is displayed automatically.autoCreatePassword defaults to true: if an append operation reports 6F0D, the SDK attempts password creation using 83 A1 before retrying. createPasswordWithCard() also exposes password creation separately.writeHotWalletBackupWithCard() and readHotWalletBackupWithCard() handle raw backup data. Read results include bytes, hex, and, when decodable, text/mnemonic fields. These fields do not certify mnemonic validity.signTonCellHash() expects its callback to return the raw 64-byte Ed25519 signature. Use the bytes field returned by thd89Sign():
import {
signTonCellHash,
thd89DeriveKey,
thd89Sign,
TON_DERIVATION_PATH,
withTHD89Card,
} from '@ukeyfe/nfc-signing-sdk';
export async function signTonHash(pin: string, cellHash: Uint8Array) {
return withTHD89Card(async (transceive, channel) => {
await thd89DeriveKey(transceive, channel, pin, '01', TON_DERIVATION_PATH);
return signTonCellHash(async (hash) => {
const signature = await thd89Sign(transceive, channel, pin, '01', 0x00, hash);
return signature.bytes;
}, cellHash);
});
}
Pass a 32-byte cell representation hash. ed25519PubKeyToTonAddress() derives a Wallet V4R2 address; it is not a generic address constructor for every TON wallet contract.
For TRON, the signing callback passed to signTronHash() may return the { hex } result from thd89Sign() directly. Pass publicKey.hex as the third argument to signTronHash() so the helper can determine the recovery ID; without it, the helper defaults to zero.
| Area | Main exports | Scope |
|---|---|---|
| Card sessions | withTHD89Card, withOscarCard, NfcSigningSdk |
Connection lifecycle and secure-channel setup |
| Transport | ITransport, ReactNativeNfcTransport, MockTransport |
Native NFC, custom host integration, and offline tests |
| Device management | thd89GetDeviceInfo, thd89GetSerialNumber, parseDeviceFormFactor, parseUkeySerialNumber |
Device metadata and UKEY Base34 serial classification |
| Wallet management | thd89InitUser, thd89ChangePin, thd89ImportBackup |
Firmware-specific wallet and credential operations |
| Signing | thd89DeriveKey, thd89GetPubkey, thd89Sign |
Hardware key derivation, public keys, and signatures |
| Backup | writeMnemonicWithCard, readMnemonicWithCard, createPasswordWithCard |
Mnemonic backup and password initialization |
| Storage | IStorageAdapter, MemoryStorageAdapter, setStorageAdapter |
Device credential storage |
| Firmware | thd89DfuParseFirmware, thd89DfuSessionStep |
Firmware package selection and resumable transfer steps |
NfcSigningSdk is a static facade, also exported as the default export. Individual functions and types are available as named exports. Use the bundled TypeScript declarations for complete signatures.
| Chain / family | Included utilities |
|---|---|
| EVM | Legacy and EIP-1559 encoding, ERC-20 call data, EIP-191/EIP-712 hashing, RPC helpers |
| TRON | Address conversion, TRC-20 call data, signature formatting, transaction creation and broadcast helpers |
| TON | Wallet V4R2 addresses, cell/BOC serialization, transfer payloads and broadcast helpers |
| Solana | Base58 encoding, native SystemProgram transfer messages and transaction serialization |
| Bitcoin | Legacy, SegWit and Taproot addresses; SegWit/Taproot sighashes, transaction serialization and network helpers |
| Kaspa | Address encoding, Blake2b signing hashes and transaction helpers |
| CryptoNote | Key/address derivation, stealth-address and ring-signature primitives |
| NEO N3 | Local-key address and GAS transfer helpers via optional neon-js |
These utilities have different levels of coverage. Local-key helpers operate on the host; they do not route signing through the card automatically. Applications must supply the correct derivation scheme, algorithm, signing mode, network parameters, and payload for their device firmware and chain.
Use NfcSigningSdk.setTransport(transport) to set a default ITransport, or pass { transport } / { transceive } to a card session. A custom transceive receives an APDU byte array and returns the response bytes, including the status word. When only transceive is supplied, the caller manages the underlying connection.
MockTransport provides predefined APDU responses with mapApdu() and programmable responses with setHandler(). It does not emulate an initialized card or its cryptography automatically. A browser NFC transport is not included.
Storage adapters implement asynchronous getItem, setItem, and removeItem. Also implement the optional getAllKeys() method to let channel setup discover and reuse saved device bindings. Device credentials can include passwords; select an adapter appropriate for the host application's storage requirements. The in-memory adapter does not persist across restarts.
Card command failures use THD89Error, with a message and an optional numeric sw status word. Transport failures use TransportError or its subclasses. isUserCancelError(error) identifies canceled NFC sessions. Match error types and status words instead of localized message text.
Firmware helpers expose transfer and resume operations; the application remains responsible for obtaining a compatible firmware image, reconnecting between NFC sessions, and retaining resume state. thd89DfuSessionStep() uses a configurable session budget; it does not establish or renew an NFC session itself. See the demo's bootloader screen for orchestration.
See the repository guide for build and test instructions.
Licensed under the ISC License. You may use, copy, modify, and redistribute this SDK free of charge, including for commercial purposes, provided that the copyright and permission notices are retained. See the license for the full terms.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.