Skip to content

RFC: Remove dotNsIdentifier from default account access#245

Draft
valentinfernandez1 wants to merge 1 commit into
mainfrom
vf/rfc-dotNs-remove
Draft

RFC: Remove dotNsIdentifier from default account access#245
valentinfernandez1 wants to merge 1 commit into
mainfrom
vf/rfc-dotNs-remove

Conversation

@valentinfernandez1

Copy link
Copy Markdown
Collaborator

Summary

This is part 1 of a 2 part split of #243:

Today every account/signing/statement-store call takes a ProductAccountId { dotNsIdentifier, derivationIndex }. The dotNsIdentifier is redundant, the host already knows the calling product's domain and a dead input: pass any domain other than your own and the host just rejects it as invalid on signing related calls.

So it's removed from the request bodies. Callers pass only derivationIndex, and the host resolves the caller's own dotNS domain itself:

// Before
await truapi.account.getAccount({
  productAccountId: { dotNsIdentifier: "my-product.dot", derivationIndex: 0 },
});

// After
await truapi.account.getAccount({ derivationIndex: 0 });

Seven request bodies lose their ProductAccountId field in favor of a bare derivation_index: u32:

  • Account: getAccount, getAccountAlias, createAccountProof
  • Signing: createTransaction, signRaw, signPayload
  • Statement Store: createProof

ProductAccountId itself stays defined and exported, unused for now, so Part 2 can reuse it as the explicit external-account identifier.

Includes RFC-0022 with the full rationale.

Part 2 (follow-up): add the permissioned external-account access described in the issue, a new ExternalAccount permission plus explicit external methods that take a full target identifier.

Drop dotNsIdentifier from the seven local account, signing, and
statement-store request bodies, callers pass only derivationIndex and
the host resolves the caller's own domain.
@valentinfernandez1

Copy link
Copy Markdown
Collaborator Author

Keeping as draft for now as this is a big breaking change and we need to settle on the best versioning strategy for this

@valentunn

Copy link
Copy Markdown
Contributor

The dotNsIdentifier is present there intentionally: some products are interested in requesting accounts of other products

Hard NO from my side

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