-
Notifications
You must be signed in to change notification settings - Fork 23
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
Ark encoding #6
Ark encoding #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be better to include the Ark provider public key into Ark addresses ? most of the time, you don't want to receive VTXOs on every arks but only on a specific one
Just my 2 sats:
|
Why do we need to encode the relay on his own? Shouldn't just be part of the address? |
@tiero It's part of the ark url used to connect to an ASP, not the address you get from a receiver. Since nostr has a dedicated prefix for relays, I thought it was worth keeping this distinction. |
@bordalix for the PoC i would say no, but if you take a closer look at the fixtures, you can see the prefixes are actually
Nice catch, I moved to bech32m indeed. The btcutil's |
pkg/common/encoding.go
Outdated
|
||
return secp256k1.ParsePubKey(buf) | ||
func DecodeAddress(addr string) (*secp256k1.PublicKey, *secp256k1.PublicKey, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: what do u think of having a struct as return type instead of a tuple key, key, err
? Saying this because it's hard to discriminate user/asp key looking at the signature as it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a name to the return values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
No, the 1 in bc1 is the separator, not the version (bc1 = hrp + separator). The version comes after the separator, and bech32(0) = q and bech32m(1) = p address = hrp + separator + bech32x(version + ripe160(sha256(pubkey)) That's why all segwit addresses (version 0) start with "bc1q" and all taproot addresses (version 1) start with "bc1p" |
I propose to keep relays outside of the Ark address, and only the two pubkeys. Fine to have We can have it as part of a BIP21 address URI
together with other things BIP21 may specify |
@tiero ATM the address encodes only user and asp pubkeys, while relays are encoded in the ark URL. This is an example of valid address. Clients can verify that the asp pubkey encoded in a receiving address matches the one they have in their ark URL. Therefore, the pubkey of the asp is used as its identifier and shouldn't change. Does this make sense to you? |
Yes, not sure the
Not sure this is something desirable for the ASP ie. having user to "connect" to them, rather than just listening on the common channel for payment requests. |
In my mind it's not a "direct" connection.. rather, the ASP announces in the ark URL his identity, ie his public key, and the list of relays through which he communicates with the users. It feels overkilling to me carrying on this info in every receiving address generated by users (if that's what you mean when you speak about ark addresses). |
* Hotfix: Prevent ZMQ-based bitcoin wallet to panic (ark-network#383) * Hotfix bct embedded wallet w/ ZMQ * Fixes * Rename vtxo is_oor to is_pending (ark-network#385) * Rename vtxo is_oor > is_pending * Clean swaggers * Revert changes to client and sdk
* migrate descriptors --> tapscripts * fix covenantless * dynamic boarding exit delay * remove duplicates in tree and bitcointree * agnostic signatures validation * revert GetInfo change * renaming VtxoScript var * Agnostic script server (#6) * Hotfix: Prevent ZMQ-based bitcoin wallet to panic (#383) * Hotfix bct embedded wallet w/ ZMQ * Fixes * Rename vtxo is_oor to is_pending (#385) * Rename vtxo is_oor > is_pending * Clean swaggers * Revert changes to client and sdk * descriptor in oneof * support CHECKSIG_ADD in MultisigClosure * use right witness size in OOR tx fee estimation * Revert changes --------- Co-authored-by: Pietralberto Mazza <[email protected]>
* migrate descriptors --> tapscripts * fix covenantless * dynamic boarding exit delay * remove duplicates in tree and bitcointree * agnostic signatures validation * revert GetInfo change * renaming VtxoScript var * Agnostic script server (#6) * Hotfix: Prevent ZMQ-based bitcoin wallet to panic (#383) * Hotfix bct embedded wallet w/ ZMQ * Fixes * Rename vtxo is_oor to is_pending (#385) * Rename vtxo is_oor > is_pending * Clean swaggers * Revert changes to client and sdk * descriptor in oneof * support CHECKSIG_ADD in MultisigClosure * use right witness size in OOR tx fee estimation * Revert changes --------- Co-authored-by: Pietralberto Mazza <[email protected]>
* wasm e2e test * Remove ark-sdk.wasm.gz from repository * pr review * exclude test files from linting * fix * test fix * go work sync * gha fix * gha fix * wasm e2e test * kill webserver * Fix nonce encoding/decoding & Fix pop from queue of payment requests (#375) * bug fix - paymentMap pop input traversal * bug fix - nonce encode/decode * pr review * pr review * Fix trivy gh action (#381) * Update trivy gha * Update tryvy gha * Fix * merge * Panic recovery in app svc (#372) * panic recovery * pr review * Support connecting to bitcoind via ZMQ (#286) * add ZMQ env vars * consolidate config and app-config naming * [Server] Validate forfeit txs without re-building them (#382) * compute forfeit partial tx client-side first * fix conflict * go work sync * move verify sig in VerifyForfeits * move check after len(inputs) * Hotfix: Prevent ZMQ-based bitcoin wallet to panic (#383) * Hotfix bct embedded wallet w/ ZMQ * Fixes * Rename vtxo is_oor to is_pending (#385) * Rename vtxo is_oor > is_pending * Clean swaggers * Change representation of taproot trees & Internal fixes (#384) * migrate descriptors --> tapscripts * fix covenantless * dynamic boarding exit delay * remove duplicates in tree and bitcointree * agnostic signatures validation * revert GetInfo change * renaming VtxoScript var * Agnostic script server (#6) * Hotfix: Prevent ZMQ-based bitcoin wallet to panic (#383) * Hotfix bct embedded wallet w/ ZMQ * Fixes * Rename vtxo is_oor to is_pending (#385) * Rename vtxo is_oor > is_pending * Clean swaggers * Revert changes to client and sdk * descriptor in oneof * support CHECKSIG_ADD in MultisigClosure * use right witness size in OOR tx fee estimation * Revert changes --------- Co-authored-by: Pietralberto Mazza <[email protected]> * fix unit test * fix unit test * fix unit test --------- Co-authored-by: Pietralberto Mazza <[email protected]> Co-authored-by: Marco Argentieri <[email protected]> Co-authored-by: Louis Singer <[email protected]>
This fixes the existing method for secret/public key encoding and adds support for:
This also fixes the name of the submodule, called now
github.com/ark-network/ark/common
.This also adds a replacement in the main go.mod for the import of the submodule for future tasks.
Last but not least, this adds (few) tests for all the encoding methods.
Please @louisinger review.