Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New address encoding #356

Merged
merged 7 commits into from
Oct 18, 2024
Merged

New address encoding #356

merged 7 commits into from
Oct 18, 2024

Conversation

louisinger
Copy link
Collaborator

@louisinger louisinger commented Oct 17, 2024

This PR adds the new ark address encoding, replacing bare user public key by vtxo taproot key. It implies change on the APIs and the SDK.

image

Address encoding

An ark address is network prefix + VTXO taproot pubkey + ASP pubkey encoded with bech32m.

ark1x0lm8hhr2wc6n6lyemtyh9rz8rg2ftpkfun46aca56kjg3ws0tsztfpuanaquxc6faedvjk3tax0575y6perapg3e95654pk8r4fjecs5fyd2
  • network prefix identifies testnet, mainnet, regtest...
  • VTXO taproot pubkey is the P2TR key that should be used as scriptpubkey in VTXO leaf output of the tree.
  • ASP pubkey allows verifying the ASP of the address

API & server changes

  • remove descriptor from RegisterOutputsForNextRound RPC, only ark address is expected.
  • expect descriptor to be revealed while spending VTXO = RegisterInputsForNextRound RPC.
  • [db] VTXO table: drop descriptor field, replace by pubkey field.

image

@altafan @tiero please review

@altafan
Copy link
Collaborator

altafan commented Oct 17, 2024

[db] VTXO table: drop descriptor field, replace by address field.

@louisinger let's replace the descriptor with the taproot pubkey instead of the address:

  • we don't want to "depend" on network as address contains a network prefix
  • we don't want to persist the same server pubkey for all records

@louisinger louisinger requested a review from altafan October 17, 2024 15:29
@ark-network ark-network deleted a comment from kentaurse Oct 18, 2024
@altafan altafan merged commit b536a9e into ark-network:master Oct 18, 2024
6 checks passed
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