Skip to content

refactor(anonbeta1): registry-only baseline; archive Arcium bind for v2#2

Closed
FwazB wants to merge 3 commits into
mainfrom
fawaz-test
Closed

refactor(anonbeta1): registry-only baseline; archive Arcium bind for v2#2
FwazB wants to merge 3 commits into
mainfrom
fawaz-test

Conversation

@FwazB
Copy link
Copy Markdown
Collaborator

@FwazB FwazB commented May 11, 2026

Summary

Resets anonbeta1 to the minimal Frontier/devnet registry baseline and archives the earlier Arcium beacon binding work for later revival.

What stays live:

  • register_beacon: writes the BeaconRegistry PDA with operator, RNS destination hash, region code, and timestamp metadata
  • heartbeat: updates last_heartbeat and heartbeat_count
  • BeaconRegistered and BeaconHeartbeat events
  • Plain Anchor program surface with anchor-lang only
  • Program ID remains anon7uu8UtVoFgS8GCSfw2RqyphJhkN3xEjgPwznYDe

What is removed from the live program:

  • Arcium beacon_bind registration path
  • Private beacon registry account
  • Registration fees and treasury transfer logic
  • Arcium-specific errors/constants from anonbeta1

What is preserved for v2:

  • Archived beacon bind instructions, state, events, constants, and circuit snapshots under archive/anonbeta1-arcium-bind/
  • Revival notes in the archive README
  • Existing ble-revshare and encrypted-ixs material for later payment/revshare work

Handoff Notes

Do not merge as part of this handoff unless the team explicitly wants the minimal registry-only baseline on main.

PR #3 is stacked on top of this work and adds the v2.A private relay counter. If the team accepts the private counter direction, review/merge PR #3 instead of merging this PR separately.

M4gic's review note is incorporated directionally: beacon registration fees are removed here. Follow-up design questions remain around replacing heartbeat with a last-cosign timestamp and exposing operator stats without leaking private relay counts.

- beacon_bind circuit: SHA3-256 commitment of rns_dest_hash + region_code
  computed inside Arcium MPC, returns encrypted u128 to owner
- anonbeta1 program: register_beacon, heartbeat (plain), plus 3 new
  Arcium instructions (init_comp_def, register_beacon_private, callback)
- PrivateBeaconRegistry PDA for encrypted beacon state
- Deployed to devnet: anon7uu8UtVoFgS8GCSfw2RqyphJhkN3xEjgPwznYDe
- MXE initialized, comp def registered on-chain (cluster offset 456)
- Circuit uploaded to Supabase storage bucket
@FwazB FwazB requested a review from Magicred-1 May 11, 2026 23:52
- 2% fee to treasury on beacon registration (same as ble-revshare)
- SOL native: system_program transfer to treasury wallet
- SPL token: spl_token transfer via optional mint/token accounts
- Added anchor-spl dependency, TREASURY_WALLET + FEE_BPS constants
- Upgraded on devnet: anon7uu8UtVoFgS8GCSfw2RqyphJhkN3xEjgPwznYDe
@Magicred-1
Copy link
Copy Markdown
Member

gm no need to registration fee anymore on beacons:

  • Any Internet connected users is a beacon the Registry track the co-signed transactions.
  • 1% on small amounts and dynamically decreases based on the transaction size volume.
  • No need to keep the rns addresses since they can be rotated pretty easy which would break the data chain..
  • Heartbeat is a good idea but it be replaced by a timestamp_last_cosign .. or something similar.
  • Might be interesting to have stats to return to the user (beacon) such as the fees he's collected so far / the amounts of co-sign he've done so far and his LST Staking amount / Yield ..

…ind for v2

Frontier scope decision: anonbeta1 ships as a plain Anchor registry program
backing the explorer "Active Beacons" metric. Encrypted relay accounting
(private counts, reward calculation, operator stats) moves to v2 of the same
program — same vanity program ID, expand in place.

What stays in anonbeta1:
- register_beacon: writes BeaconRegistry PDA with rns_dest_hash + region_code
- heartbeat: bumps last_heartbeat + heartbeat_count, emits BeaconHeartbeat
- BeaconRegistry account, BeaconRegistered + BeaconHeartbeat events
- 4 errors (InvalidRnsHash, InvalidRegionCode, OperatorMismatch, HeartbeatOverflow)
- Single dep: anchor-lang 0.32.1
- Vanity program ID anon7uu8UtVoFgS8GCSfw2RqyphJhkN3xEjgPwznYDe (already deployed)

What archives to archive/anonbeta1-arcium-bind/ for v2 revival:
- register_beacon_private + beacon_bind_callback + init_beacon_bind_comp_def
  (3 live files moved via git mv, history preserved)
- PrivateBeaconRegistry account, BeaconBindCompleted event
- Arcium/fee errors, treasury constants, beacon_bind circuit snapshot
- README documenting revival path

What stays elsewhere:
- programs/ble-revshare/ untouched (v2 payment seed)
- encrypted-ixs/ keeps payment_v3 circuit (ble-revshare dependency)

Anchor.toml + ble-revshare/lib.rs declare_id! sync to new ble_revshare keypair
i1cAa6iWmL8GRdZisyX2sgJ43jdemdUZh2QbstxTJ2C — accepted side-effect of arcium
build's ID sync. Original 7xeQNUggKc2e5q6AQxsFBLBkXGg2p54kSx11zVainMks deploy
on devnet is orphaned (keypair not available locally); ble-revshare is deferred
to v2 anyway, so the orphan is harmless.

arcium build passes clean. anchor build of anonbeta1 alone is plain Anchor.
@FwazB FwazB changed the title Add beacon_bind Arcium circuit + anonbeta1 program with MPC binding refactor(anonbeta1): strip to registry-only program; archive Arcium bind for v2 May 18, 2026
@FwazB FwazB changed the title refactor(anonbeta1): strip to registry-only program; archive Arcium bind for v2 refactor(anonbeta1): registry-only baseline; archive Arcium bind for v2 May 18, 2026
@FwazB
Copy link
Copy Markdown
Collaborator Author

FwazB commented May 18, 2026

Handoff note on M4gic's review comment:

  • Registration fees are removed from the live anonbeta1 registry path in this PR.
  • The older Arcium/private-registration path is archived, not active.
  • The heartbeat vs. timestamp_last_cosign change is still a product/protocol decision and should be handled as a follow-up, since this PR is only the registry baseline reset.
  • Operator stats are addressed experimentally in PR feat(anonbeta1-v2): add operator-private relay counter #3 via encrypted private relay counts, with public events exposing only liveness/update metadata.

@Magicred-1
Copy link
Copy Markdown
Member

GM, every account can now act as a beacon by default based on his connectivity, so there’s no longer a need for a dedicated Registry PDA.

Instead, confidential transfers should flow directly through the MXEs, with the second signer public key serving as the beacon reference within the smart contract for revenue share. This keeps the architecture leaner and removes unnecessary registry overhead.

The immediate priority should be tightening the confidential transfer flow and making the beacon signature a required secondary signer in the transaction model.

From there, we can fully concentrate on the offline-first direction of the program:

minimize on-chain coordination,
reduce dependency on centralized state lookup,
and ensure transfers remain feasible in disconnected or low-connectivity environments.

In short:

No Registry PDA
Every account is beacon-capable by default
MXEs handle confidential transfers
Second signer PK = beacon identity
Offline-first architecture becomes the primary design target as of now and since everything pass through anonmesh LXMF based network.

@Magicred-1
Copy link
Copy Markdown
Member

- heartbeat: bumps last_heartbeat + heartbeat_count, emits BeaconHeartbeat
- BeaconRegistry account, BeaconRegistered + BeaconHeartbeat events
- 4 errors (InvalidRnsHash, InvalidRegionCode, OperatorMismatch, HeartbeatOverflow)```

Is dead code it's already handled on the anonmesh layer infra, no need for redundance on the program

The beacon co-sign txs with his Beacon keypair and broadcast them from anonmesh, the identity keypair can easily being rotated so no need to stored them onchain.

The instructions need to be totally normally encrypted and handle by Arcium MXEs..

Such as passing a confidential transfer / swap (LSTs) .. etc with the ATA target .. etc

@FwazB FwazB closed this May 20, 2026
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