feat(host,signer): wrap account.signVrf in the accounts surface - #292
Merged
Conversation
📦 Bundle size impactComparing
Thresholds — warn: ≥10% or ≥5.0 KB · fail: ≥20% or ≥15.0 KB (bundled). Percentage only applies once the baseline is ≥ 10 KB. |
TarikGul
approved these changes
Aug 11, 2026
TarikGul
left a comment
Member
There was a problem hiding this comment.
Looks good - lets get the e2e test fixed.
Collaborator
Author
Thanks! On the e2e failures, I looked into these and I also run locally and they are not coming from this PR. I will dig more in the e2e failures and I will open a separate PR for this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #288
Part of #286
Description
Adds
signVrfto the accounts surface so products can produce an sr25519 VRF signatureover a Merlin transcript without going through the raw truAPI client.
Changes
packages/host/src/accounts.tssignVrfonAccountsProviderand its adapter, plus theVrfTranscriptItem,VrfSignatureandProductAccountLookuptypesUint8Array; the adapter handles hex encoding and the tagged derivation indexpackages/host/src/index.tspackages/host/src/testing.tspackages/signer/src/providers/host.tsHostProvider.signVrf, the internal provider interface, and type re-exports from hostpackages/signer/src/signer-manager.tsSignerManager.signVrfpackages/signer/src/index.tspending-changesets/accounts-sign-vrf.mdTwo earlier commits also route
getProductAccountandgetProductAccountSignerthroughone account-reference type, so the tagged derivation index is built in a single place.
Why these changes
The hosts have implemented
account.signVrffor a while, but no SDK accessor exposed it.Products that needed it had to call
getTruApi()directly and hand roll hex encoding,account addressing and error handling. That also pins the product to the truAPI wire
format, which the SDK is supposed to absorb.
The concrete consumer is the airdrop lottery ticket on the People chain, which cannot be
produced in hosted mode today.
Breaking change
AccountsProvideris an exported interface andsignVrfis a required member, soanything that implements it, including hand written test doubles, must add the method.
Code that only calls the provider is unaffected. The fake in
@parity/product-sdk-host/testingalready implements it.Testing
Unit test results:
@parity/product-sdk-host@parity/product-sdk-signerAll other packages are unchanged and green.
pnpm typecheckandpnpm checkare clean.