Diferent types of signatures on witness

I’m trying to insert a signature with a different format and I get an error without much detail:

forc = “0.56.0”
fuel-core = “0.26.0”

my code

Subscription structure:


Structure sent by witnesses (signature):

how the signature is read:

I will look into and get back to you soon :slight_smile:

1 Like

Hey @guimroque, this actually looks like a TS error given it’s being thrown at arrayify.ts. Would you mind also letting me know what version of fuels you are running?

I’ll run your code once I’ve got that version, but I also expect it’s throwing invalid data because your B512 signature will expect a string. So we’d expect something like const b512 = "0x1234....", same for all your hex values.

I’d reccomend checking out typegen and it’ll help you create type-safe inputs and outputs for your contracts.

1 Like

fuels version: 0.88.1

I’m sure I’m inserting it as a string… I’m passing the variable value as ${WEBAUTHN.signature},

Okay I was basing it off this screenshot you posted:

As these are not strings. Bare with me I’ll load up your repo.

Sorry, I updated to the latest code… check again


  • clone this repo, select branch feat/devnet-upgrade
  • run cd packages/sway
  • change your configurables files - set your node url
  • run pnpm install
  • run pnpm prebuild
  • run pnpm test
1 Like

If you need information about how the signature is generated, check:


Yeah it’s the string conversion. If I log out the value:

console.log('Check sig: ', `${WEBAUTHN.signature}`);
// Check sig:  Infinity

As we are storing signature as a number. So JS is attempting to convert a 512 bit number to a string, throwing and falling back to Infinity (:man_facepalming: ). Most JS can safely handle is 53 bit numbers or you have to use something like the BN wrapper. But in your case you want a signature, which we should store as a string. I got this working by editing your constants file and changing all your hex values to string rather than number.

export const WEBAUTHN = {
  tx_id: '0x96434c01712899770803277f193d2bb00bc8cff1799fe364ffe6b07404078fbe',
  address: '0x511f2e17ba75934fa428227a7e9d879d3be118a15a907122c530691c1203a40d',
1 Like

Ok, tanks for this…but have a new problem:

do you can check branch again?

run git pull

Hey @guimroque, I can see all tests are now passing, all good?


yes, all things working

thank you :slight_smile: